test_class.file: objects/src/test/java/org/cthul/objects/reflection/JavaSignatureComparatorTest.java
test_class.identifier: JavaSignatureComparatorTest
test_case.body: @Test
      public void test_applicability_empty() {
          Class[] args = {};
          Class[] params = args;
          JavaSignatureComparator jsCmp = new JavaSignatureComparator(args);
          int appl = jsCmp.applicability(params, false);
          assertThat(appl, is(JavaSignatureComparator.MATCH));
      }
test_case.class_method_signature: JavaSignatureComparatorTest.test_applicability_empty()
test_case.full_signature: @Test public void test_applicability_empty()
test_case.identifier: test_applicability_empty
test_case.invocations: applicability assertThat is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_applicability_empty()
focal_class.declarator: MATCH =          400
focal_class.modifier: public static final
focal_class.original_string: public static final int MATCH =          400;
focal_class.type: int
focal_class.var_name: MATCH
focal_class.declarator: MATCH_WILDCARD = 300
focal_class.modifier: public static final
focal_class.original_string: public static final int MATCH_WILDCARD = 300;
focal_class.type: int
focal_class.var_name: MATCH_WILDCARD
focal_class.declarator: MATCH_BOXING =   200
focal_class.modifier: public static final
focal_class.original_string: public static final int MATCH_BOXING =   200;
focal_class.type: int
focal_class.var_name: MATCH_BOXING
focal_class.declarator: MATCH_VARARGS =  100
focal_class.modifier: public static final
focal_class.original_string: public static final int MATCH_VARARGS =  100;
focal_class.type: int
focal_class.var_name: MATCH_VARARGS
focal_class.declarator: NO_MATCH =       -99
focal_class.modifier: public static final
focal_class.original_string: public static final int NO_MATCH =       -99;
focal_class.type: int
focal_class.var_name: NO_MATCH
focal_class.declarator: argTypes
focal_class.modifier: private final
focal_class.original_string: private final Class<?>[] argTypes;
focal_class.type: Class<?>[]
focal_class.var_name: argTypes
focal_class.file: objects/src/main/java/org/cthul/objects/reflection/JavaSignatureComparator.java
focal_class.identifier: JavaSignatureComparator
focal_class.class_method_signature: JavaSignatureComparator.JavaSignatureComparator(Class<?>... argTypes)
focal_class.full_signature: public  JavaSignatureComparator(Class<?>... argTypes)
focal_class.identifier: JavaSignatureComparator
focal_class.modifiers: public
focal_class.parameters: (Class<?>... argTypes)
focal_class.signature:  JavaSignatureComparator(Class<?>... argTypes)
focal_class.class_method_signature: JavaSignatureComparator.getReferenceSignature()
focal_class.full_signature: public Class<?>[] getReferenceSignature()
focal_class.identifier: getReferenceSignature
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Class<?>[]
focal_class.signature: Class<?>[] getReferenceSignature()
focal_class.class_method_signature: JavaSignatureComparator.compareSpecificness(final Class<?>[] a, boolean a_varArgs, final Class<?>[] b, boolean b_varArgs)
focal_class.full_signature: public int compareSpecificness(final Class<?>[] a, boolean a_varArgs, final Class<?>[] b, boolean b_varArgs)
focal_class.identifier: compareSpecificness
focal_class.modifiers: public
focal_class.parameters: (final Class<?>[] a, boolean a_varArgs, final Class<?>[] b, boolean b_varArgs)
focal_class.return: int
focal_class.signature: int compareSpecificness(final Class<?>[] a, boolean a_varArgs, final Class<?>[] b, boolean b_varArgs)
focal_class.class_method_signature: JavaSignatureComparator.compareParameter(Class<?> a, Class<?> b)
focal_class.full_signature: private int compareParameter(Class<?> a, Class<?> b)
focal_class.identifier: compareParameter
focal_class.modifiers: private
focal_class.parameters: (Class<?> a, Class<?> b)
focal_class.return: int
focal_class.signature: int compareParameter(Class<?> a, Class<?> b)
focal_class.class_method_signature: JavaSignatureComparator.applicability(final Class<?>[] paramTypes, boolean varArgs)
focal_class.full_signature: public int applicability(final Class<?>[] paramTypes, boolean varArgs)
focal_class.identifier: applicability
focal_class.modifiers: public
focal_class.parameters: (final Class<?>[] paramTypes, boolean varArgs)
focal_class.return: int
focal_class.signature: int applicability(final Class<?>[] paramTypes, boolean varArgs)
focal_class.class_method_signature: JavaSignatureComparator.applicable(Class<?> arg, Class<?> param)
focal_class.full_signature: private int applicable(Class<?> arg, Class<?> param)
focal_class.identifier: applicable
focal_class.modifiers: private
focal_class.parameters: (Class<?> arg, Class<?> param)
focal_class.return: int
focal_class.signature: int applicable(Class<?> arg, Class<?> param)
focal_method.body: public int applicability(final Class<?>[] paramTypes, boolean varArgs) {
          if (argTypes == null) {
              return MATCH_WILDCARD;
          }
          int level = MATCH;
          final int fixArgs = paramTypes.length - (varArgs ? 1 : 0);
          if (fixArgs > argTypes.length 
                  || (!varArgs && fixArgs != argTypes.length)) {
              return NO_MATCH;
          }
          // match fix args
          for (int i = 0; i < fixArgs; i++) {
              int m = applicable(argTypes[i], paramTypes[i]);
              if (m == NO_MATCH) return NO_MATCH;
              if (m < level) level = m;
          }
          if (varArgs) {
              // try if last arg matches varargs parameter directly
              Class<?> varArgType = paramTypes[fixArgs];
              if (paramTypes.length == argTypes.length) {
                  int m = applicable(argTypes[fixArgs], varArgType);
                  if (m != NO_MATCH) {
                      return Math.min(m, level);
                  }
              }
              // match remaining args against vararg component type
              level = MATCH_VARARGS;
              Class<?> comp = varArgType.getComponentType();
              for (int i = fixArgs; i < argTypes.length; i++) {
                  int m = applicable(argTypes[i], comp);
                  if (m == NO_MATCH) return NO_MATCH;
              }
          }
          return level;
      }
focal_method.class_method_signature: JavaSignatureComparator.applicability(final Class<?>[] paramTypes, boolean varArgs)
focal_method.full_signature: public int applicability(final Class<?>[] paramTypes, boolean varArgs)
focal_method.identifier: applicability
focal_method.invocations: applicable applicable min getComponentType applicable
focal_method.modifiers: public
focal_method.parameters: (final Class<?>[] paramTypes, boolean varArgs)
focal_method.return: int
focal_method.signature: int applicability(final Class<?>[] paramTypes, boolean varArgs)