-
Type:
Enhancement
-
Resolution: Won't Fix
-
Priority:
P4
-
None
-
Affects Version/s: 1.1.6
-
Component/s: core-libs
-
x86
-
windows_95
Name: dbT83986 Date: 02/03/99
in a final class, all methods are implicitly
final, yet reflection does not label them as such.
i was of the understanding (and i think it's in
JLS somewhere) that specifying a method as final
in a final class has no effect. however, this prints
out false
public final class p {
public void thing() { }
public static void main(String[] args) throws Throwable {
System.out.println(java.lang.reflect.Modifier.isFinal(
p.class.getMethod("thing", new Class[0]).getModifiers()
));
}
}
whereas declaring thing() to be final causes the
output to be "true". Is this as intended?
(Review ID: 39440)
======================================================================
- relates to
-
JDK-4071299 Compilation spec needed: should state if private should imply final for a method
-
- Closed
-
-
JDK-4396587 "A private method and all methods declared in a final class are final"
-
- Resolved
-