Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4208592

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

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 1.1.6
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description



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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Imported:
                Indexed: