-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
hopper
-
generic
-
solaris_7
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2044122 | 1.4.0 | Neal Gafter | P4 | Resolved | Fixed | beta3 |
+ cat -n compile.sh
1 #!/bin/sh
2
3 J2SE14=/java/jdk/1.4/re/nightly/j2se_beta_refresh/binaries/solsparc/latest
4 export J2SE14
5 JSR14DISTR=/net/frog/gafter/JSR14/jsr14_adding_generics-1_1-ea
6 export JSR14DISTR
7 JAVAC=${JSR14DISTR}/scripts/javac
8 JAVA=${J2SE14}/bin/java
9
10 set -x
11 find . -name \*.class -print | xargs /bin/rm
12 cat -n compile.sh
13 cat -n Hashtable.java
14 cat -n CharScanner.java
15 cat -n RetroLexer.java
16 ${JAVAC} -classpath classes -d classes Hashtable.java &&
17 ${JAVAC} -classpath classes -d classes CharScanner.java &&
18 ${JAVAC} -classpath classes -d classes RetroLexer.java
+ cat -n Hashtable.java
1 package util;
2 public class Hashtable<K,V> {
3 public synchronized V put(K key, V value) {
4 throw new Error();
5 }
6 }
+ cat -n CharScanner.java
1 package antlr;
2
3 import util.Hashtable;
4 public class CharScanner {
5 protected Hashtable literals; // set by subclass
6 }
+ cat -n RetroLexer.java
1 package parser;
2
3 import util.Hashtable; // this is necessary to reproduce the bug!
4
5 public class RetroLexer extends antlr.CharScanner
6 {
7 public RetroLexer() {
8 literals.put("Foo", new Integer(5));
9 }
10 }
+ /net/frog/gafter/JSR14/jsr14_adding_generics-1_1-ea/scripts/javac -classpath classes -d classes Hashtable.java
+ /net/frog/gafter/JSR14/jsr14_adding_generics-1_1-ea/scripts/javac -classpath classes -d classes CharScanner.java
+ /net/frog/gafter/JSR14/jsr14_adding_generics-1_1-ea/scripts/javac -classpath classes -d classes RetroLexer.java
RetroLexer.java:8: put(K,V) in util.Hashtable<K,V> cannot be applied to (java.lang.String,java.lang.Integer)
literals.put("Foo", new Integer(5));
^
1 error
Compilation exited abnormally with code 1 at Wed May 30 11:07:20
1 #!/bin/sh
2
3 J2SE14=/java/jdk/1.4/re/nightly/j2se_beta_refresh/binaries/solsparc/latest
4 export J2SE14
5 JSR14DISTR=/net/frog/gafter/JSR14/jsr14_adding_generics-1_1-ea
6 export JSR14DISTR
7 JAVAC=${JSR14DISTR}/scripts/javac
8 JAVA=${J2SE14}/bin/java
9
10 set -x
11 find . -name \*.class -print | xargs /bin/rm
12 cat -n compile.sh
13 cat -n Hashtable.java
14 cat -n CharScanner.java
15 cat -n RetroLexer.java
16 ${JAVAC} -classpath classes -d classes Hashtable.java &&
17 ${JAVAC} -classpath classes -d classes CharScanner.java &&
18 ${JAVAC} -classpath classes -d classes RetroLexer.java
+ cat -n Hashtable.java
1 package util;
2 public class Hashtable<K,V> {
3 public synchronized V put(K key, V value) {
4 throw new Error();
5 }
6 }
+ cat -n CharScanner.java
1 package antlr;
2
3 import util.Hashtable;
4 public class CharScanner {
5 protected Hashtable literals; // set by subclass
6 }
+ cat -n RetroLexer.java
1 package parser;
2
3 import util.Hashtable; // this is necessary to reproduce the bug!
4
5 public class RetroLexer extends antlr.CharScanner
6 {
7 public RetroLexer() {
8 literals.put("Foo", new Integer(5));
9 }
10 }
+ /net/frog/gafter/JSR14/jsr14_adding_generics-1_1-ea/scripts/javac -classpath classes -d classes Hashtable.java
+ /net/frog/gafter/JSR14/jsr14_adding_generics-1_1-ea/scripts/javac -classpath classes -d classes CharScanner.java
+ /net/frog/gafter/JSR14/jsr14_adding_generics-1_1-ea/scripts/javac -classpath classes -d classes RetroLexer.java
RetroLexer.java:8: put(K,V) in util.Hashtable<K,V> cannot be applied to (java.lang.String,java.lang.Integer)
literals.put("Foo", new Integer(5));
^
1 error
Compilation exited abnormally with code 1 at Wed May 30 11:07:20
- backported by
-
JDK-2044122 generics: raw types versus separate compilation causes type error
-
- Resolved
-
- duplicates
-
JDK-4487402 generics: separate compilation versus raw type variables (Collections.EMPTY_LIST
-
- Closed
-