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.
I just did a pull from main. I set up my build environment to use jdk6 update 3 on Solaris 10 x86. > java -version java version "1.6.0_03" Java(TM) SE Runtime Environment (build 1.6.0_03-b05) Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode) I entered the command: /export/home/vbk/ant-1.7.0/bin/ant -Dpermit.jdk6.builds=true | & tee ../../nbhg-build.txt I get the following compilation failure.... compile: [mkdir] Created dir: /export/home/vbk/nbhg/main/jumpto/build/classes [javac] Compiling 19 source files to /export/home/vbk/nbhg/main/jumpto/build/classes [repeat] /export/home/vbk/nbhg/main/jumpto/src/org/netbeans/spi/jumpto/type/TypeProvider.java:216: reference to addAll is ambiguous, both method addAll(java.util.Collection<? extends E>) in java.util.Collection<capture#760 of ? super org.netbeans.spi.jumpto.type.TypeDescriptor> and method addAll(java.util.Collection<? extends E>) in java.util.List<capture#760 of ? super org.netbeans.spi.jumpto.type.TypeDescriptor> match [repeat] result.addAll(typeDescriptor); [repeat] ^ [repeat] 1 error [nbmerge] Failed to build target: all-jumpto BUILD FAILED /export/home/vbk/nbhg/main/nbbuild/build.xml:709: The following error occurred while executing this line: /export/home/vbk/nbhg/main/nbbuild/build.xml:704: The following error occurred while executing this line: /export/home/vbk/nbhg/main/nbbuild/build.xml:754: The following error occurred while executing this line: /export/home/vbk/nbhg/main/nbbuild/templates/common.xml:110: Compile failed; see the compiler error output for details. Total time: 2 minutes 13 seconds Filed as Jesse requested...
If I comment out the offending line from above, I encounter another compilation failure at.... [repeat] /export/home/vbk/nbhg/main/java.source/src/org/netbeans/api/java/source/ClassIndex.java:605: reference to addAll is ambiguous, both method addAll(java.util.Collection<? extends E>) in java.util.Collection<capture#693 of ? super java.net.URL> and method addAll(java.util.Collection<? extends E>) in java.util.List<capture#693 of ? super java.net.URL> match [repeat] removedRoots.addAll(roots);; [repeat] ^
after I comment out the offending line for the previous build failure... I encounter [repeat] /export/home/vbk/nbhg/main/websvc.saas.services.strikeiron/src/com/strikeiron/search/SISearchService.java:108: cannot find symbol [repeat] symbol : method getPort(javax.xml.namespace.QName,java.lang.Class<com.strikeiron.search.SISearchServiceSoap>,javax.xml.ws.WebServiceFeature[]) [repeat] location: class javax.xml.ws.Service [repeat] return super.getPort(new QName("http://www.strikeiron.com", "SISearchServiceSoap"), SISearchServiceSoap.class, features); [repeat] ^
The second problem should probably be filed separately in websvc.
as for error in websvc.saas.services.strikeiron - problem is that it relies on JAX-WS 2.1, but you use some JDK 6 which contains only JAX-WS 2.0 (so you have either JDK 6, 6u1, 6u2 or 6u3) there are following options how to bypass it: - update your JDK 6 to the latest official one (at least update 4) or -put jaxws-api.jar and jaxb-api.jar from either the IDE (websvc.jaxws21api module) or from JAX-WS 2.1 from jax-ws.dev.java.net (or you can use webservices-api.jar from $GF_HOME/lib/endorsed) to $JRE/lib/endorsed or you can try to set java.endorsed.dirs property so it points to the location which contains jaxws-api.jar and jaxb-api.jar (or just webservices-api.jar) - I personally didn't check this, but it should work too
Not my code.
Not Hrebejk's code! ;-) I think it is compiler bug, jdk5 and jdk7 compiles it.
Created attachment 57337 [details] Demo class illustrating the problem
pflaska: its isn't a jdk bug until it is filed as a jdk bug. has that been done?
Workaround exists - build with recommended compiler.
> its isn't a jdk bug until it is filed as a jdk bug. has that been done? It is a bug, it is obvious. It is fixed in jdk7.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6356673 was the jdk 5 manifestation of this issue. there is a bug filed against jdk 6, for the same thing: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6507334. There is a claim that this will be fixed in jdk 6... but I haven't found the real details....
So does anyone mind if I apply a patch to actually make it work on JDK6? It's a bit inconvenient that it doesn't work now; I want to use JDK6 instead of JDK5 as my default Java environment but I regularly forget to modify my environment before building the IDE which wastes time when I have to restart the build after running into this error. This patch works for me: java.source: - result.addAll(typeDescriptor); + // Workaround for JDK6 - see issue 128102 + //result.addAll(typeDescriptor); + ((List)result).addAll(typeDescriptor); jumpto: - removedRoots.addAll(roots);; + // Workaround for JDK6 - see issue 128102 + //removedRoots.addAll(roots);; + ((List)removedRoots).addAll(roots);; (I don't run into the websvc.saas issue since I don't build websvc in my clusters).
Created attachment 57582 [details] Workarounds in java.source and jumpto
I would say thank you.
Honza Lahoda already talked to me about such a workaround. From my point of view, everyone who wants to build it with 1.6 can do the modifications in his local copy, they are really simple and obvious, if he looks to the code. But I understand that now with Mercurial and working on whole source copy, it is boring to prevent committing it, so from my point of view (in jumpto), do whatever you think. -- I have no strong opinion on it. What is interesting on this problem, that it is a regression, which is already covered by test in jdk. -- Thought there is a test which fails in jdk6. Note: Honza already talked directly to compiler guys about this problem, maybe he will be able to give you update.
Integrated into 'main-golden', available in build *200808260201* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/532bad2bed7a User: Tomas Zezula <tzezula@netbeans.org> Log: #128361:Compilation against jdk 6 broken....
Tomas integrated the cast - workaround. Not sure about other modules, but definitely jumpto is compilable in 1.6.