Status: New
Owner: ----

New issue 771 by [email protected]: Annotations.isAllDefaultMethods returns false for method less interfaces.
http://code.google.com/p/google-guice/issues/detail?id=771

Description of the issue:

Steps to reproduce:
1. Annotations.isAllDefaultMethods() probably should return true for
   simple marker annotations.
2. The code:

public static boolean isAllDefaultMethods(Class<? extends Annotation> annotationType) {
  boolean hasMethods = false;
  for (Method m : annotationType.getDeclaredMethods()) {
    hasMethods = true;
    if (m.getDefaultValue() == null) {
      return false;
    }
  }
  return hasMethods;
}

This class returns true if the annotation class has at least one method that has a default value set.
It returns false if the annotation class has no methods at all
It also returns false if there are methods that have no default values.

This code should probably read

public static boolean isAllDefaultMethods(Class<? extends Annotation> annotationType) {
  for (Method m : annotationType.getDeclaredMethods()) {
    if (m.getDefaultValue() == null) {
      return false;
    }
  }
  return true;
}


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice-dev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to