diff --git a/pom.xml b/pom.xml index 885dc43f..90556032 100644 --- a/pom.xml +++ b/pom.xml @@ -28,14 +28,15 @@ fabric-sdk-java-1.0 - 1.17.1 + 1.18.0 3.6.1 1.60 4.5.6 + 3.0.1 true 8.1.7.v20160121 UTF-8 - 0.7.9 + 0.8.2 1.2.17 IntegrationSuite.java gpg2 @@ -234,14 +235,14 @@ kr.motd.maven os-maven-plugin - 1.4.1.Final + 1.6.1 org.apache.maven.plugins maven-surefire-plugin - 2.19.1 + 3.0.0-M3 ${surefireArgLine} @@ -253,7 +254,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 2.19.1 + 3.0.0-M3 ${failsafeArgLine} @@ -303,7 +304,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.3 + 3.8.0 1.8 1.8 @@ -312,7 +313,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.10.4 + ${javadoc.version} org.hyperledger.fabric_ca.sdk.helper:org.hyperledger.fabric.protos.*:org.hyperledger.fabric.sdk.helper:org.hyperledger.fabric.sdk.transaction:org.hyperledger.fabric.sdk.security:org.hyperledger.fabric.sdk.idemix @@ -326,7 +327,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 2.17 + 3.0.0 @@ -339,7 +340,11 @@ true true true - ${project.build.sourceDirectory} + + + ${project.build.sourceDirectory} + + checkstyle-config.xml true @@ -479,7 +484,7 @@ org.apache.maven.plugins maven-antrun-plugin - 1.4 + 1.8 generate-test-resources @@ -498,7 +503,7 @@ pl.project13.maven git-commit-id-plugin - 2.2.2 + 2.2.6 get-the-git-infos @@ -539,12 +544,13 @@ owasp + org.owasp dependency-check-maven - 3.2.0 + 4.0.2 @@ -565,7 +571,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.7 + 1.6.8 true ossrh @@ -575,7 +581,7 @@ maven-assembly-plugin - 2.3 + 3.1.1 jar-with-dependencies @@ -596,7 +602,7 @@ true - 1.5 + 1.6 sign-artifacts @@ -610,7 +616,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.0.1 attach-sources @@ -623,7 +629,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.10.4 + ${javadoc.version} org.hyperledger.fabric_ca.sdk.helper:org.hyperledger.fabric.protos.*:org.hyperledger.fabric.sdk.helper:org.hyperledger.fabric.sdk.transaction:org.hyperledger.fabric.sdk.security diff --git a/src/main/java/org/hyperledger/fabric/sdk/identity/IdemixRoles.java b/src/main/java/org/hyperledger/fabric/sdk/identity/IdemixRoles.java index f0ac3ccf..5ddaae3a 100644 --- a/src/main/java/org/hyperledger/fabric/sdk/identity/IdemixRoles.java +++ b/src/main/java/org/hyperledger/fabric/sdk/identity/IdemixRoles.java @@ -25,12 +25,13 @@ int getValue() { /** * Receives an array of IdemixRoles and returns the bitmask combination of all + * * @param roles that we want to combine * @return bitmask */ - static int getRoleMask(IdemixRoles[] roles) { + static int getRoleMask(IdemixRoles[] roles) { int mask = 0; - for (IdemixRoles role: roles) { + for (IdemixRoles role : roles) { mask = mask | role.value; } return mask; @@ -38,60 +39,66 @@ static int getRoleMask(IdemixRoles[] roles) { /** * Receives an array of MspPrincipal.MSPRole and returns the bitmask combination of all + * * @param roles that we want to combine * @return bitmask */ - static int getRoleMask(MspPrincipal.MSPRole [] roles) { + static int getRoleMask(MspPrincipal.MSPRole[] roles) { int mask = 0; - for (MspPrincipal.MSPRole role: roles) { - mask = mask | getIdemixRoleFromMSPRole(role); + for (MspPrincipal.MSPRole role : roles) { + mask = mask | getIdemixRoleFromMSPRole(role); } return mask; } /** * Receives a MspPrincipal.MSPRole and returns the bitmask + * * @param role that we want to combine * @return bitmask */ - static int getRoleMask(MspPrincipal.MSPRole role) { - return getRoleMask(new MspPrincipal.MSPRole[]{role}); + static int getRoleMask(MspPrincipal.MSPRole role) { + return getRoleMask(new MspPrincipal.MSPRole[] {role}); } /** * Receives a bitmask and a roleMask to test. If the roleMask is contained in the bit mask returns true. - * @param bitmask where to test the roleMask + * + * @param bitmask where to test the roleMask * @param searchRole roleMask to test * @return true if roleMask contained */ - static boolean checkRole(int bitmask, IdemixRoles searchRole) { + static boolean checkRole(int bitmask, IdemixRoles searchRole) { return (bitmask & searchRole.value) == searchRole.value; } /** * Receives a MSPRole and returns the correspondent IdemixRole value + * * @param role to transform to int * @return IdemixRole value */ - static int getIdemixRoleFromMSPRole(MspPrincipal.MSPRole role) { + static int getIdemixRoleFromMSPRole(MspPrincipal.MSPRole role) { return getIdemixRoleFromMSPRole(role.getRole()); } /** * Receives a MSPRole Type and returns the correspondent IdemixRole value + * * @param type to transform to int * @return IdemixRole value */ - static int getIdemixRoleFromMSPRole(MspPrincipal.MSPRole.MSPRoleType type) { + static int getIdemixRoleFromMSPRole(MspPrincipal.MSPRole.MSPRoleType type) { return getIdemixRoleFromMSPRole(type.getNumber()); } /** * Receives a MSPRole int value and returns the correspondent IdemixRole value + * * @param type to transform to int * @return IdemixRole value */ - static int getIdemixRoleFromMSPRole(int type) { + static int getIdemixRoleFromMSPRole(int type) { switch (type) { case MspPrincipal.MSPRole.MSPRoleType.ADMIN_VALUE: return ADMIN.getValue(); @@ -108,10 +115,11 @@ static int getIdemixRoleFromMSPRole(int type) { /** * Receives an integer that represents a roleMask and return the correspondent MSPRole value + * * @param role to transform to MSProle * @return MSPRole */ - static MspPrincipal.MSPRole.MSPRoleType getMSPRoleFromIdemixRole(int role) { + static MspPrincipal.MSPRole.MSPRoleType getMSPRoleFromIdemixRole(int role) { if (role == ADMIN.getValue()) { return MspPrincipal.MSPRole.MSPRoleType.ADMIN; }