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

Regression: javac7 doesnt resolve method calls properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 7
    • 7
    • tools
    • b40
    • 7
    • b42
    • generic
    • generic
    • Not verified

      The following used to compile on JDK 6 and no longer compiles on JDK 7 (b40).
      javac 1.7.0-ea
      java version "1.7.0-ea"
      Java(TM) SE Runtime Environment (build 1.7.0-ea-b40)
      Java HotSpot(TM) Server VM (build 14.0-b07, mixed mode)
      ----------------------------------------------------------------------------

      public class Node { ... }

      public class AbstractNode extends Node {
          private Image findIcon(int a,int b) { ... }
          ...
      }
      public class DataNode extends AbstractNode { ... }

      public class DataFolder {
         static Image findIcon(int a, String s, String s2) { ... }
         public class FolderNode extends DataNode {
              public Image getOpenedIcon (int type) {
                    ...
                    Image img = findIcon(someint, somestring, someotherstring);
                    ...
              }
         }
      }

      netbeans_platform/openide/loaders/src/org/openide/loaders/DataFolder.java:1123: method findIcon in class org.openide.nodes.AbstractNode cannot be applied to given types
          [javac] required: int,int
          [javac] found: int,java.lang.String,java.lang.String
          [javac] img = findIcon(0, "Nb.Explorer.Folder.icon", "Tree.closedIcon"); // NOI18N
          [javac] ^

      I have attached a smaller test cases which shows this behaviour:
      See Main.java and NewClass.java attached.
      It compiles with JDK 6 compiler, and fails with JDK 7.

            mcimadamore Maurizio Cimadamore
            dfuchs Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: