test_class.file: fathom-security/src/test/java/fathom/authz/PermissionTest.java
test_class.identifier: PermissionTest
test_class.superclass: extends Assert
test_case.body: @Test
      public void testNamed() {
          Permission p1, p2;
  
          // Case insensitive, same
          p1 = new Permission("something");
          p2 = new Permission("something");
          assertTrue(p1.implies(p2));
          assertTrue(p2.implies(p1));
  
          // Case insensitive, different case
          p1 = new Permission("something");
          p2 = new Permission("SOMETHING");
          assertTrue(p1.implies(p2));
          assertTrue(p2.implies(p1));
  
          // Case insensitive, different word
          p1 = new Permission("something");
          p2 = new Permission("else");
          assertFalse(p1.implies(p2));
          assertFalse(p2.implies(p1));
  
          // Case sensitive same
          p1 = new Permission("BLAHBLAH", false);
          p2 = new Permission("BLAHBLAH", false);
          assertTrue(p1.implies(p2));
          assertTrue(p2.implies(p1));
  
          // Case sensitive, different case
          p1 = new Permission("BLAHBLAH", false);
          p2 = new Permission("bLAHBLAH", false);
          assertTrue(p1.implies(p2));
          assertTrue(p2.implies(p1));
  
          // Case sensitive, different word
          p1 = new Permission("BLAHBLAH", false);
          p2 = new Permission("whatwhat", false);
          assertFalse(p1.implies(p2));
          assertFalse(p2.implies(p1));
  
      }
test_case.class_method_signature: PermissionTest.testNamed()
test_case.full_signature: @Test public void testNamed()
test_case.identifier: testNamed
test_case.invocations: assertTrue implies assertTrue implies assertTrue implies assertTrue implies assertFalse implies assertFalse implies assertTrue implies assertTrue implies assertTrue implies assertTrue implies assertFalse implies assertFalse implies
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNamed()
focal_class.declarator: WILDCARD_TOKEN = "*"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String WILDCARD_TOKEN = "*";
focal_class.type: String
focal_class.var_name: WILDCARD_TOKEN
focal_class.declarator: PART_DIVIDER_TOKEN = ":"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String PART_DIVIDER_TOKEN = ":";
focal_class.type: String
focal_class.var_name: PART_DIVIDER_TOKEN
focal_class.declarator: SUBPART_DIVIDER_TOKEN = ","
focal_class.modifier: protected static final
focal_class.original_string: protected static final String SUBPART_DIVIDER_TOKEN = ",";
focal_class.type: String
focal_class.var_name: SUBPART_DIVIDER_TOKEN
focal_class.declarator: DEFAULT_CASE_SENSITIVE = false
focal_class.modifier: protected static final
focal_class.original_string: protected static final boolean DEFAULT_CASE_SENSITIVE = false;
focal_class.type: boolean
focal_class.var_name: DEFAULT_CASE_SENSITIVE
focal_class.declarator: parts
focal_class.modifier: private
focal_class.original_string: private List<Set<String>> parts;
focal_class.type: List<Set<String>>
focal_class.var_name: parts
focal_class.file: fathom-security/src/main/java/fathom/authz/Permission.java
focal_class.identifier: Permission
focal_class.interfaces: implements Serializable
focal_class.class_method_signature: Permission.Permission()
focal_class.full_signature: protected  Permission()
focal_class.identifier: Permission
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.signature:  Permission()
focal_class.class_method_signature: Permission.Permission(String wildcardString)
focal_class.full_signature: public  Permission(String wildcardString)
focal_class.identifier: Permission
focal_class.modifiers: public
focal_class.parameters: (String wildcardString)
focal_class.signature:  Permission(String wildcardString)
focal_class.class_method_signature: Permission.Permission(String wildcardString, boolean caseSensitive)
focal_class.full_signature: public  Permission(String wildcardString, boolean caseSensitive)
focal_class.identifier: Permission
focal_class.modifiers: public
focal_class.parameters: (String wildcardString, boolean caseSensitive)
focal_class.signature:  Permission(String wildcardString, boolean caseSensitive)
focal_class.class_method_signature: Permission.setParts(String wildcardString, boolean caseSensitive)
focal_class.full_signature: protected void setParts(String wildcardString, boolean caseSensitive)
focal_class.identifier: setParts
focal_class.modifiers: protected
focal_class.parameters: (String wildcardString, boolean caseSensitive)
focal_class.return: void
focal_class.signature: void setParts(String wildcardString, boolean caseSensitive)
focal_class.class_method_signature: Permission.lowercase(Set<String> subparts)
focal_class.full_signature: private Set<String> lowercase(Set<String> subparts)
focal_class.identifier: lowercase
focal_class.modifiers: private
focal_class.parameters: (Set<String> subparts)
focal_class.return: Set<String>
focal_class.signature: Set<String> lowercase(Set<String> subparts)
focal_class.class_method_signature: Permission.getParts()
focal_class.full_signature: protected List<Set<String>> getParts()
focal_class.identifier: getParts
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: List<Set<String>>
focal_class.signature: List<Set<String>> getParts()
focal_class.class_method_signature: Permission.setParts(String wildcardString)
focal_class.full_signature: protected void setParts(String wildcardString)
focal_class.identifier: setParts
focal_class.modifiers: protected
focal_class.parameters: (String wildcardString)
focal_class.return: void
focal_class.signature: void setParts(String wildcardString)
focal_class.class_method_signature: Permission.implies(Permission p)
focal_class.full_signature: public boolean implies(Permission p)
focal_class.identifier: implies
focal_class.modifiers: public
focal_class.parameters: (Permission p)
focal_class.return: boolean
focal_class.signature: boolean implies(Permission p)
focal_class.class_method_signature: Permission.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: Permission.equals(Object o)
focal_class.full_signature: public boolean equals(Object o)
focal_class.identifier: equals
focal_class.modifiers: public
focal_class.parameters: (Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(Object o)
focal_class.class_method_signature: Permission.hashCode()
focal_class.full_signature: public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_method.body: public boolean implies(Permission p) {
          // By default only supports comparisons with other WildcardPermissions
          List<Set<String>> otherParts = p.getParts();
  
          int i = 0;
          for (Set<String> otherPart : otherParts) {
              // If this permission has less parts than the other permission, everything after the number of parts contained
              // in this permission is automatically implied, so return true
              if (getParts().size() - 1 < i) {
                  return true;
              } else {
                  Set<String> part = getParts().get(i);
                  if (!part.contains(WILDCARD_TOKEN) && !part.containsAll(otherPart)) {
                      return false;
                  }
                  i++;
              }
          }
  
          // If this permission has more parts than the other parts, only imply it if all of the other parts are wildcards
          for (; i < getParts().size(); i++) {
              Set<String> part = getParts().get(i);
              if (!part.contains(WILDCARD_TOKEN)) {
                  return false;
              }
          }
  
          return true;
      }
focal_method.class_method_signature: Permission.implies(Permission p)
focal_method.full_signature: public boolean implies(Permission p)
focal_method.identifier: implies
focal_method.invocations: getParts size getParts get getParts contains containsAll size getParts get getParts contains
focal_method.modifiers: public
focal_method.parameters: (Permission p)
focal_method.return: boolean
focal_method.signature: boolean implies(Permission p)