(reflect) Methods to distinguish implicitly vs. explicitly final methods

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P4
    • None
    • Affects Version/s: 1.1.6
    • Component/s: core-libs



      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)
      ======================================================================

            Assignee:
            Unassigned
            Reporter:
            Dave Blair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: