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

Regression: javac7 doesnt resolve method calls properly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 7
    • Fix Version/s: 7
    • Component/s: tools
    • Subcomponent:
    • Introduced In Build:
      b40
    • Introduced In Version:
      7
    • Resolved In Build:
      b42
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: