/**
 *   Contributors:
 *      Thales - initial API and implementation
 */
package org.polarsys.capella.viatra.core.data.interaction.surrogate;

import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
import org.polarsys.capella.viatra.core.data.interaction.surrogate.AbstractCapabilityRealization__realizedCapability;
import org.polarsys.capella.viatra.core.data.interaction.surrogate.AbstractCapabilityRealization__realizingCapability;

/**
 * A pattern group formed of all public patterns defined in AbstractCapabilityRealization.vql.
 *
 *
Use the static instance as any {@link interface org.eclipse.viatra.query.runtime.api.IQueryGroup}, to conveniently prepare
 * a VIATRA Query engine for matching all patterns originally defined in file AbstractCapabilityRealization.vql,
 * in order to achieve better performance than one-by-one on-demand matcher initialization.
 *
 *
 From package org.polarsys.capella.viatra.core.data.interaction.surrogate, the group contains the definition of the following patterns:

 *
AbstractCapabilityRealization__realizedCapability

 *
AbstractCapabilityRealization__realizingCapability

 *

 *
 * @see IQueryGroup
 */
@SuppressWarnings("all")
public final class AbstractCapabilityRealization extends BaseGeneratedPatternGroup {

    /**
     * Access the pattern group.
     *
     * @return the singleton instance of the group
     * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications
     */
    public static AbstractCapabilityRealization instance() {
        if (INSTANCE == null) {
            INSTANCE = new AbstractCapabilityRealization();
        }
        return INSTANCE;
    }

    private static AbstractCapabilityRealization INSTANCE;

    private AbstractCapabilityRealization() {
        querySpecifications.add(AbstractCapabilityRealization__realizedCapability.instance());
        querySpecifications.add(AbstractCapabilityRealization__realizingCapability.instance());
    }

    public AbstractCapabilityRealization__realizedCapability getAbstractCapabilityRealization__realizedCapability() {
        return AbstractCapabilityRealization__realizedCapability.instance();
    }

    public AbstractCapabilityRealization__realizedCapability.Matcher getAbstractCapabilityRealization__realizedCapability(final ViatraQueryEngine engine) {
        return AbstractCapabilityRealization__realizedCapability.Matcher.on(engine);
    }

    public AbstractCapabilityRealization__realizingCapability getAbstractCapabilityRealization__realizingCapability() {
        return AbstractCapabilityRealization__realizingCapability.instance();
    }

    public AbstractCapabilityRealization__realizingCapability.Matcher getAbstractCapabilityRealization__realizingCapability(final ViatraQueryEngine engine) {
        return AbstractCapabilityRealizatio


public static AbstractCapabilityRealization instance() {
        if (INSTANCE == null) {
            INSTANCE = new AbstractCapabilityRealization();
        }
        return INSTANCE;
    }

/**
 *   Contributors:
 *      Thales - initial API and implementation
 */
package org.polarsys.capella.viatra.core.data.interaction.surrogate;

import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
import org.polarsys.capella.viatra.core.data.interaction.surrogate.AbstractCapabilityRealization__realizedCapability;
import org.polarsys.capella.viatra.core.data.interaction.surrogate.AbstractCapabilityRealization__realizingCapability;

/**
 * A pattern group formed of all public patterns defined in AbstractCapabilityRealization.vql.
 *
 *
Use the static instance as any {@link interface org.eclipse.viatra.query.runtime.api.IQueryGroup}, to conveniently prepare
 * a VIATRA Query engine for matching all patterns originally defined in file AbstractCapabilityRealization.vql,
 * in order to achieve better performance than one-by-one on-demand matcher initialization.
 *
 *
 From package org.polarsys.capella.viatra.core.data.interaction.surrogate, the group contains the definition of the following patterns:

 *
AbstractCapabilityRealization__realizedCapability

 *
AbstractCapabilityRealization__realizingCapability

 *

 *
 * @see IQueryGroup
 */
@SuppressWarnings("all")
public final class AbstractCapabilityRealization extends BaseGeneratedPatternGroup {

    /**
     * Access the pattern group.
     *
     * @return the singleton instance of the group
     * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications
     */

    private static AbstractCapabilityRealization INSTANCE;

    private AbstractCapabilityRealization() {
        querySpecifications.add(AbstractCapabilityRealization__realizedCapability.instance());
        querySpecifications.add(AbstractCapabilityRealization__realizingCapability.instance());
    }

    public AbstractCapabilityRealization__realizedCapability getAbstractCapabilityRealization__realizedCapability() {
        return AbstractCapabilityRealization__realizedCapability.instance();
    }

    public AbstractCapabilityRealization__realizedCapability.Matcher getAbstractCapabilityRealization__realizedCapability(final ViatraQueryEngine engine) {
        return AbstractCapabilityRealization__realizedCapability.Matcher.on(engine);
    }

    public AbstractCapabilityRealization__realizingCapability getAbstractCapabilityRealization__realizingCapability() {
        return AbstractCapabilityRealization__realizingCapability.instance();
    }

    public AbstractCapabilityRealization__realizingCapability.Matcher getAbstractCapabilityRealization__realizingCapability(final ViatraQueryEngine engine) {
        return AbstractCapabilityRealization__realizingCapability.Matcher.on(engine);
    }
}


@Override
    public Photo toScim(PhotoEntity entity)

package org.osiam.resources.converter;

import org.osiam.resources.exception.OsiamException;
import org.osiam.resources.scim.Photo;
import org.osiam.storage.entities.PhotoEntity;
import org.springframework.stereotype.Service;
import java.net.URI;
import java.net.URISyntaxException;

@Service
public class PhotoConverter implements Converter<Photo, PhotoEntity> {

    @Override
    public PhotoEntity fromScim(Photo scim) {
        PhotoEntity photoEntity = new PhotoEntity();
        photoEntity.setValue(scim.getValueAsURI().toString());
        photoEntity.setType(scim.getType());
        photoEntity.setPrimary(scim.isPrimary());
        photoEntity.setDisplay(scim.getDisplay());
        return photoEntity;
    }

{
        Photo scimPhoto;
        try {
            scimPhoto = new Photo.Builder().setType(entity.getType()).setValue(new URI(entity.getValue())).setPrimary(entity.isPrimary()).setDisplay(entity.getDisplay()).build();
        } catch (URISyntaxException e) {
            throw new OsiamException(e.getMessage(), e);
        }
        return scimPhoto;
    }
}


{
        PhotoEntity photoEntity = new PhotoEntity();
        photoEntity.setValue(scim.getValueAsURI().toString());
        photoEntity.setType(scim.getType());
        photoEntity.setPrimary(scim.isPrimary());
        photoEntity.setDisplay(scim.getDisplay());
        return photoEntity;
    }

package org.osiam.resources.converter;

import org.osiam.resources.exception.OsiamException;
import org.osiam.resources.scim.Photo;
import org.osiam.storage.entities.PhotoEntity;
import org.springframework.stereotype.Service;
import java.net.URI;
import java.net.URISyntaxException;

@Service
public class PhotoConverter implements Converter<Photo, PhotoEntity> {

    @Override
    public PhotoEntity fromScim(Photo scim)

    @Override
    public Photo toScim(PhotoEntity entity) {
        Photo scimPhoto;
        try {
            scimPhoto = new Photo.Builder().setType(entity.getType()).setValue(new URI(entity.getValue())).setPrimary(entity.isPrimary()).setDisplay(entity.getDisplay()).build();
        } catch (URISyntaxException e) {
            throw new OsiamException(e.getMessage(), e);
        }
        return scimPhoto;
    }
}


package org.osiam.resources.converter;

import org.osiam.resources.exception.OsiamException;
import org.osiam.resources.scim.Photo;
import org.osiam.storage.entities.PhotoEntity;
import org.springframework.stereotype.Service;
import java.net.URI;
import java.net.URISyntaxException;

@Service
public class PhotoConverter implements Converter<Photo, PhotoEntity> {

    @Override
    public PhotoEntity fromScim(Photo scim) {
        PhotoEntity photoEntity = new PhotoEntity();
        photoEntity.setValue(scim.getValueAsURI().toString());
        photoEntity.setType(scim.getType());
        photoEntity.setPrimary(scim.isPrimary());
        photoEntity.setDisplay(scim.getDisplay());
        return photoEntity;
    }

    @Override
    public Photo toScim(PhotoEntity entity) {
        Photo scimP

        try {
            scimPhoto = new Photo.Builder().setType(entity.getType()).setValue(new URI(entity.getValue())).setPrimary(entity.isPrimary()).setDisplay(entity.getDisplay()).build();
        } catch (URISyntaxException e) {
            throw new OsiamException(e.getMessage(), e);
        }
        return scimPhoto;
    }
}


try {
            scimPhoto = new Photo.Builder().setType(entity.getType()).setValue(new URI(entity.getValue())).setPrimary(entity.isPrimary()).setDisplay(entity.getDisplay()).build();
        } catch (URISyntaxException e) {
            throw new OsiamException(e.getMessage(), e);
        }

package org.osiam.resources.converter;

import org.osiam.resources.exception.OsiamException;
import org.osiam.resources.scim.Photo;
import org.osiam.storage.entities.PhotoEntity;
import org.springframework.stereotype.Service;
import java.net.URI;
import java.net.URISyntaxException;

@Service
public class PhotoConverter implements Converter<Photo, PhotoEntity> {

    @Override
    public PhotoEntity fromScim(Photo scim) {
        PhotoEntity photoEntity = new PhotoEntity();
        photoEntity.setValue(scim.getValueAsURI().toString());
        photoEntity.setType(scim.getType());
        photoEntity.setPrimary(scim.isPrimary());
        photoEntity.setDisplay(scim.getDisplay());
        return photoEntity;
    }

    @Override
    public Photo toScim(PhotoEntity entity) {
        Photo scimPhoto;


public List<SysAclModel> getRoleAclList(int roleId)

package com.lq.service.impl;

import com.google.common.collect.Lists;
import com.lq.entity.SysAcl;
import com.lq.entity.SysUser;
import com.lq.enums.CahceKeyConst;
import com.lq.enums.DataUseful;
import com.lq.enums.RoleTypeEnum;
import com.lq.model.SysAclModel;
import com.lq.model.SysRoleModel;
import com.lq.redis.SysCacheServiceOfRedis;
import com.lq.repository.SysAclRepository;
import com.lq.repository.SysRoleAclRepository;
import com.lq.repository.SysRoleRepository;
import com.lq.repository.SysRoleUserRepository;
import com.lq.service.SysRoleUserService;
import com.lq.utils.JsonMapper;
import com.lq.utils.LoginHolder;
import org.codehaus.jackson.type.TypeReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

@Service
public class SysCoreService {

    @Autowired
    private SysAclRepository sysAclRepository;

    @Autowired
    private SysRoleUserRepository sysRoleUserRepository;

    @Autowired
    private SysRoleRepository sysRoleRepository;

    @Autowired
    private SysRoleAclRepository sysRoleAclRepository;

    @Resource(name = "sysCacheServiceOfRedis")
    private SysCacheServiceOfRedis sysCacheServiceOfRedis;

    public List<SysAclModel> getCurrentUserAclList() {
        Integer userId = LoginHolder.getUserId();
        return getUserAclListFromCache(userId);
    }

{
        List<Integer> aclIdList = sysRoleAclRepository.getAclIdListByRoleIdList(new ArrayList<>(roleId));
        if (CollectionUtils.isEmpty(aclIdList)) {
            return Lists.newArrayList();
        }
        return sysAclRepository.getByIdList(aclIdList);
    }

    public List<SysAclModel> getUserAclList(int userId) {
        if (isSuperAdmin()) {
            return sysAclRepository.getAll();
        }
        List<Integer> userRoleIdList = sysRoleUserRepository.getRoleIDListByUserId(userId);
        if (CollectionUtils.isEmpty(userRoleIdList)) {
            return Lists.newArrayList();
        }
        List<Integer> userAclIdList = sysRoleAclRepository.getAclIdListByRoleIdList(userRoleIdList);
        if (CollectionUtils.isEmpty(userAclIdList)) {
            return Lists.newArrayList();
        }
        return sysAclRepository.getByIdList(userAclIdList);
    }

    public List<SysAclModel> getUserAclListFromCache(int userId) {
        String cacheValue = sysCacheServiceOfRedis.getFromCache(CahceKeyConst.USER_ACLS, String.valueOf(userId));
        if (cacheValue == null) {
            List<SysAclModel> userAclList = getUserAclList(userId);
            // timeOutSeconds  可以自由配置 建议写在配置文件中, 1800：半小时
            if (!CollectionUtils.isEmpty(userAclList)) {
                sysCacheServiceOfRedis.saveCache(JsonMapper.obj2String(userAclList), 1800, CahceKeyConst.USER_ACLS, String.valueOf(userId));
            }
            return CollectionUtils.isEmpty(userAclList) ? Lists.newArrayList() : userAclList;
        }
        return JsonMapper.string2Obj(cacheValue, new TypeReference<List<SysAclModel>>() {
        });
    }

    public boolean isSuperAdmin() {
        List<Integer> roleIDListByUserId = sysRoleUserRepository.getRoleIDListByUserId(LoginHolder.getUserId());
        if (CollectionUtils.isEmpty(roleIDListByUserId)) {
            return false;
        }
        List<SysRoleModel> roles = sysRoleRepository.getRoleByIdList(roleIDListByUserId);
        if (CollectionUtils.isEmpty(roles)) {
            return false;
        }
        for (SysRoleModel role : roles) {
            if (role == null || role.getStatus().equals(DataUseful.NOUSEFUL.getCode())) {
                continue;
            }
            if (role.getType().equals(RoleTypeEnum.SuperAdmin.getCode())) {
                return true;
            }
        }
        return false;
    }

    public Boolean hasAclOfThisUrl(String url) {
        if (isSuperAdmin()) {
            return true;
        }
        SysAcl param = new SysAcl();
        param.setUrl(url);
        List<SysAcl> sysAcls = sysAclRepository.selectPage(param, null);
        if (CollectionUtils.isEmpty(sysAcls)) {
            return true;
        }
        List<SysAclModel> currentUserAclList = getCurrentUserAclList();
        Set<Integer> userAclIdSet = currentUserAclList.stream().map(e -> e.getId()).collect(Collectors.toSet());
        boolean hasValidAcl = false;
        for (SysAcl sysAcl : sysAcls) {
            if (sysAcl == null || sysAcl.getStatus().equals(DataUseful.NOUSEFUL.getCode())) {
                continue;
            }
            hasValidAcl = true;
            if (userAclIdSet.contains(sysAcl.getId())) {
                return true;
            }
        }
        if (!hasValidAcl) {
            return true;
        }
        return false;
    }
}


{
        Integer userId = LoginHolder.getUserId();
        return getUserAclListFromCache(userId);
    }

package com.lq.service.impl;

import com.google.common.collect.Lists;
import com.lq.entity.SysAcl;
import com.lq.entity.SysUser;
import com.lq.enums.CahceKeyConst;
import com.lq.enums.DataUseful;
import com.lq.enums.RoleTypeEnum;
import com.lq.model.SysAclModel;
import com.lq.model.SysRoleModel;
import com.lq.redis.SysCacheServiceOfRedis;
import com.lq.repository.SysAclRepository;
import com.lq.repository.SysRoleAclRepository;
import com.lq.repository.SysRoleRepository;
import com.lq.repository.SysRoleUserRepository;
import com.lq.service.SysRoleUserService;
import com.lq.utils.JsonMapper;
import com.lq.utils.LoginHolder;
import org.codehaus.jackson.type.TypeReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

@Service
public class SysCoreService {

    @Autowired
    private SysAclRepository sysAclRepository;

    @Autowired
    private SysRoleUserRepository sysRoleUserRepository;

    @Autowired
    private SysRoleRepository sysRoleRepository;

    @Autowired
    private SysRoleAclRepository sysRoleAclRepository;

    @Resource(name = "sysCacheServiceOfRedis")
    private SysCacheServiceOfRedis sysCacheServiceOfRedis;

    public List<SysAclModel> getCurrentUserAclList()

    public List<SysAclModel> getRoleAclList(int roleId) {
        List<Integer> aclIdList = sysRoleAclRepository.getAclIdListByRoleIdList(new ArrayList<>(roleId));
        if (CollectionUtils.isEmpty(aclIdList)) {
            return Lists.newArrayList();
        }
        return sysAclRepository.getByIdList(aclIdList);
    }

    public List<SysAclModel> getUserAclList(int userId) {
        if (isSuperAdmin()) {
            return sysAclRepository.getAll();
        }
        List<Integer> userRoleIdList = sysRoleUserRepository.getRoleIDListByUserId(userId);
        if (CollectionUtils.isEmpty(userRoleIdList)) {
            return Lists.newArrayList();
        }
        List<Integer> userAclIdList = sysRoleAclRepository.getAclIdListByRoleIdList(userRoleIdList);
        if (CollectionUtils.isEmpty(userAclIdList)) {
            return Lists.newArrayList();
        }
        return sysAclRepository.getByIdList(userAclIdList);
    }

    public List<SysAclModel> getUserAclListFromCache(int userId) {
        String cacheValue = sysCacheServiceOfRedis.getFromCache(CahceKeyConst.USER_ACLS, String.valueOf(userId));
        if (cacheValue == null) {
            List<SysAclModel> userAclList = getUserAclList(userId);
            // timeOutSeconds  可以自由配置 建议写在配置文件中, 1800：半小时
            if (!CollectionUtils.isEmpty(userAclList)) {
                sysCacheServiceOfRedis.saveCache(JsonMapper.obj2String(userAclList), 1800, CahceKeyConst.USER_ACLS, String.valueOf(userId));
            }
            return CollectionUtils.isEmpty(userAclList) ? Lists.newArrayList() : userAclList;
        }
        return JsonMapper.string2Obj(cacheValue, new TypeReference<List<SysAclModel>>() {
        });
    }

    public boolean isSuperAdmin() {
        List<Integer> roleIDListByUserId = sysRoleUserRepository.getRoleIDListByUserId(LoginHolder.getUserId());
        if (CollectionUtils.isEmpty(roleIDListByUserId)) {
            return false;
        }
        List<SysRoleModel> roles = sysRoleRepository.getRoleByIdList(roleIDListByUserId);
        if (CollectionUtils.isEmpty(roles)) {
            return false;
        }
        for (SysRoleModel role : roles) {
            if (role == null || role.getStatus().equals(DataUseful.NOUSEFUL.getCode())) {
                continue;
            }
            if (role.getType().equals(RoleTypeEnum.SuperAdmin.getCode())) {
                return true;
            }
        }
        return false;
    }

    public Boolean hasAclOfThisUrl(String url) {
        if (isSuperAdmin()) {
            return true;
        }
        SysAcl param = new SysAcl();
        param.setUrl(url);
        List<SysAcl> sysAcls = sysAclRepository.selectPage(param, null);
        if (CollectionUtils.isEmpty(sysAcls)) {
            return true;
        }
        List<SysAclModel> currentUserAclList = getCurrentUserAclList();
        Set<Integer> userAclIdSet = currentUserAclList.stream().map(e -> e.getId()).collect(Collectors.toSet());
        boolean hasValidAcl = false;
        for (SysAcl sysAcl : sysAcls) {
            if (sysAcl == null || sysAcl.getStatus().equals(DataUseful.NOUSEFUL.getCode())) {
                continue;
            }
            hasValidAcl = true;
            if (userAclIdSet.contains(sysAcl.getId())) {
                return true;
            }
        }
        if (!hasValidAcl) {
            return true;
        }
        return false;
    }
}


package com.lq.service.impl;

import com.google.common.collect.Lists;
import com.lq.entity.SysAcl;
import com.lq.entity.SysUser;
import com.lq.enums.CahceKeyConst;
import com.lq.enums.DataUseful;
import com.lq.enums.RoleTypeEnum;
import com.lq.model.SysAclModel;
import com.lq.model.SysRoleModel;
import com.lq.redis.SysCacheServiceOfRedis;
import com.lq.repository.SysAclRepository;
import com.lq.repository.SysRoleAclRepository;
import com.lq.repository.SysRoleRepository;
import com.lq.repository.SysRoleUserRepository;
import com.lq.service.SysRoleUserService;
import com.lq.utils.JsonMapper;
import com.lq.utils.LoginHolder;
import org.codehaus.jackson.type.TypeReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

@Service
public class SysCoreService {

    @Autowired
    private SysAclRepository sysAclRepository;

    @Autowired
    private SysRoleUserRepository sysRoleUserRepository;

    @Autowired
    private SysRoleRepository sysRoleRepository;

    @Autowired
    private SysRoleAclRepository sysRoleAclRepository;

    @Resource(name = "sysCacheServiceOfRedis")
    private SysCacheServiceOfRedis sysCacheServiceOfRedis;

    public List<SysAclModel> getCurrentUserAclList() {
        Integer userId = LoginHolder.getUser

        return getUserAclListFromCache(userId);
    }

    public List<SysAclModel> getRoleAclList(int roleId) {
        List<Integer> aclIdList = sysRoleAclRepository.getAclIdListByRoleIdList(new ArrayList<>(roleId));
        if (CollectionUtils.isEmpty(aclIdList)) {
            return Lists.newArrayList();
        }
        return sysAclRepository.getByIdList(aclIdList);
    }

    public List<SysAclModel> getUserAclList(int userId) {
        if (isSuperAdmin()) {
            return sysAclRepository.getAll();
        }
        List<Integer> userRoleIdList = sysRoleUserRepository.getRoleIDListByUserId(userId);
        if (CollectionUtils.isEmpty(userRoleIdList)) {
            return Lists.newArrayList();
        }
        List<Integer> userAclIdList = sysRoleAclRepository.getAclIdListByRoleIdList(userRoleIdList);
        if (CollectionUtils.isEmpty(userAclIdList)) {
            return Lists.newArrayList();
        }
        return sysAclRepository.getByIdList(userAclIdList);
    }

    public List<SysAclModel> getUserAclListFromCache(int userId) {
        String cacheValue = sysCacheServiceOfRedis.getFromCache(CahceKeyConst.USER_ACLS, String.valueOf(userId));
        if (cacheValue == null) {
            List<SysAclModel> userAclList = getUserAclList(userId);
            // timeOutSeconds  可以自由配置 建议写在配置文件中, 1800：半小时
            if (!CollectionUtils.isEmpty(userAclList)) {
                sysCacheServiceOfRedis.saveCache(JsonMapper.obj2String(userAclList), 1800, CahceKeyConst.USER_ACLS, String.valueOf(userId));
            }
            return CollectionUtils.isEmpty(userAclList) ? Lists.newArrayList() : userAclList;
        }
        return JsonMapper.string2Obj(cacheValue, new TypeReference<List<SysAclModel>>() {
        });
    }

    public boolean isSuperAdmin() {
        List<Integer> roleIDListByUserId = sysRoleUserRepository.getRoleIDListByUserId(LoginHolder.getUserId());
        if (CollectionUtils.isEmpty(roleIDListByUserId)) {
            return false;
        }
        List<SysRoleModel> roles = sysRoleRepository.getRoleByIdList(roleIDListByUserId);
        if (CollectionUtils.isEmpty(roles)) {
            return false;
        }
        for (SysRoleModel role : roles) {
            if (role == null || role.getStatus().equals(DataUseful.NOUSEFUL.getCode())) {
                continue;
            }
            if (role.getType().equals(RoleTypeEnum.SuperAdmin.getCode())) {
                return true;
            }
        }
        return false;
    }

    public Boolean hasAclOfThisUrl(String url) {
        if (isSuperAdmin()) {
            return true;
        }
        SysAcl param = new SysAcl();
        param.setUrl(url);
        List<SysAcl> sysAcls = sysAclRepository.selectPage(param, null);
        if (CollectionUtils.isEmpty(sysAcls)) {
            return true;
        }
        List<SysAclModel> currentUserAclList = getCurrentUserAclList();
        Set<Integer> userAclIdSet = currentUserAclList.stream().map(e -> e.getId()).collect(Collectors.toSet());
        boolean hasValidAcl = false;
        for (SysAcl sysAcl : sysAcls) {
            if (sysAcl == null || sysAcl.getStatus().equals(DataUseful.NOUSEFUL.getCode())) {
                continue;
            }
            hasValidAcl = true;
            if (userAclIdSet.contains(sysAcl.getId())) {
                return true;
            }
        }
        if (!hasValidAcl) {
            return true;
        }
        return false;
    }
}


package com.animania.addons.catsdogs.common.entity.felids;

import net.minecraft.world.World;

public class CatRagdoll {

    public static class EntityTomRagdoll extends EntityTomBase {

        public EntityTomRagdoll(World worldIn) {
            super(worldIn);
            this.type = CatType.RAGDOLL;
        }

        @Override
        public int getPrimaryEggColor() {
            return 13948116;
        }

{
            return 8741209;
        }
    }

    public static class EntityQueenRagdoll extends EntityQueenBase {

        public EntityQueenRagdoll(World worldIn) {
            super(worldIn);
            this.type = CatType.RAGDOLL;
        }

        @Override
        public int getPrimaryEggColor() {
            return 13948116;
        }

        @Override
        public int getSecondaryEggColor() {
            return 8741209;
        }
    }

    public static class EntityKittenRagdoll extends EntityKittenBase {

        public EntityKittenRagdoll(World worldIn) {
            super(worldIn);
            this.type = CatType.RAGDOLL;
        }

        @Override
        public int getPrimaryEggColor() {
            return 13948116;
        }

        @Override
        public int getSecondaryEggColor() {
            return 8741209;
        }
    }
}


package com.animania.addons.catsdogs.common.entity.felids;

import net.minecraft.world.World;

public class CatRagdoll {

    public static class EntityTomRagdoll extends EntityTomBase {

        public EntityTomRagdoll(World worldIn) {
            super(worldIn);
            this.type = CatType.RAGDOLL;
        }

        @Override
        public int getPrimaryEggColor() {
            return 13948116;
        }

        @Override
        public int getSecondaryEggColor() {
            return 8741209;
        }
    }

    public static class EntityQueenRagdoll extends EntityQueenBase {

        public EntityQueenRagdoll(World worldIn) {
            super(worldIn);
            this.type = CatType.RAGDOLL;
        }

        @Override
        public int getPrimaryEggColor() {
            return 13948116;
        }

        @Override
        public int getSecondaryEggColor() {
            return 8741209;
        }
    }

    public static class EntityKittenRagdoll extends EntityKittenBase {

        public EntityKittenRagdoll(World worldIn) {
            super(worldIn);
            this.type = CatType.RAGDOLL;
        }

        @Override
        public int getPrimaryEggColor() {
            return 13948116;
        }

        @Override
        public int getSecondaryEggColor()


package com.animania.addons.catsdogs.common.entity.felids;

import net.minecraft.world.World;

public class CatRagdoll {

    public static class EntityTomRagdoll extends EntityTomBase {

        public EntityTomRagdoll(World worldIn) {
            super(worldIn);
            this.type = CatType.RAGDOLL;
        }

        @Override
        public int getPrimaryEggColor() {
            retur

        }

        @Override
        public int getSecondaryEggColor() {
            return 8741209;
        }
    }

    public static class EntityQueenRagdoll extends EntityQueenBase {

        public EntityQueenRagdoll(World worldIn) {
            super(worldIn);
            this.type = CatType.RAGDOLL;
        }

        @Override
        public int getPrimaryEggColor() {
            return 13948116;
        }

        @Override
        public int getSecondaryEggColor() {
            return 8741209;
        }
    }

    public static class EntityKittenRagdoll extends EntityKittenBase {

        public EntityKittenRagdoll(World worldIn) {
            super(worldIn);
            this.type = CatType.RAGDOLL;
        }

        @Override
        public int getPrimaryEggColor() {
            return 13948116;
        }

        @Override
        public int getSecondaryEggColor() {
            return 8741209;
        }
    }
}


// Oracle - initial API and implementation from Oracle TopLink
package org.eclipse.persistence.testing.tests.unitofwork.writechanges;

import org.eclipse.persistence.internal.sessions.UnitOfWorkImpl;
import org.eclipse.persistence.sessions.UnitOfWork;
import org.eclipse.persistence.testing.framework.AutoVerifyTestCase;
import org.eclipse.persistence.testing.framework.TestErrorException;

/**
 * @author  smcritch
 */
public class WriteChanges_Release_TestCase extends AutoVerifyTestCase {

{
        UnitOfWork uow = getSession().acquireUnitOfWork();
        uow.writeChanges();
        uow.release();
        if (((UnitOfWorkImpl) uow).isInTransaction()) {
            throw new TestErrorException("Even though release was called, since we already wrote changes and started the transaction, it must be rolled back.");
        }
    }
}


{
        UnitOfWork uow = getSession().acquireUnitOfWork();
        uow.writeChanges();
        uow.release();
        if (((UnitOfWorkImpl) uow).isInTransaction()) {
            throw new TestErrorException("Even though release was called, since we already wrote changes and started the transaction, it must be rolled back.");
        }
    }

// Oracle - initial API and implementation from Oracle TopLink
package org.eclipse.persistence.testing.tests.unitofwork.writechanges;

import org.eclipse.persistence.internal.sessions.UnitOfWorkImpl;
import org.eclipse.persistence.sessions.UnitOfWork;
import org.eclipse.persistence.testing.framework.AutoVerifyTestCase;
import org.eclipse.persistence.testing.framework.TestErrorException;

/**
 * @author  smcritch
 */
public class WriteChanges_Release_TestCase extends AutoVerifyTestCase {

    @Override
    public void test()


// Oracle - initial API and implementation from Oracle TopLink
package org.eclipse.persistence.testing.tests.unitofwork.writechanges;

import org.eclipse.persistence.internal.sessions.UnitOfWorkImpl;
import org.eclipse.persistence.sessions.UnitOfWork;
import org.eclipse.persistence.testing.framework.AutoVerifyTestCase;
import org.eclipse.persistence.testing.framework.TestErrorException;

/**
 * @author  smcritch
 */
public class WriteChanges_Release_TestCase extends AutoVerifyTestCase {

    @Override
    public void test() {
        UnitOfWork uow = getSession().acquireUnitOfWork();
        uow.wri

        uow.release();
        if (((UnitOfWorkImpl) uow).isInTransaction()) {
            throw new TestErrorException("Even though release was called, since we already wrote changes and started the transaction, it must be rolled back.");
        }
    }
}


@Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException

package com.liferay.portal.spring.bean;

import com.liferay.petra.string.StringBundler;
import com.liferay.portal.internal.cluster.ClusterableAdvice;
import com.liferay.portal.kernel.bean.BeanLocatorException;
import com.liferay.portal.kernel.bean.BeanReference;
import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.util.ReflectionUtils;

/**
 * @author Michael Young
 * @author Shuyang Zhou
 */
public class BeanReferenceAnnotationBeanPostProcessor implements BeanPostProcessor {

    public BeanReferenceAnnotationBeanPostProcessor(BeanFactory beanFactory) {
        _beanFactory = beanFactory;
    }

    public void destroy() {
        _beans.clear();
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }

{
        if (!(bean instanceof IdentifiableOSGiService) && beanName.endsWith("Service") && _log.isWarnEnabled()) {
            _log.warn(StringBundler.concat(beanName, " should implement ", IdentifiableOSGiService.class.getName(), " for ", ClusterableAdvice.class.getName()));
        }
        _autoInject(bean, beanName, bean.getClass());
        return bean;
    }

    private void _autoInject(Object targetBean, String targetBeanName, Class<?> beanClass) {
        if ((beanClass == null) || beanClass.isInterface()) {
            return;
        }
        String className = beanClass.getName();
        if (className.equals(_JAVA_LANG_OBJECT) || className.startsWith(_ORG_SPRINGFRAMEWORK)) {
            return;
        }
        Field[] fields = beanClass.getDeclaredFields();
        for (Field field : fields) {
            BeanReference beanReference = field.getAnnotation(BeanReference.class);
            String referencedBeanName = null;
            Class<?> referencedBeanType = null;
            if (beanReference != null) {
                referencedBeanName = beanReference.name();
                referencedBeanType = beanReference.type();
            } else {
                continue;
            }
            if (!Object.class.equals(referencedBeanType)) {
                referencedBeanName = referencedBeanType.getName();
            }
            Object referencedBean = _beans.get(referencedBeanName);
            if (referencedBean == null) {
                try {
                    referencedBean = _beanFactory.getBean(referencedBeanName);
                } catch (NoSuchBeanDefinitionException noSuchBeanDefinitionException) {
                    try {
                        referencedBean = PortalBeanLocatorUtil.locate(referencedBeanName);
                    } catch (BeanLocatorException beanLocatorException) {
                        StringWriter stringWriter = new StringWriter();
                        try (PrintWriter printWriter = new PrintWriter(stringWriter)) {
                            printWriter.print("BeanFactory could not find bean: ");
                            noSuchBeanDefinitionException.printStackTrace(printWriter);
                            printWriter.print(" and PortalBeanLocator failed with: ");
                            printWriter.append(beanLocatorException.getMessage());
                        }
                        throw new BeanLocatorException(stringWriter.toString(), beanLocatorException);
                    }
                }
                _beans.put(referencedBeanName, referencedBean);
            }
            ReflectionUtils.makeAccessible(field);
            try {
                field.set(targetBean, referencedBean);
            } catch (Throwable throwable) {
                throw new BeanCreationException(targetBeanName, "Could not inject BeanReference fields", throwable);
            }
        }
        _autoInject(targetBean, targetBeanName, beanClass.getSuperclass());
    }

    private static final String _JAVA_LANG_OBJECT = "java.lang.Object";

    private static final String _ORG_SPRINGFRAMEWORK = "org.springframework";

    private static final Log _log = LogFactoryUtil.getLog(BeanReferenceAnnotationBeanPostProcessor.class);

    private final BeanFactory _beanFactory;

    private final Map<String, Object> _beans = new HashMap<>();
}


{
        if (!(bean instanceof IdentifiableOSGiService) && beanName.endsWith("Service") && _log.isWarnEnabled()) {
            _log.warn(StringBundler.concat(beanName, " should implement ", IdentifiableOSGiService.class.getName(), " for ", ClusterableAdvice.class.getName()));
        }
        _autoInject(bean, beanName, bean.getClass());
        return bean;
    }

package com.liferay.portal.spring.bean;

import com.liferay.petra.string.StringBundler;
import com.liferay.portal.internal.cluster.ClusterableAdvice;
import com.liferay.portal.kernel.bean.BeanLocatorException;
import com.liferay.portal.kernel.bean.BeanReference;
import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.util.ReflectionUtils;

/**
 * @author Michael Young
 * @author Shuyang Zhou
 */
public class BeanReferenceAnnotationBeanPostProcessor implements BeanPostProcessor {

    public BeanReferenceAnnotationBeanPostProcessor(BeanFactory beanFactory) {
        _beanFactory = beanFactory;
    }

    public void destroy() {
        _beans.clear();
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException

    private void _autoInject(Object targetBean, String targetBeanName, Class<?> beanClass) {
        if ((beanClass == null) || beanClass.isInterface()) {
            return;
        }
        String className = beanClass.getName();
        if (className.equals(_JAVA_LANG_OBJECT) || className.startsWith(_ORG_SPRINGFRAMEWORK)) {
            return;
        }
        Field[] fields = beanClass.getDeclaredFields();
        for (Field field : fields) {
            BeanReference beanReference = field.getAnnotation(BeanReference.class);
            String referencedBeanName = null;
            Class<?> referencedBeanType = null;
            if (beanReference != null) {
                referencedBeanName = beanReference.name();
                referencedBeanType = beanReference.type();
            } else {
                continue;
            }
            if (!Object.class.equals(referencedBeanType)) {
                referencedBeanName = referencedBeanType.getName();
            }
            Object referencedBean = _beans.get(referencedBeanName);
            if (referencedBean == null) {
                try {
                    referencedBean = _beanFactory.getBean(referencedBeanName);
                } catch (NoSuchBeanDefinitionException noSuchBeanDefinitionException) {
                    try {
                        referencedBean = PortalBeanLocatorUtil.locate(referencedBeanName);
                    } catch (BeanLocatorException beanLocatorException) {
                        StringWriter stringWriter = new StringWriter();
                        try (PrintWriter printWriter = new PrintWriter(stringWriter)) {
                            printWriter.print("BeanFactory could not find bean: ");
                            noSuchBeanDefinitionException.printStackTrace(printWriter);
                            printWriter.print(" and PortalBeanLocator failed with: ");
                            printWriter.append(beanLocatorException.getMessage());
                        }
                        throw new BeanLocatorException(stringWriter.toString(), beanLocatorException);
                    }
                }
                _beans.put(referencedBeanName, referencedBean);
            }
            ReflectionUtils.makeAccessible(field);
            try {
                field.set(targetBean, referencedBean);
            } catch (Throwable throwable) {
                throw new BeanCreationException(targetBeanName, "Could not inject BeanReference fields", throwable);
            }
        }
        _autoInject(targetBean, targetBeanName, beanClass.getSuperclass());
    }

    private static final String _JAVA_LANG_OBJECT = "java.lang.Object";

    private static final String _ORG_SPRINGFRAMEWORK = "org.springframework";

    private static final Log _log = LogFactoryUtil.getLog(BeanReferenceAnnotationBeanPostProcessor.class);

    private final BeanFactory _beanFactory;

    private final Map<String, Object> _beans = new HashMap<>();
}


package com.liferay.portal.spring.bean;

import com.liferay.petra.string.StringBundler;
import com.liferay.portal.internal.cluster.ClusterableAdvice;
import com.liferay.portal.kernel.bean.BeanLocatorException;
import com.liferay.portal.kernel.bean.BeanReference;
import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.util.ReflectionUtils;

/**
 * @author Michael Young
 * @author Shuyang Zhou
 */
public class BeanReferenceAnnotationBeanPostProcessor implements BeanPostProcessor {

    public BeanReferenceAnnotationBeanPostProcessor(BeanFactory beanFactory) {
        _beanFactory = beanFactory;
    }

    public void destroy() {
        _beans.clear();
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        if (!(bean instanceof IdentifiableOSGiService) && beanName.endsWith("Service") && _log.isWarnEnabled()) {
            _log.warn(StringBundler.concat(beanName, " should implement ", IdentifiableOSGiService.class.getName(), " for ", ClusterableAdvice.class.getName()));
        }
        _autoInject(bean, beanName, bean.getClass());
        return bean;
    }

    private void _autoInject(Object targetBean, String targetBeanName, Class<?> beanClass) {
        if ((beanClass == null) || beanClass.isInterface()) {
            return;
        }
        String className = beanClass.getName();
        if (className.equals(_JAVA_LANG_OBJECT) || className.startsWith(_ORG_SPRINGFRAMEWORK)) {
            return;
        }
        Field[] fields = beanClass.getDeclaredFields();
        for (Field field : fields) {
            BeanReference beanReference = field.getAnnotation(BeanReference.class);
            String referencedBeanName = null;
            Class<?> referencedBeanType = null;
            if (beanReference != null) {
                referencedBeanName = beanReference.name();
                referencedBeanType = beanReference.type();
            } else {
                continue;
            }
            if (!Object.class.equals(referencedBeanType)) {
                referencedBeanName = referencedBeanType.getName();
            }
            Object referencedBean = _beans.get(referencedBeanName);
            if (referencedBean == null) {
                try {
                    referencedBean = _beanFactory.getBean(referencedBeanName);
                } catch (NoSuchBeanDefinitionException noSuchBeanDefinitionException) {
                    try {
                        referencedBean = PortalBeanLocatorUtil.locate(referencedBeanName);
                    } catch (BeanLocatorException beanLocatorException) {
                        StringWriter stringWriter = new StringWriter();
                        try (PrintWriter printWriter = new PrintWriter(stringWriter)) {
                            printWriter.print("BeanFactory could not find bean: ");
                            noSuchBeanDefinitionException.printStackTrace(printWriter);
                            printWriter.print(" and PortalBeanLocator failed with: ");
                            printWriter.append(beanLocatorException.getMessage());
                        }
                        throw new BeanLocatorException(stringWriter.toString(), beanLocatorException);
                    }
                }
                _beans.put(referencedBeanName, referencedBean);
            }
            ReflectionUtils.makeAccessible(field);
            try {
                field.set(targetBean, referencedBean);
            } catch (Throwable throwable) {
                throw new BeanCreationException(targetBeanName, "Could not inject BeanReference fields", throwable);
            }
        }
        _autoInject(targetBean, targetBeanN

    }

    private static final String _JAVA_LANG_OBJECT = "java.lang.Object";

    private static final String _ORG_SPRINGFRAMEWORK = "org.springframework";

    private static final Log _log = LogFactoryUtil.getLog(BeanReferenceAnnotationBeanPostProcessor.class);

    private final BeanFactory _beanFactory;

    private final Map<String, Object> _beans = new HashMap<>();
}


try {
                field.set(targetBean, referencedBean);
            } catch (Throwable throwable) {
                throw new BeanCreationException(targetBeanName, "Could not inject BeanReference fields", throwable);
            }

package com.liferay.portal.spring.bean;

import com.liferay.petra.string.StringBundler;
import com.liferay.portal.internal.cluster.ClusterableAdvice;
import com.liferay.portal.kernel.bean.BeanLocatorException;
import com.liferay.portal.kernel.bean.BeanReference;
import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.util.ReflectionUtils;

/**
 * @author Michael Young
 * @author Shuyang Zhou
 */
public class BeanReferenceAnnotationBeanPostProcessor implements BeanPostProcessor {

    public BeanReferenceAnnotationBeanPostProcessor(BeanFactory beanFactory) {
        _beanFactory = beanFactory;
    }

    public void destroy() {
        _beans.clear();
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        if (!(bean instanceof IdentifiableOSGiService) && beanName.endsWith("Service") && _log.isWarnEnabled()) {
            _log.warn(StringBundler.concat(beanName, " should implement ", IdentifiableOSGiService.class.getName(), " for ", ClusterableAdvice.class.getName()));
        }
        _autoInject(bean, beanName, bean.getClass());
        return bean;
    }

    private void _autoInject(Object targetBean, String targetBeanName, Class<?> beanClass) {
        if ((beanClass == null) || beanClass.isInterface()) {
            return;
        }
        String className = beanClass.getName();
        if (className.equals(_JAVA_LANG_OBJECT) || className.startsWith(_ORG_SPRINGFRAMEWORK)) {
            return;
        }
        Field[] fields = beanClass.getDeclaredFields();
        for (Field field : fields) {
            BeanReference beanReference = field.getAnnotation(BeanReference.class);
            String referencedBeanName = null;
            Class<?> referencedBeanType = null;
            if (beanReference != null) {
                referencedBeanName = beanReference.name();
                referencedBeanType = beanReference.type();
            } else {
                continue;
            }
            if (!Object.class.equals(referencedBeanType)) {
                referencedBeanName = referencedBeanType.getName();
            }
            Object referencedBean = _beans.get(referencedBeanName);
            if (referencedBean == null) {
                try {
                    referencedBean = _beanFactory.getBean(referencedBeanName);
                } catch (NoSuchBeanDefinitionException noSuchBeanDefinitionException) {
                    try {
                        referencedBean = PortalBeanLocatorUtil.locate(referencedBeanName);
                    } catch (BeanLocatorException beanLocatorException) {
                        StringWriter stringWriter = new StringWriter();
                        try (PrintWriter printWriter = new PrintWriter(stringWriter)) {
                            printWriter.print("BeanFactory could not find bean: ");
                            noSuchBeanDefinitionException.printStackTrace(printWriter);
                            printWriter.print(" and PortalBeanLocator failed with: ");
                            printWriter.append(beanLocatorException.getMessage());
                        }
                        throw new BeanLocatorException(stringWriter.toString(), beanLocatorException);
                    }
                }
                _beans.put(referencedBeanName, referencedBean);
            }
            ReflectionUtils.makeAccessible(field);

        }
        _autoInject(targetBean, targetBeanName, beanClass.getSuperclass());
    }

    private static final String _JAVA_LANG_OBJECT = "java.lang.Object";

    private static final String _ORG_SPRINGFRAMEWORK = "org.springframework";

    private static final Log _log = LogFactoryUtil.getLog(BeanReferenceAnnotationBeanPostProcessor.class);

    private final BeanFactory _beanFactory;

    private final Map<String, Object> _beans = new HashMap<>();
}


@Override
    public int getMaxDurability()

package net.BukkitPE.item;

/**
 * BukkitPE Project
 */
public class ItemSwordIron extends ItemTool {

    public ItemSwordIron() {
        this(0, 1);
    }

    public ItemSwordIron(Integer meta) {
        this(meta, 1);
    }

    public ItemSwordIron(Integer meta, int count) {
        super(IRON_SWORD, meta, count, "Iron Sword");
    }

{
        return ItemTool.DURABILITY_IRON;
    }

    @Override
    public boolean isSword() {
        return true;
    }

    @Override
    public int getTier() {
        return ItemTool.TIER_IRON;
    }
}


{
        return ItemTool.DURABILITY_IRON;
    }

package net.BukkitPE.item;

/**
 * BukkitPE Project
 */
public class ItemSwordIron extends ItemTool {

    public ItemSwordIron() {
        this(0, 1);
    }

    public ItemSwordIron(Integer meta) {
        this(meta, 1);
    }

    public ItemSwordIron(Integer meta, int count) {
        super(IRON_SWORD, meta, count, "Iron Sword");
    }

    @Override
    public int getMaxDurability()

    @Override
    public boolean isSword() {
        return true;
    }

    @Override
    public int getTier() {
        return ItemTool.TIER_IRON;
    }
}


package net.BukkitPE.item;

/**
 * BukkitPE Project
 */
public class ItemSwordIron extends ItemTool {

    public ItemSwordIron() {
        this(0, 1);
    }

    public ItemSwordIron(Integer meta) {
        this(meta, 1);
    }

    public ItemSwordIron(Integer meta, int count) {
        super(IRON_SWORD, meta, count, "Iron Sword");
    }

    @Override
    public int getMaxDurability() {
        re

    }

    @Override
    public boolean isSword() {
        return true;
    }

    @Override
    public int getTier() {
        return ItemTool.TIER_IRON;
    }
}


package com.tencentcloudapi.iotvideo.v20201215.models;

import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;

public class DescribeBalanceResponse extends AbstractModel {

    /**
     * 账户余额，单位：分（人民币）。
     */
    @SerializedName("Balance")
    @Expose
    private Long Balance;

    /**
     * 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     */
    @SerializedName("RequestId")
    @Expose
    private String RequestId;

    /**
     * Get 账户余额，单位：分（人民币）。
     * @return Balance 账户余额，单位：分（人民币）。
     */
    public Long getBalance() {
        return this.Balance;
    }

    /**
     * Set 账户余额，单位：分（人民币）。
     * @param Balance 账户余额，单位：分（人民币）。
     */
    public void setBalance(Long Balance) {
        this.Balance = Balance;
    }

    /**
     * Get 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     * @return RequestId 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     */

{
        return this.RequestId;
    }

    /**
     * Set 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     * @param RequestId 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     */
    public void setRequestId(String RequestId) {
        this.RequestId = RequestId;
    }

    public DescribeBalanceResponse() {
    }

    /**
     * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
     *       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
     */
    public DescribeBalanceResponse(DescribeBalanceResponse source) {
        if (source.Balance != null) {
            this.Balance = new Long(source.Balance);
        }
        if (source.RequestId != null) {
            this.RequestId = new String(source.RequestId);
        }
    }

    /**
     * Internal implementation, normal users should not use it.
     */
    public void toMap(HashMap<String, String> map, String prefix) {
        this.setParamSimple(map, prefix + "Balance", this.Balance);
        this.setParamSimple(map, prefix + "RequestId", this.RequestId);
    }
}


{
        this.setParamSimple(map, prefix + "Balance", this.Balance);
        this.setParamSimple(map, prefix + "RequestId", this.RequestId);
    }

package com.tencentcloudapi.iotvideo.v20201215.models;

import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;

public class DescribeBalanceResponse extends AbstractModel {

    /**
     * 账户余额，单位：分（人民币）。
     */
    @SerializedName("Balance")
    @Expose
    private Long Balance;

    /**
     * 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     */
    @SerializedName("RequestId")
    @Expose
    private String RequestId;

    /**
     * Get 账户余额，单位：分（人民币）。
     * @return Balance 账户余额，单位：分（人民币）。
     */
    public Long getBalance() {
        return this.Balance;
    }

    /**
     * Set 账户余额，单位：分（人民币）。
     * @param Balance 账户余额，单位：分（人民币）。
     */
    public void setBalance(Long Balance) {
        this.Balance = Balance;
    }

    /**
     * Get 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     * @return RequestId 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     */
    public String getRequestId() {
        return this.RequestId;
    }

    /**
     * Set 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     * @param RequestId 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     */
    public void setRequestId(String RequestId) {
        this.RequestId = RequestId;
    }

    public DescribeBalanceResponse() {
    }

    /**
     * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
     *       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
     */
    public DescribeBalanceResponse(DescribeBalanceResponse source) {
        if (source.Balance != null) {
            this.Balance = new Long(source.Balance);
        }
        if (source.RequestId != null) {
            this.RequestId = new String(source.RequestId);
        }
    }

    /**
     * Internal implementation, normal users should not use it.
     */
    public void toMap(HashMap<String, String> map, String prefix)


package com.tencentcloudapi.iotvideo.v20201215.models;

import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;

public class DescribeBalanceResponse extends AbstractModel {

    /**
     * 账户余额，单位：分（人民币）。
     */
    @SerializedName("Balance")
    @Expose
    private Long Balance;

    /**
     * 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     */
    @SerializedName("RequestId")
    @Expose
    private String RequestId;

    /**
     * Get 账户余额，单位：分（人民币）。
     * @return Balance 账户余额，单位：分（人民币）。
     */
    public Long getBalance() {
        return this.Balance;
    }

    /**
     * Set 账户余额，单位：分（人民币）。
     * @param Balance 账户余额，单位：分（人民币）。
     */
    public void setBalance(Long Balance) {
        this.Balance = Balance;
    }

    /**
     * Get 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     * @return RequestId 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     */
    public String getRequestId() {
        return this.RequestId;
    }

    /**
     * Set 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     * @param RequestId 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     */
    public void setRequestId(String RequestId) {
        this.RequestId = RequestId;
    }

    public DescribeBalanceResponse() {
    }

    /**
     * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
     *       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
     */
    public DescribeBalanceResponse(DescribeBalanceResponse source) {
        if (source.Balance != null) {
            this.Balance = new Long(source.Balance);
        }
        if (source.RequestId != null) {
            this.RequestId = new String(source.RequestId);
        }
    }

    /**
     * Internal implementation, normal users should not use it.
     */
    public void toMap(HashMap<String, String> map, String prefix) {
        this.setParamSimple(map, prefix + "Balance", t

        this.setParamSimple(map, prefix + "RequestId", this.RequestId);
    }
}


public void setRequestId(String RequestId) {
        this.RequestId = RequestId;
    }

package com.tencentcloudapi.iotvideo.v20201215.models;

import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;

public class DescribeBalanceResponse extends AbstractModel {

    /**
     * 账户余额，单位：分（人民币）。
     */
    @SerializedName("Balance")
    @Expose
    private Long Balance;

    /**
     * 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     */
    @SerializedName("RequestId")
    @Expose
    private String RequestId;

    /**
     * Get 账户余额，单位：分（人民币）。
     * @return Balance 账户余额，单位：分（人民币）。
     */
    public Long getBalance() {
        return this.Balance;
    }

    /**
     * Set 账户余额，单位：分（人民币）。
     * @param Balance 账户余额，单位：分（人民币）。
     */
    public void setBalance(Long Balance) {
        this.Balance = Balance;
    }

    /**
     * Get 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     * @return RequestId 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     */
    public String getRequestId() {
        return this.RequestId;
    }

    /**
     * Set 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     * @param RequestId 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
     */

    public DescribeBalanceResponse() {
    }

    /**
     * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
     *       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
     */
    public DescribeBalanceResponse(DescribeBalanceResponse source) {
        if (source.Balance != null) {
            this.Balance = new Long(source.Balance);
        }
        if (source.RequestId != null) {
            this.RequestId = new String(source.RequestId);
        }
    }

    /**
     * Internal implementation, normal users should not use it.
     */
    public void toMap(HashMap<String, String> map, String prefix) {
        this.setParamSimple(map, prefix + "Balance", this.Balance);
        this.setParamSimple(map, prefix + "RequestId", this.RequestId);
    }
}


public int maximalSquare(char[][] matrix)

// 在一个由 0 和 1 组成的二维矩阵内，找到只包含 1 的最大正方形，并返回其面积。
// Related Topics 动态规划
// leetcode submit region begin(Prohibit modification and deletion)
class Solution {

{
        int rows = matrix.length, cols = rows > 0 ? matrix[0].length : 0;
        int[] dp = new int[cols + 1];
        int maxsqlen = 0, pre = 0;
        for (int i = 1; i <= rows; i++) {
            for (int j = 1; j <= cols; j++) {
                int temp = dp[j];
                if (matrix[i - 1][j - 1] == '1') {
                    dp[j] = Math.min(Math.min(dp[j - 1], pre), dp[j]) + 1;
                    maxsqlen = Math.max(maxsqlen, dp[j]);
                } else
                    dp[j] = 0;
                pre = temp;
            }
        }
        return maxsqlen * maxsqlen;
    }
}
// leetcode submit region end(Prohibit modification and deletion)


// 在一个由 0 和 1 组成的二维矩阵内，找到只包含 1 的最大正方形，并返回其面积。
// Related Topics 动态规划
// leetcode submit region begin(Prohibit modification and deletion)
class Solution {

    public int maximalSquare(char[][] matrix) {
        int rows = matrix.length, cols = rows > 0 ? matrix[0].length : 0;
        in

        int maxsqlen = 0, pre = 0;
        for (int i = 1; i <= rows; i++) {
            for (int j = 1; j <= cols; j++) {
                int temp = dp[j];
                if (matrix[i - 1][j - 1] == '1') {
                    dp[j] = Math.min(Math.min(dp[j - 1], pre), dp[j]) + 1;
                    maxsqlen = Math.max(maxsqlen, dp[j]);
                } else
                    dp[j] = 0;
                pre = temp;
            }
        }
        return maxsqlen * maxsqlen;
    }
}
// leetcode submit region end(Prohibit modification and deletion)


for (int j = 1; j <= cols; j++) {
                int temp = dp[j];
                if (matrix[i - 1][j - 1] == '1') {
                    dp[j] = Math.min(Math.min(dp[j - 1], pre), dp[j]) + 1;
                    maxsqlen = Math.max(maxsqlen, dp[j]);
                } else
                    dp[j] = 0;
                pre = temp;
            }

// 在一个由 0 和 1 组成的二维矩阵内，找到只包含 1 的最大正方形，并返回其面积。
// Related Topics 动态规划
// leetcode submit region begin(Prohibit modification and deletion)
class Solution {

    public int maximalSquare(char[][] matrix) {
        int rows = matrix.length, cols = rows > 0 ? matrix[0].length : 0;
        int[] dp = new int[cols + 1];
        int maxsqlen = 0, pre = 0;
        for (int i = 1; i <= rows; i++) {

        }
        return maxsqlen * maxsqlen;
    }
}
// leetcode submit region end(Prohibit modification and deletion)


private boolean sendPayReq(Context paramContext, Bundle paramBundle)

package com.tencent.mm.sdk.openapi;

import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import com.tencent.mm.sdk.a.a.b;
import com.tencent.mm.sdk.modelbase.BaseReq;
import com.tencent.mm.sdk.modelbase.BaseResp;
import com.tencent.mm.sdk.modelbiz.AddCardToWXCardPackage.Resp;
import com.tencent.mm.sdk.modelmsg.GetMessageFromWX.Req;
import com.tencent.mm.sdk.modelmsg.LaunchFromWX.Req;
import com.tencent.mm.sdk.modelmsg.SendAuth.Resp;
import com.tencent.mm.sdk.modelmsg.SendMessageToWX.Resp;
import com.tencent.mm.sdk.modelmsg.ShowMessageFromWX.Req;
import com.tencent.mm.sdk.modelpay.PayResp;

final class WXApiImplV10 implements IWXAPI {

    private static final String TAG = "MicroMsg.SDK.WXApiImplV10";

    private static String wxappPayEntryClassname = null;

    private String appId;

    private boolean checkSignature = false;

    private Context context;

    private boolean detached = false;

    WXApiImplV10(Context paramContext, String paramString, boolean paramBoolean) {
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "<init>, appId = " + paramString + ", checkSignature = " + paramBoolean);
        this.context = paramContext;
        this.appId = paramString;
        this.checkSignature = paramBoolean;
    }

    private boolean checkSumConsistent(byte[] paramArrayOfByte1, byte[] paramArrayOfByte2) {
        if ((paramArrayOfByte1 == null) || (paramArrayOfByte1.length == 0) || (paramArrayOfByte2 == null) || (paramArrayOfByte2.length == 0)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "checkSumConsistent fail, invalid arguments");
            return false;
        }
        if (paramArrayOfByte1.length != paramArrayOfByte2.length) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "checkSumConsistent fail, length is different");
            return false;
        }
        for (int i = 0; ; i++) {
            if (i >= paramArrayOfByte1.length)
                break label66;
            if (paramArrayOfByte1[i] != paramArrayOfByte2[i])
                break;
        }
        label66: return true;
    }

    private boolean sendAddCardToWX(Context paramContext, Bundle paramBundle) {
        ContentResolver localContentResolver = paramContext.getContentResolver();
        Uri localUri = Uri.parse("content://com.tencent.mm.sdk.comm.provider/addCardToWX");
        String[] arrayOfString = new String[3];
        arrayOfString[0] = this.appId;
        arrayOfString[1] = paramBundle.getString("_wxapi_add_card_to_wx_card_list");
        arrayOfString[2] = paramBundle.getString("_wxapi_basereq_transaction");
        Cursor localCursor = localContentResolver.query(localUri, null, null, arrayOfString, null);
        if (localCursor != null)
            localCursor.close();
        return true;
    }

    private boolean sendJumpToBizProfileReq(Context paramContext, Bundle paramBundle) {
        ContentResolver localContentResolver = paramContext.getContentResolver();
        Uri localUri = Uri.parse("content://com.tencent.mm.sdk.comm.provider/jumpToBizProfile");
        String[] arrayOfString = new String[5];
        arrayOfString[0] = this.appId;
        arrayOfString[1] = paramBundle.getString("_wxapi_jump_to_biz_profile_req_to_user_name");
        arrayOfString[2] = paramBundle.getString("_wxapi_jump_to_biz_profile_req_ext_msg");
        arrayOfString[3] = paramBundle.getInt("_wxapi_jump_to_biz_profile_req_scene");
        arrayOfString[4] = paramBundle.getInt("_wxapi_jump_to_biz_profile_req_profile_type");
        Cursor localCursor = localContentResolver.query(localUri, null, null, arrayOfString, null);
        if (localCursor != null)
            localCursor.close();
        return true;
    }

    private boolean sendJumpToBizWebviewReq(Context paramContext, Bundle paramBundle) {
        ContentResolver localContentResolver = paramContext.getContentResolver();
        Uri localUri = Uri.parse("content://com.tencent.mm.sdk.comm.provider/jumpToBizProfile");
        String[] arrayOfString = new String[4];
        arrayOfString[0] = this.appId;
        arrayOfString[1] = paramBundle.getString("_wxapi_jump_to_biz_webview_req_to_user_name");
        arrayOfString[2] = paramBundle.getString("_wxapi_jump_to_biz_webview_req_ext_msg");
        arrayOfString[3] = paramBundle.getInt("_wxapi_jump_to_biz_webview_req_scene");
        Cursor localCursor = localContentResolver.query(localUri, null, null, arrayOfString, null);
        if (localCursor != null)
            localCursor.close();
        return true;
    }

{
        if (wxappPayEntryClassname == null) {
            wxappPayEntryClassname = new MMSharedPreferences(paramContext).getString("_wxapp_pay_entry_classname_", null);
            com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "pay, set wxappPayEntryClassname = " + wxappPayEntryClassname);
            if (wxappPayEntryClassname == null) {
                com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "pay fail, wxappPayEntryClassname is null");
                return false;
            }
        }
        com.tencent.mm.sdk.a.a.a locala = new com.tencent.mm.sdk.a.a.a();
        locala.e = paramBundle;
        locala.b = "com.tencent.mm";
        locala.c = wxappPayEntryClassname;
        return com.tencent.mm.sdk.a.a.a(paramContext, locala);
    }

    public final void detach() {
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "detach");
        this.detached = true;
        this.context = null;
    }

    public final int getWXAppSupportAPI() {
        if (this.detached)
            throw new IllegalStateException("getWXAppSupportAPI fail, WXMsgImpl has been detached");
        if (!isWXAppInstalled()) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "open wx app failed, not installed or signature check failed");
            return 0;
        }
        return new MMSharedPreferences(this.context).getInt("_build_info_sdk_int_", 0);
    }

    public final boolean handleIntent(Intent paramIntent, IWXAPIEventHandler paramIWXAPIEventHandler) {
        if (!WXApiImplComm.isIntentFromWx(paramIntent, "com.tencent.mm.openapi.token")) {
            com.tencent.mm.sdk.b.a.b("MicroMsg.SDK.WXApiImplV10", "handleIntent fail, intent not from weixin msg");
            return false;
        }
        if (this.detached)
            throw new IllegalStateException("handleIntent fail, WXMsgImpl has been detached");
        String str1 = paramIntent.getStringExtra("_mmessage_content");
        int i = paramIntent.getIntExtra("_mmessage_sdkVersion", 0);
        String str2 = paramIntent.getStringExtra("_mmessage_appPackage");
        if ((str2 == null) || (str2.length() == 0)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "invalid argument");
            return false;
        }
        if (!checkSumConsistent(paramIntent.getByteArrayExtra("_mmessage_checksum"), b.a(str1, i, str2))) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "checksum fail");
            return false;
        }
        int j = paramIntent.getIntExtra("_wxapi_command_type", 0);
        switch(j) {
            case 7:
            case 8:
            default:
                com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "unknown cmd = " + j);
                return false;
            case 1:
                paramIWXAPIEventHandler.onResp(new SendAuth.Resp(paramIntent.getExtras()));
                return true;
            case 2:
                paramIWXAPIEventHandler.onResp(new SendMessageToWX.Resp(paramIntent.getExtras()));
                return true;
            case 3:
                paramIWXAPIEventHandler.onReq(new GetMessageFromWX.Req(paramIntent.getExtras()));
                return true;
            case 4:
                paramIWXAPIEventHandler.onReq(new ShowMessageFromWX.Req(paramIntent.getExtras()));
                return true;
            case 5:
                paramIWXAPIEventHandler.onResp(new PayResp(paramIntent.getExtras()));
                return true;
            case 6:
                paramIWXAPIEventHandler.onReq(new LaunchFromWX.Req(paramIntent.getExtras()));
                return true;
            case 9:
        }
        paramIWXAPIEventHandler.onResp(new AddCardToWXCardPackage.Resp(paramIntent.getExtras()));
        return true;
    }

    public final boolean isWXAppInstalled() {
        if (this.detached)
            throw new IllegalStateException("isWXAppInstalled fail, WXMsgImpl has been detached");
        try {
            PackageInfo localPackageInfo = this.context.getPackageManager().getPackageInfo("com.tencent.mm", 64);
            if (localPackageInfo == null)
                return false;
            boolean bool = WXApiImplComm.validateAppSignature(this.context, localPackageInfo.signatures, this.checkSignature);
            return bool;
        } catch (PackageManager.NameNotFoundException localNameNotFoundException) {
        }
        return false;
    }

    public final boolean isWXAppSupportAPI() {
        if (this.detached)
            throw new IllegalStateException("isWXAppSupportAPI fail, WXMsgImpl has been detached");
        return getWXAppSupportAPI() >= 570490883;
    }

    public final boolean openWXApp() {
        if (this.detached)
            throw new IllegalStateException("openWXApp fail, WXMsgImpl has been detached");
        if (!isWXAppInstalled()) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "open wx app failed, not installed or signature check failed");
            return false;
        }
        try {
            this.context.startActivity(this.context.getPackageManager().getLaunchIntentForPackage("com.tencent.mm"));
            return true;
        } catch (Exception localException) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "startActivity fail, exception = " + localException.getMessage());
        }
        return false;
    }

    public final boolean registerApp(String paramString) {
        if (this.detached)
            throw new IllegalStateException("registerApp fail, WXMsgImpl has been detached");
        if (!WXApiImplComm.validateAppSignatureForPackage(this.context, "com.tencent.mm", this.checkSignature)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "register app failed for wechat app signature check failed");
            return false;
        }
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "registerApp, appId = " + paramString);
        if (paramString != null)
            this.appId = paramString;
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "register app " + this.context.getPackageName());
        com.tencent.mm.sdk.a.a.a.a locala = new com.tencent.mm.sdk.a.a.a.a();
        locala.f = "com.tencent.mm";
        locala.g = "com.tencent.mm.plugin.openapi.Intent.ACTION_HANDLE_APP_REGISTER";
        locala.d = ("weixin://registerapp?appid=" + this.appId);
        return com.tencent.mm.sdk.a.a.a.a(this.context, locala);
    }

    public final boolean sendReq(BaseReq paramBaseReq) {
        if (this.detached)
            throw new IllegalStateException("sendReq fail, WXMsgImpl has been detached");
        if (!WXApiImplComm.validateAppSignatureForPackage(this.context, "com.tencent.mm", this.checkSignature)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "sendReq failed for wechat app signature check failed");
            return false;
        }
        if (!paramBaseReq.checkArgs()) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "sendReq checkArgs fail");
            return false;
        }
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "sendReq, req type = " + paramBaseReq.getType());
        Bundle localBundle = new Bundle();
        paramBaseReq.toBundle(localBundle);
        if (paramBaseReq.getType() == 5)
            return sendPayReq(this.context, localBundle);
        if (paramBaseReq.getType() == 7)
            return sendJumpToBizProfileReq(this.context, localBundle);
        if (paramBaseReq.getType() == 8)
            return sendJumpToBizWebviewReq(this.context, localBundle);
        if (paramBaseReq.getType() == 9)
            return sendAddCardToWX(this.context, localBundle);
        com.tencent.mm.sdk.a.a.a locala = new com.tencent.mm.sdk.a.a.a();
        locala.e = localBundle;
        locala.d = ("weixin://sendreq?appid=" + this.appId);
        locala.b = "com.tencent.mm";
        locala.c = "com.tencent.mm.plugin.base.stub.WXEntryActivity";
        return com.tencent.mm.sdk.a.a.a(this.context, locala);
    }

    public final boolean sendResp(BaseResp paramBaseResp) {
        if (this.detached)
            throw new IllegalStateException("sendResp fail, WXMsgImpl has been detached");
        if (!WXApiImplComm.validateAppSignatureForPackage(this.context, "com.tencent.mm", this.checkSignature)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "sendResp failed for wechat app signature check failed");
            return false;
        }
        if (!paramBaseResp.checkArgs()) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "sendResp checkArgs fail");
            return false;
        }
        Bundle localBundle = new Bundle();
        paramBaseResp.toBundle(localBundle);
        com.tencent.mm.sdk.a.a.a locala = new com.tencent.mm.sdk.a.a.a();
        locala.e = localBundle;
        locala.d = ("weixin://sendresp?appid=" + this.appId);
        locala.b = "com.tencent.mm";
        locala.c = "com.tencent.mm.plugin.base.stub.WXEntryActivity";
        return com.tencent.mm.sdk.a.a.a(this.context, locala);
    }

    public final void unregisterApp() {
        if (this.detached)
            throw new IllegalStateException("unregisterApp fail, WXMsgImpl has been detached");
        if (!WXApiImplComm.validateAppSignatureForPackage(this.context, "com.tencent.mm", this.checkSignature)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "unregister app failed for wechat app signature check failed");
            return;
        }
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "unregisterApp, appId = " + this.appId);
        if ((this.appId == null) || (this.appId.length() == 0)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "unregisterApp fail, appId is empty");
            return;
        }
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "unregister app " + this.context.getPackageName());
        com.tencent.mm.sdk.a.a.a.a locala = new com.tencent.mm.sdk.a.a.a.a();
        locala.f = "com.tencent.mm";
        locala.g = "com.tencent.mm.plugin.openapi.Intent.ACTION_HANDLE_APP_UNREGISTER";
        locala.d = ("weixin://unregisterapp?appid=" + this.appId);
        com.tencent.mm.sdk.a.a.a.a(this.context, locala);
    }
}


{
        if (this.detached)
            throw new IllegalStateException("isWXAppSupportAPI fail, WXMsgImpl has been detached");
        return getWXAppSupportAPI() >= 570490883;
    }

package com.tencent.mm.sdk.openapi;

import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import com.tencent.mm.sdk.a.a.b;
import com.tencent.mm.sdk.modelbase.BaseReq;
import com.tencent.mm.sdk.modelbase.BaseResp;
import com.tencent.mm.sdk.modelbiz.AddCardToWXCardPackage.Resp;
import com.tencent.mm.sdk.modelmsg.GetMessageFromWX.Req;
import com.tencent.mm.sdk.modelmsg.LaunchFromWX.Req;
import com.tencent.mm.sdk.modelmsg.SendAuth.Resp;
import com.tencent.mm.sdk.modelmsg.SendMessageToWX.Resp;
import com.tencent.mm.sdk.modelmsg.ShowMessageFromWX.Req;
import com.tencent.mm.sdk.modelpay.PayResp;

final class WXApiImplV10 implements IWXAPI {

    private static final String TAG = "MicroMsg.SDK.WXApiImplV10";

    private static String wxappPayEntryClassname = null;

    private String appId;

    private boolean checkSignature = false;

    private Context context;

    private boolean detached = false;

    WXApiImplV10(Context paramContext, String paramString, boolean paramBoolean) {
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "<init>, appId = " + paramString + ", checkSignature = " + paramBoolean);
        this.context = paramContext;
        this.appId = paramString;
        this.checkSignature = paramBoolean;
    }

    private boolean checkSumConsistent(byte[] paramArrayOfByte1, byte[] paramArrayOfByte2) {
        if ((paramArrayOfByte1 == null) || (paramArrayOfByte1.length == 0) || (paramArrayOfByte2 == null) || (paramArrayOfByte2.length == 0)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "checkSumConsistent fail, invalid arguments");
            return false;
        }
        if (paramArrayOfByte1.length != paramArrayOfByte2.length) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "checkSumConsistent fail, length is different");
            return false;
        }
        for (int i = 0; ; i++) {
            if (i >= paramArrayOfByte1.length)
                break label66;
            if (paramArrayOfByte1[i] != paramArrayOfByte2[i])
                break;
        }
        label66: return true;
    }

    private boolean sendAddCardToWX(Context paramContext, Bundle paramBundle) {
        ContentResolver localContentResolver = paramContext.getContentResolver();
        Uri localUri = Uri.parse("content://com.tencent.mm.sdk.comm.provider/addCardToWX");
        String[] arrayOfString = new String[3];
        arrayOfString[0] = this.appId;
        arrayOfString[1] = paramBundle.getString("_wxapi_add_card_to_wx_card_list");
        arrayOfString[2] = paramBundle.getString("_wxapi_basereq_transaction");
        Cursor localCursor = localContentResolver.query(localUri, null, null, arrayOfString, null);
        if (localCursor != null)
            localCursor.close();
        return true;
    }

    private boolean sendJumpToBizProfileReq(Context paramContext, Bundle paramBundle) {
        ContentResolver localContentResolver = paramContext.getContentResolver();
        Uri localUri = Uri.parse("content://com.tencent.mm.sdk.comm.provider/jumpToBizProfile");
        String[] arrayOfString = new String[5];
        arrayOfString[0] = this.appId;
        arrayOfString[1] = paramBundle.getString("_wxapi_jump_to_biz_profile_req_to_user_name");
        arrayOfString[2] = paramBundle.getString("_wxapi_jump_to_biz_profile_req_ext_msg");
        arrayOfString[3] = paramBundle.getInt("_wxapi_jump_to_biz_profile_req_scene");
        arrayOfString[4] = paramBundle.getInt("_wxapi_jump_to_biz_profile_req_profile_type");
        Cursor localCursor = localContentResolver.query(localUri, null, null, arrayOfString, null);
        if (localCursor != null)
            localCursor.close();
        return true;
    }

    private boolean sendJumpToBizWebviewReq(Context paramContext, Bundle paramBundle) {
        ContentResolver localContentResolver = paramContext.getContentResolver();
        Uri localUri = Uri.parse("content://com.tencent.mm.sdk.comm.provider/jumpToBizProfile");
        String[] arrayOfString = new String[4];
        arrayOfString[0] = this.appId;
        arrayOfString[1] = paramBundle.getString("_wxapi_jump_to_biz_webview_req_to_user_name");
        arrayOfString[2] = paramBundle.getString("_wxapi_jump_to_biz_webview_req_ext_msg");
        arrayOfString[3] = paramBundle.getInt("_wxapi_jump_to_biz_webview_req_scene");
        Cursor localCursor = localContentResolver.query(localUri, null, null, arrayOfString, null);
        if (localCursor != null)
            localCursor.close();
        return true;
    }

    private boolean sendPayReq(Context paramContext, Bundle paramBundle) {
        if (wxappPayEntryClassname == null) {
            wxappPayEntryClassname = new MMSharedPreferences(paramContext).getString("_wxapp_pay_entry_classname_", null);
            com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "pay, set wxappPayEntryClassname = " + wxappPayEntryClassname);
            if (wxappPayEntryClassname == null) {
                com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "pay fail, wxappPayEntryClassname is null");
                return false;
            }
        }
        com.tencent.mm.sdk.a.a.a locala = new com.tencent.mm.sdk.a.a.a();
        locala.e = paramBundle;
        locala.b = "com.tencent.mm";
        locala.c = wxappPayEntryClassname;
        return com.tencent.mm.sdk.a.a.a(paramContext, locala);
    }

    public final void detach() {
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "detach");
        this.detached = true;
        this.context = null;
    }

    public final int getWXAppSupportAPI() {
        if (this.detached)
            throw new IllegalStateException("getWXAppSupportAPI fail, WXMsgImpl has been detached");
        if (!isWXAppInstalled()) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "open wx app failed, not installed or signature check failed");
            return 0;
        }
        return new MMSharedPreferences(this.context).getInt("_build_info_sdk_int_", 0);
    }

    public final boolean handleIntent(Intent paramIntent, IWXAPIEventHandler paramIWXAPIEventHandler) {
        if (!WXApiImplComm.isIntentFromWx(paramIntent, "com.tencent.mm.openapi.token")) {
            com.tencent.mm.sdk.b.a.b("MicroMsg.SDK.WXApiImplV10", "handleIntent fail, intent not from weixin msg");
            return false;
        }
        if (this.detached)
            throw new IllegalStateException("handleIntent fail, WXMsgImpl has been detached");
        String str1 = paramIntent.getStringExtra("_mmessage_content");
        int i = paramIntent.getIntExtra("_mmessage_sdkVersion", 0);
        String str2 = paramIntent.getStringExtra("_mmessage_appPackage");
        if ((str2 == null) || (str2.length() == 0)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "invalid argument");
            return false;
        }
        if (!checkSumConsistent(paramIntent.getByteArrayExtra("_mmessage_checksum"), b.a(str1, i, str2))) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "checksum fail");
            return false;
        }
        int j = paramIntent.getIntExtra("_wxapi_command_type", 0);
        switch(j) {
            case 7:
            case 8:
            default:
                com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "unknown cmd = " + j);
                return false;
            case 1:
                paramIWXAPIEventHandler.onResp(new SendAuth.Resp(paramIntent.getExtras()));
                return true;
            case 2:
                paramIWXAPIEventHandler.onResp(new SendMessageToWX.Resp(paramIntent.getExtras()));
                return true;
            case 3:
                paramIWXAPIEventHandler.onReq(new GetMessageFromWX.Req(paramIntent.getExtras()));
                return true;
            case 4:
                paramIWXAPIEventHandler.onReq(new ShowMessageFromWX.Req(paramIntent.getExtras()));
                return true;
            case 5:
                paramIWXAPIEventHandler.onResp(new PayResp(paramIntent.getExtras()));
                return true;
            case 6:
                paramIWXAPIEventHandler.onReq(new LaunchFromWX.Req(paramIntent.getExtras()));
                return true;
            case 9:
        }
        paramIWXAPIEventHandler.onResp(new AddCardToWXCardPackage.Resp(paramIntent.getExtras()));
        return true;
    }

    public final boolean isWXAppInstalled() {
        if (this.detached)
            throw new IllegalStateException("isWXAppInstalled fail, WXMsgImpl has been detached");
        try {
            PackageInfo localPackageInfo = this.context.getPackageManager().getPackageInfo("com.tencent.mm", 64);
            if (localPackageInfo == null)
                return false;
            boolean bool = WXApiImplComm.validateAppSignature(this.context, localPackageInfo.signatures, this.checkSignature);
            return bool;
        } catch (PackageManager.NameNotFoundException localNameNotFoundException) {
        }
        return false;
    }

    public final boolean isWXAppSupportAPI()

    public final boolean openWXApp() {
        if (this.detached)
            throw new IllegalStateException("openWXApp fail, WXMsgImpl has been detached");
        if (!isWXAppInstalled()) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "open wx app failed, not installed or signature check failed");
            return false;
        }
        try {
            this.context.startActivity(this.context.getPackageManager().getLaunchIntentForPackage("com.tencent.mm"));
            return true;
        } catch (Exception localException) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "startActivity fail, exception = " + localException.getMessage());
        }
        return false;
    }

    public final boolean registerApp(String paramString) {
        if (this.detached)
            throw new IllegalStateException("registerApp fail, WXMsgImpl has been detached");
        if (!WXApiImplComm.validateAppSignatureForPackage(this.context, "com.tencent.mm", this.checkSignature)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "register app failed for wechat app signature check failed");
            return false;
        }
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "registerApp, appId = " + paramString);
        if (paramString != null)
            this.appId = paramString;
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "register app " + this.context.getPackageName());
        com.tencent.mm.sdk.a.a.a.a locala = new com.tencent.mm.sdk.a.a.a.a();
        locala.f = "com.tencent.mm";
        locala.g = "com.tencent.mm.plugin.openapi.Intent.ACTION_HANDLE_APP_REGISTER";
        locala.d = ("weixin://registerapp?appid=" + this.appId);
        return com.tencent.mm.sdk.a.a.a.a(this.context, locala);
    }

    public final boolean sendReq(BaseReq paramBaseReq) {
        if (this.detached)
            throw new IllegalStateException("sendReq fail, WXMsgImpl has been detached");
        if (!WXApiImplComm.validateAppSignatureForPackage(this.context, "com.tencent.mm", this.checkSignature)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "sendReq failed for wechat app signature check failed");
            return false;
        }
        if (!paramBaseReq.checkArgs()) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "sendReq checkArgs fail");
            return false;
        }
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "sendReq, req type = " + paramBaseReq.getType());
        Bundle localBundle = new Bundle();
        paramBaseReq.toBundle(localBundle);
        if (paramBaseReq.getType() == 5)
            return sendPayReq(this.context, localBundle);
        if (paramBaseReq.getType() == 7)
            return sendJumpToBizProfileReq(this.context, localBundle);
        if (paramBaseReq.getType() == 8)
            return sendJumpToBizWebviewReq(this.context, localBundle);
        if (paramBaseReq.getType() == 9)
            return sendAddCardToWX(this.context, localBundle);
        com.tencent.mm.sdk.a.a.a locala = new com.tencent.mm.sdk.a.a.a();
        locala.e = localBundle;
        locala.d = ("weixin://sendreq?appid=" + this.appId);
        locala.b = "com.tencent.mm";
        locala.c = "com.tencent.mm.plugin.base.stub.WXEntryActivity";
        return com.tencent.mm.sdk.a.a.a(this.context, locala);
    }

    public final boolean sendResp(BaseResp paramBaseResp) {
        if (this.detached)
            throw new IllegalStateException("sendResp fail, WXMsgImpl has been detached");
        if (!WXApiImplComm.validateAppSignatureForPackage(this.context, "com.tencent.mm", this.checkSignature)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "sendResp failed for wechat app signature check failed");
            return false;
        }
        if (!paramBaseResp.checkArgs()) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "sendResp checkArgs fail");
            return false;
        }
        Bundle localBundle = new Bundle();
        paramBaseResp.toBundle(localBundle);
        com.tencent.mm.sdk.a.a.a locala = new com.tencent.mm.sdk.a.a.a();
        locala.e = localBundle;
        locala.d = ("weixin://sendresp?appid=" + this.appId);
        locala.b = "com.tencent.mm";
        locala.c = "com.tencent.mm.plugin.base.stub.WXEntryActivity";
        return com.tencent.mm.sdk.a.a.a(this.context, locala);
    }

    public final void unregisterApp() {
        if (this.detached)
            throw new IllegalStateException("unregisterApp fail, WXMsgImpl has been detached");
        if (!WXApiImplComm.validateAppSignatureForPackage(this.context, "com.tencent.mm", this.checkSignature)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "unregister app failed for wechat app signature check failed");
            return;
        }
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "unregisterApp, appId = " + this.appId);
        if ((this.appId == null) || (this.appId.length() == 0)) {
            com.tencent.mm.sdk.b.a.a("MicroMsg.SDK.WXApiImplV10", "unregisterApp fail, appId is empty");
            return;
        }
        com.tencent.mm.sdk.b.a.c("MicroMsg.SDK.WXApiImplV10", "unregister app " + this.context.getPackageName());
        com.tencent.mm.sdk.a.a.a.a locala = new com.tencent.mm.sdk.a.a.a.a();
        locala.f = "com.tencent.mm";
        locala.g = "com.tencent.mm.plugin.openapi.Intent.ACTION_HANDLE_APP_UNREGISTER";
        locala.d = ("weixin://unregisterapp?appid=" + this.appId);
        com.tencent.mm.sdk.a.a.a.a(this.context, locala);
    }
}