src/share/classes/java/lang/reflect/Method.java
Print this page
@@ -86,16 +86,10 @@
// More complicated security check cache needed here than for
// Class.newInstance() and Constructor.newInstance()
private Class securityCheckCache;
private Class securityCheckTargetClassCache;
- // Modifiers that can be applied to a method in source code
- private static final int LANGUAGE_MODIFIERS =
- Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE |
- Modifier.ABSTRACT | Modifier.STATIC | Modifier.FINAL |
- Modifier.SYNCHRONIZED | Modifier.NATIVE;
-
// Generics infrastructure
private String getGenericSignature() {return signature;}
// Accessor for factory
@@ -406,16 +400,16 @@
* <p>The access modifiers are placed in canonical order as
* specified by "The Java Language Specification". This is
* {@code public}, {@code protected} or {@code private} first,
* and then other modifiers in the following order:
* {@code abstract}, {@code static}, {@code final},
- * {@code synchronized}, {@code native}.
+ * {@code synchronized}, {@code native}, {@code strictfp}.
*/
public String toString() {
try {
StringBuffer sb = new StringBuffer();
- int mod = getModifiers() & LANGUAGE_MODIFIERS;
+ int mod = getModifiers() & Modifier.methodModifiers();
if (mod != 0) {
sb.append(Modifier.toString(mod) + " ");
}
sb.append(Field.getTypeName(getReturnType()) + " ");
sb.append(Field.getTypeName(getDeclaringClass()) + ".");
@@ -471,21 +465,21 @@
* <p>The access modifiers are placed in canonical order as
* specified by "The Java Language Specification". This is
* {@code public}, {@code protected} or {@code private} first,
* and then other modifiers in the following order:
* {@code abstract}, {@code static}, {@code final},
- * {@code synchronized} {@code native}.
+ * {@code synchronized}, {@code native}, {@code strictfp}.
*
* @return a string describing this {@code Method},
* include type parameters
*
* @since 1.5
*/
public String toGenericString() {
try {
StringBuilder sb = new StringBuilder();
- int mod = getModifiers() & LANGUAGE_MODIFIERS;
+ int mod = getModifiers() & Modifier.methodModifiers();
if (mod != 0) {
sb.append(Modifier.toString(mod) + " ");
}
TypeVariable<?>[] typeparms = getTypeParameters();
if (typeparms.length > 0) {