JDK-4181162 : Possible incorrect code in JDK sources accepted by javac
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1
  • CPU: generic
  • Submitted: 1998-10-13
  • Updated: 1998-12-01
  • Resolved: 1998-12-01
Related Reports
Duplicate :  
Description
These are alleged bogosities in the JDK source that javac incorrectly
accepts, other than Swing stuff.



"AbstractList.java", line 376: error: "java.util.List" is not an enclosing class
                List.this.remove(lastRet);
                ^
 
"AbstractList.java", line 430: error: "java.util.List" is not an enclosing class
                List.this.set(lastRet, o);
                ^
 
"AbstractList.java", line 443: error: "java.util.List" is not an enclosing class
                List.this.add(cursor, o);
                ^
 
3 errors detected in this compilation.
"AbstractMap.java", line 343: error: "java.util.Map" is not an enclosing class
                    return Map.this.size();
                           ^
 
"AbstractMap.java", line 347: error: "java.util.Map" is not an enclosing class
                    return Map.this.containsKey(k);
                           ^
 
"AbstractMap.java", line 399: error: "java.util.Map" is not an enclosing class
                    return Map.this.size();
                           ^
 
"AbstractMap.java", line 403: error: "java.util.Map" is not an enclosing class
                    return Map.this.containsValue(v);
                           ^
 
4 errors detected in this compilation.
"AlphaCompositeContextCLEAR.java", line 52: error: class or interface "Tile"
          is undefined
    public void compose(Tile src,
                        ^
 
"AlphaCompositeContextCLEAR.java", line 28: error: class
          "java.awt.AlphaCompositeContextCLEAR" is not declared abstract but
          does not define method "void compose(java.awt.image.Raster,
          java.awt.image.Raster, java.awt.image.WritableRaster)" in interface
          "java.awt.CompositeContext"
class AlphaCompositeContextCLEAR implements CompositeContext {
      ^
 
2 errors detected in this compilation.
"AttributedCharacterIterator.java", line 161: warning: extra ";" is nonstandard
    };
     ^
 
"AttributedCharacterIterator.java", line 132: error: statement is unreachable
            };
             ^
 
1 error detected in this compilation.
"MessageDigest.java", line 440: error: variable
          "java.security.MessageDigest.algorithm" cannot be referenced using a
          simple name -- it is inherited in class
          "java.security.MessageDigest.Delegate" and hides variable
          "java.security.MessageDigest.algorithm", which is declared in an
          enclosing scope
                Delegate that = new Delegate(digestSpiClone, algorithm);
                                                             ^
 
"MessageDigest.java", line 441: error: variable
          "java.security.MessageDigest.provider" cannot be referenced using a
          simple name -- it is inherited in class
          "java.security.MessageDigest.Delegate" and hides variable
          "java.security.MessageDigest.provider", which is declared in an
          enclosing scope
                that.provider = provider;
                                ^
 
"MessageDigest.java", line 442: error: variable
          "java.security.MessageDigest.state" cannot be referenced using a
          simple name -- it is inherited in class
          "java.security.MessageDigest.Delegate" and hides variable
          "java.security.MessageDigest.state", which is declared in an
          enclosing scope
                that.state = state;
                             ^
 
3 errors detected in this compilation.
"Signature.java", line 605: error: variable
          "java.security.Signature.algorithm" cannot be referenced using a
          simple name -- it is inherited in class
          "java.security.Signature.Delegate" and hides variable
          "java.security.Signature.algorithm", which is declared in an
          enclosing scope
                Delegate that = new Delegate(sigSpiClone, algorithm);
                                                          ^
 
"Signature.java", line 606: error: variable "java.security.Signature.provider"
          cannot be referenced using a simple name -- it is inherited in class
          "java.security.Signature.Delegate" and hides variable
          "java.security.Signature.provider", which is declared in an
          enclosing scope
                that.provider = provider;
                                ^
 
2 errors detected in this compilation.
"TextAttribute.java", line 117: error: statement is unreachable
        };
         ^
 
1 error detected in this compilation.
"TreeMap.java", line 724: error: interface "java.util.Map.Entry" cannot be
          referenced using a simple name -- it is inherited in class
          "java.util.TreeMap.SubMap" and hides class
          "java.util.TreeMap.Entry", which is declared in an enclosing scope
                Entry node = getEntry(key);
                ^
 
"TreeMap.java", line 736: error: interface "java.util.Map.Entry" cannot be
          referenced using a simple name -- it is inherited in class
          "java.util.TreeMap.SubMap" and hides class
          "java.util.TreeMap.Entry", which is declared in an enclosing scope
                Entry node = getEntry(key);
                ^
 
"TreeMap.java", line 738: error: an argument of type "java.util.Map.Entry" is
          incompatible with a parameter of type "java.util.TreeMap.Entry"
                    deleteEntry(node);
                                ^
 
3 errors detected in this compilation.
 

Comments
EVALUATION Most of these problems have already been corrected. I was not able to verify the fix for AlphaCompositeContextCLEAR -- I believe the class no longer exists. The empty statement reachability problem is still in the compiler (duplicate 4083890) and in AttributedCharacterIterator and TextAttribute (created bugs 4193900, 4193904). Since the majority of the problems cited in this report have been fixed, I am closing this bug as a duplicate of the one remaining compiler problem. todd.turnidge@Eng 1998-12-01
01-12-1998