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

Java source compiles on ECLIPSE but fails on JDK 1.5 / 1.6

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2
    • None
    • 6u23
    • tools
    • sparc
    • solaris_10

    Description

      Java source compile on ECLOPSE but failiing on the latest
      JDK for 1.5 and 1.6. The code does compile on JDK 7

      Source code

      public class Test2
      {
         public static <T> void method( X<T> x, T t ) {}

         public void testCompile()
         {
             method( new X<Gen<String>>(), new Gen() ); //generates error in javac, not in Eclipse
         }

         private class Gen<T> {}
         private class X<T> extends Gen<T> {}
      }

      cores2-da-sparc-2-a:/cores_data/pool-1/data4/3-2695544290 23 % /usr/jdk/jdk1.6.0_21/bin/java -version
      java version "1.6.0_21"
      Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
      Java HotSpot(TM) Server VM (build 17.0-b16, mixed mode)

      cores2-da-sparc-2-a:/cores_data/pool-1/data4/3-2695544290 25 % /usr/jdk/jdk1.6.0_21/bin/javac Test2.java
      Test2.java:7: <T>method(Test2.X<T>,T) in Test2 cannot be applied to (Test2.X<Test2.Gen<java.lang.String>>,Test2.Gen)
                     method( new X<Gen<String>>(), new Gen() ); //generates error in javac, not in Eclipse
                     ^
      1 error
      This escalated CR is being worked via CR 6718364

      Attachments

        Issue Links

          Activity

            People

              mcimadamore Maurizio Cimadamore
              dvanero Dennis Van Eron (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: