diff options
author | Tom Tromey <tromey@redhat.com> | 2006-05-24 17:21:52 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2006-05-24 17:21:52 +0000 |
commit | 5aca4c41f72573edb4c22736ac46ff3abf7d625a (patch) | |
tree | 146a4086fddb5d1c805267e25f1a64634a5ae1a9 /libjava/java/lang/reflect/Modifier.java | |
parent | f32f60c997d57ba70a977804cdfb07068557033f (diff) | |
download | gcc-5aca4c41f72573edb4c22736ac46ff3abf7d625a.tar.gz |
re PR libgcj/27729 (Field, Method and Constructor need isSynthetic() implemetation)
gcc/java:
PR libgcj/27729:
* jcf.h (ACC_INVISIBLE): Changed value.
libjava:
PR libgcj/27729:
* java/lang/reflect/natField.cc (getAddr): Added parens.
* java/lang/reflect/natConstructor.cc (getModifiersInternal):
Renamed. Don't mask flags.
* java/lang/reflect/Constructor.java (CONSTRUCTOR_MODIFIERS): New
constant.
(getModifiersInternal): Renamed.
(getModifiers): Rewrote.
(isSynthetic, isVarArgs): New methods.
(hashCode): Rewrote.
(addTypeParameters, toGenericString): New methods.
(getTypeParameters): Rewrote.
(getSignature): New method.
(getGenericParameterTypes, getGenericExceptionTypes): Likewise.
* java/lang/reflect/natMethod.cc (getModifiersInternal):
Renamed. Don't mask flags.
* java/lang/reflect/natField.cc (getModifiersInternal): Renamed.
Don't mask flags.
* java/lang/reflect/Modifier.java (BRIDGE, VARARGS, SYNTHETIC,
ENUM): New constants.
(INVISIBLE): Changed value.
* java/lang/reflect/Method.java: Mostly merged with Classpath.
(getModifiersInternal): Renamed.
(getModifiers): Rewrote.
(isBridge, isSynthetic, isVarArgs): New methods.
(toGenericString): Likewise.
(getTypeParameters): Likewise.
(getSignature): Likewise.
(getGenericExceptionTypes, getGenericParameterTypes,
getGenericReturnType): Likewise.
(METHOD_MODIFIERS): New constant.
* java/lang/reflect/Field.java: Mostly merged with Classpath.
Added javadoc everywhere.
(getModifiersInternal): Renamed.
(getModifiers, isSynthetic, isEnumConstant): Rewrote.
(toGenericString): New method.
(getGenericType, getSignature): Likewise.
(FIELD_MODIFIERS): New constant.
From-SVN: r114046
Diffstat (limited to 'libjava/java/lang/reflect/Modifier.java')
-rw-r--r-- | libjava/java/lang/reflect/Modifier.java | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/libjava/java/lang/reflect/Modifier.java b/libjava/java/lang/reflect/Modifier.java index 662dfe381bb..f9a9ca2c909 100644 --- a/libjava/java/lang/reflect/Modifier.java +++ b/libjava/java/lang/reflect/Modifier.java @@ -1,5 +1,5 @@ /* java.lang.reflect.Modifier - Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2001, 2002, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -158,10 +158,30 @@ public class Modifier static final int ALL_FLAGS = 0xfff; /** + * Flag indicating a bridge method. + */ + static final int BRIDGE = 0x40; + + /** + * Flag indicating a varargs method. + */ + static final int VARARGS = 0x80; + + /** + * Flag indicating a synthetic member. + */ + static final int SYNTHETIC = 0x1000; + + /** + * Flag indicating an enum constant or an enum class. + */ + static final int ENUM = 0x4000; + + /** * GCJ-LOCAL: This access flag is set on methods we declare * internally but which must not be visible to reflection. */ - static final int INVISIBLE = 0x1000; + static final int INVISIBLE = 0x8000; /** * GCJ-LOCAL: This access flag is set on interpreted classes. @@ -303,6 +323,18 @@ public class Modifier } /** + * Package helper method that can take a StringBuilder. + * @param mod the modifier + * @param r the StringBuilder to which the String representation is appended + * @return r, with information appended + */ + static StringBuilder toString(int mod, StringBuilder r) + { + r.append(toString(mod, new StringBuffer())); + return r; + } + + /** * Package helper method that can take a StringBuffer. * @param mod the modifier * @param r the StringBuffer to which the String representation is appended |