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

Class.getMethod presents wrong signature

    XMLWordPrintable

    Details

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=gasp
      java version "1.8.0_151"
      Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
      Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      Class.getMethod presents different results for Object.hashCode method as required by Javadoc (https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) when executing the following program.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Compile the program
      2. Run it using Oracle HotSpot java

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      public int java.lang.Object.hashCode()
      ACTUAL -
      public native int java.lang.Object.hashCode()

      ---------- BEGIN SOURCE ----------
      import java.lang.reflect.Method;
      public class A {
      public static void main(String[] args) throws NoSuchMethodException {
      System.out.println(A.class.getMethod("hashCode"));
      }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: