This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 208666

Summary: "netbinox" not buildable on OpenJDK and JDK1.7
Product: platform Reporter: Jan Lahoda <jlahoda>
Component: NetigsoAssignee: Jaroslav Tulach <jtulach>
Status: CLOSED FIXED    
Severity: normal CC: jglick
Priority: P3    
Version: 7.2   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 210244    
Attachments: Failed build of netbinox.

Description Jan Lahoda 2012-02-20 19:38:39 UTC
Created attachment 115963 [details]
Failed build of netbinox.

I cannot build netbinox module (sorry if this is not the correct category - there is no entry for netbinox in .nbbugzilla-components) using OpenJDK, or JDK1.7 - closed JDK 1.6 is OK. Error output is attached.

Not buildable on:
$ javac -version
javac 1.6.0_22
$ java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.2) (6b22-1.10.2-0ubuntu1~11.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

and on:
$ java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
$ javac -version
javac 1.7.0

But buildable on:
$ javac -version
javac 1.6.0_24
$ java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode)
Comment 1 Jaroslav Tulach 2012-02-24 11:08:07 UTC
.nbbugzilla-components entries fixed in ef3f1d13dd48
Comment 2 Jaroslav Tulach 2012-02-24 15:29:23 UTC
Lahváči I wanted to CC you to help me with the issue...

"error: type ServiceReference does not take parameters" is a nonsence, since OSGi4.3, the ServiceReference type takes parameters.

Report a JDK bug or use some new JavaC.
Comment 3 Jan Lahoda 2012-02-24 18:19:31 UTC
(In reply to comment #2)
> Lahváči I wanted to CC you to help me with the issue...
> 
> "error: type ServiceReference does not take parameters" is a nonsence, since
> OSGi4.3, the ServiceReference type takes parameters.

It is questionable whether the ServiceReference actually take type parameters (from the compiler point of view - whats written in the OSGi spec does not matter much). The problem is that the classfiles have version 48 (=1.4), and use the Signature attribute, which contains the type parameter information and was introduced in version 49 (=1.5). The javac ignores such attributes since 7 (and that has apparently been backported to OpenJDK 6):
" [nb-javac] /media/src/space/src/nb/outgoing/nbbuild/build/public-package-jars/org-netbeans-libs-osgi.jar(org/osgi/framework/ServiceReference.class): warning: [classfile] Signature attribute introduced in version 49.0 class files is ignored in version 48.0 class files"

To the best of my knowledge, this has been introduced intentionally:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6817950

Actually, the current warning has obviously been added ex post, see Jesse's:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6966357
which was duplicated to an enhancement that actually implemented the warning:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6999210

> 
> Report a JDK bug or use some new JavaC.

Newer javac won't compile netbinox, while older will - as I noted above, it cannot be compiled using JDK7. I was not able to check with JDK8, but I still see the check in javac sources, so I am quite confident the behavior is still the same.

(I see that there might be confusion due to fact that the OpenJDK 6 version was 1.6.0_22, while the closed one was 1.6.0_24 - I think that these version numbers are independent, and cannot be compared.)
Comment 4 Jaroslav Tulach 2012-02-28 05:21:20 UTC
(In reply to comment #3)
> It is questionable whether the ServiceReference actually take type parameters
> (from the compiler point of view - whats written in the OSGi spec does not
> matter much). The problem is that the classfiles have version 48 (=1.4), and
> use the Signature attribute, which contains the type parameter information and
> was introduced in version 49 (=1.5). The javac ignores such attributes since 7
> (and that has apparently been backported to OpenJDK 6):

I see. I've simulated the failure with java version "1.7.0_147-icedtea"

I am using raw types since: ergonomics#35e07169f6bc
Comment 5 Jesse Glick 2012-02-28 17:36:21 UTC
You should report to the OSGi consortium that compliant compilers will reject their attempt to sneak generic types into a -target 1.4 JAR.
Comment 6 Quality Engineering 2012-03-01 11:01:07 UTC
Integrated into 'main-golden', will be available in build *201203010400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/35e07169f6bc
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #208666: Make sure netbinox compiles on 1.7.0_147-icedtea