test_class.file: pross-server/src/test/java/com/ibm/pross/server/configuration/permissions/ClientPermissionsTest.java
test_class.identifier: ClientPermissionsTest
test_case.body: @Test
  	public void testAddPermission() {
  		final ClientPermissions clientPermission = new ClientPermissions();
  
  		final String secret1 = "test1";
  		final String secret2 = "test2";
  		clientPermission.addPermission(secret1, Permissions.GENERATE);
  
  		// Ensure only one permission impacted
  		Assert.assertTrue(clientPermission.hasPermission(secret1, Permissions.GENERATE));
  		Assert.assertFalse(clientPermission.hasPermission(secret2, Permissions.GENERATE));
  
  		// Ensure no other permissions impacted
  		Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.DELETE));
  		Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.DISABLE));
  		Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.ENABLE));
  		Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.EXPONENTIATE));
  		Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.INFO));
  		Assert.assertFalse(clientPermission.hasPermission(secret1, Permissions.READ));
  	}
test_case.class_method_signature: ClientPermissionsTest.testAddPermission()
test_case.full_signature: @Test public void testAddPermission()
test_case.identifier: testAddPermission
test_case.invocations: addPermission assertTrue hasPermission assertFalse hasPermission assertFalse hasPermission assertFalse hasPermission assertFalse hasPermission assertFalse hasPermission assertFalse hasPermission assertFalse hasPermission
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAddPermission()
focal_class.declarator: secretPermissions
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<String, Integer> secretPermissions;
focal_class.type: ConcurrentMap<String, Integer>
focal_class.var_name: secretPermissions
focal_class.file: pross-server/src/main/java/com/ibm/pross/server/configuration/permissions/ClientPermissions.java
focal_class.identifier: ClientPermissions
focal_class.class_method_signature: ClientPermissions.ClientPermissions()
focal_class.full_signature: public  ClientPermissions()
focal_class.identifier: ClientPermissions
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  ClientPermissions()
focal_class.class_method_signature: ClientPermissions.ClientPermissions(final Map<String, Integer> secretPermissions)
focal_class.full_signature: public  ClientPermissions(final Map<String, Integer> secretPermissions)
focal_class.identifier: ClientPermissions
focal_class.modifiers: public
focal_class.parameters: (final Map<String, Integer> secretPermissions)
focal_class.signature:  ClientPermissions(final Map<String, Integer> secretPermissions)
focal_class.class_method_signature: ClientPermissions.addPermission(final String secretName, final Permissions permission)
focal_class.full_signature: public void addPermission(final String secretName, final Permissions permission)
focal_class.identifier: addPermission
focal_class.modifiers: public
focal_class.parameters: (final String secretName, final Permissions permission)
focal_class.return: void
focal_class.signature: void addPermission(final String secretName, final Permissions permission)
focal_class.class_method_signature: ClientPermissions.removePermission(final String secretName, final Permissions permission)
focal_class.full_signature: public void removePermission(final String secretName, final Permissions permission)
focal_class.identifier: removePermission
focal_class.modifiers: public
focal_class.parameters: (final String secretName, final Permissions permission)
focal_class.return: void
focal_class.signature: void removePermission(final String secretName, final Permissions permission)
focal_class.class_method_signature: ClientPermissions.hasPermission(final String secretName, final Permissions permission)
focal_class.full_signature: public boolean hasPermission(final String secretName, final Permissions permission)
focal_class.identifier: hasPermission
focal_class.modifiers: public
focal_class.parameters: (final String secretName, final Permissions permission)
focal_class.return: boolean
focal_class.signature: boolean hasPermission(final String secretName, final Permissions permission)
focal_class.class_method_signature: ClientPermissions.clearPermission(final String secretName)
focal_class.full_signature: public void clearPermission(final String secretName)
focal_class.identifier: clearPermission
focal_class.modifiers: public
focal_class.parameters: (final String secretName)
focal_class.return: void
focal_class.signature: void clearPermission(final String secretName)
focal_class.class_method_signature: ClientPermissions.clearAllPermissions()
focal_class.full_signature: public void clearAllPermissions()
focal_class.identifier: clearAllPermissions
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clearAllPermissions()
focal_class.class_method_signature: ClientPermissions.getSecrets()
focal_class.full_signature: protected Set<String> getSecrets()
focal_class.identifier: getSecrets
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: Set<String>
focal_class.signature: Set<String> getSecrets()
focal_method.body: public void addPermission(final String secretName, final Permissions permission) {
  		synchronized (this.secretPermissions) {
  			// Create mask with single value for this permission (if not already set)
  			final Integer previous = this.secretPermissions.putIfAbsent(secretName, permission.getCode());
  
  			// We need to update the existing value
  			if (previous != null) {
  				final Integer updated = (previous | permission.getCode()); // mask the bits with or
  				this.secretPermissions.put(secretName, updated);
  			}
  		}
  	}
focal_method.class_method_signature: ClientPermissions.addPermission(final String secretName, final Permissions permission)
focal_method.full_signature: public void addPermission(final String secretName, final Permissions permission)
focal_method.identifier: addPermission
focal_method.invocations: putIfAbsent getCode getCode put
focal_method.modifiers: public
focal_method.parameters: (final String secretName, final Permissions permission)
focal_method.return: void
focal_method.signature: void addPermission(final String secretName, final Permissions permission)