JDK-8066725 : javac produces classfiles it cannot read
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-12-04
  • Updated: 2015-06-04
  • Resolved: 2015-02-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b52Fixed
Related Reports
Blocks :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Before fixing JDK-8065132, javac was producing incorrect number of entries in Runtime(In)VisibileParameterAnnotations classfiles attribute for non-static innerclasses and enums. After fixing the bug, the attribute is correct in these cases, but javac cannot read the classfiles anymore.

To reproduce, use the two attached files as a jtreg test: place them in the same directory and use jtreg to run ParamAnnotationsRead.java. The test will fail with:
---
.../ParamAnnotationsRead.java:6: error: cannot access Foo
import p.ParamAnnotationsWrite.Foo;
                              ^
  bad class file: .../p/ParamAnnotationsWrite$Foo.class
    bad RuntimeInvisibleParameterAnnotations attribute: Foo(int)
    Please remove or make sure it appears in the correct subdirectory of the classpath.
1 error
result: Failed. Compilation failed: Compilation failed
---

Tested on custom build of jdk9/dev and jdk8u/jdk8u-dev, with langtools tips:
jdk9/dev/langtools:
$ hg tip
changeset:   2739:c956c25f9334
tag:         tip
parent:      2738:f7ce2cfa4cdb
parent:      2737:9d2192f36e53
user:        chegar
date:        Wed Dec 03 19:28:40 2014 +0000
summary:     Merge

jdk8u/jdk8u-dev/langtools:
$ hg tip
changeset:   2614:a12a9932f649
tag:         tip
user:        jlahoda
date:        Mon Sep 22 14:55:14 2014 +0200
summary:     8057794: Compiler Error when obtaining .class property

Comments
Yes, that would be the best way. I just did so.
22-12-2014

How do we indicate that this is no longer an issue for 8u40. (see JDK-8067039) Do we just remove the 8u40 affects version ?
17-12-2014