-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
java.lang.NullPointerException on project compilation with IBM J9 java 1.6 #589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
👤 tom.bujok 🕗 Jul 30, 2013 at 07:59 UTC What steps will reproduce the problem?
What is the expected output? What do you see instead? What version of the product are you using? On what operating system? Please provide any additional information below. |
👤 r.spilker 🕗 Jul 30, 2013 at 09:34 UTC Can you please provide a zip-file containing an example demonstrating the problem? |
👤 r.spilker 🕗 Jul 30, 2013 at 09:36 UTC Also, is this problem new in the 0.12.0, or was it also present in previous versions? Since what version is it broken? I personally use lombok 0.11.6 in a multi-module maven project without any problems. |
👤 tom.bujok 🕗 Jul 30, 2013 at 10:49 UTC Sorry, cannot attach zip, it's a big commercial project - it would be extremely difficult to externalize stuff. I tested version 0.12.0, 0.11.8 and 0.11.6 and it fails. BTW, I am using IBM SDK version javac 1.6.0_14 |
👤 tom.bujok 🕗 Jul 30, 2013 at 11:23 UTC 0.11.4 does not work either. |
👤 tom.bujok 🕗 Jul 31, 2013 at 08:42 UTC Any hints? |
👤 reinierz 🕗 Aug 12, 2013 at 20:05 UTC Java 6 is EOL or about to; I checked out the code in the java 7 version of IdentityHashMap.Entry's setValue method and it couldn't possibly throw an NPE. Also, line 131 is the javadoc of the class itself. So, either (A) IdentityHashMap has been completely revamped between java 6 and java 7, or (B) you're using a very weird version of the runtime classes which has a bug in IdentityHashMap.Entry.setValue. What happens if you update to java 7? You're going to have to sooner rather than later. NB: I'm on a modern mac; I can't even run java6, so this is impossible for me to test. Roel doesn't have it on his PC either (though he can at least in theory install it). |
👤 tom.bujok 🕗 Aug 12, 2013 at 20:52 UTC Thanks for the answer. I understand your point of view. The question is more whether you want to support non-standard (non-oracle) or old environments. In the corporate world it's pretty common to use java 5 nowadays. These EJB 2.x are still running there. That problem occurred on IBM SDK 1.5 (and 1.6). You can download it here to have a look, of course if you are willing to play with the non-oracle world... |
👤 reinierz 🕗 Aug 12, 2013 at 22:36 UTC Oh, sure, JRE5 and JRE6 are still extremely widespread, no argument here. However, lombok is irrelevant at the deployment side of any application; lombok modifies the way javac (or jikes, I guess, if that's still a thing in IBM SDK, though, isn't that C code? I'm 100% positive lombok doesn't work at all in jikes) compiles, that is it. You can compile with javac7, running in a JRE8, producing class files that you end up running on a JRE6. That's fine. I'm saying: You should upgrade to javac7, and run javac7 on JRE7, producing class files which as far as we care are targeted at 1.4, let alone 1.5 or 1.6. So, on your development machine, have a JDK7 installed, and use its javac, using "-source 1.5 -target 1.5" to make sure it produces class files compatible with JRE5, to compile. The issue is this: During a lombok operation, a call in java.util.IdentityHashMap fails. Now, as far as I know, unless harmony is involved, j.u.IHM is NOT AN IBM THING - it's just the same plain old sun/oracle-written class. Except it's screwed up somehow. Also, it's from the oracle JRE6's RT, which is very much EOL, and extremely hard for both me and Roel to test. Note for example that if you were to use the javac that ships with JDK5, lombok doesn't work AT ALL, and never has. proper annotation processing wasn't a feature until javac 6. So, in short:
|
👤 tom.bujok 🕗 Aug 15, 2013 at 14:09 UTC Fair enough. So I've got JDK 1.7 and the bug is still there. I attach a screenshot where you can see the message. I am using sth like this: What's more, the compilation in the console hangs forever. $ java -version |
👤 tom.bujok 🕗 Aug 15, 2013 at 14:20 UTC Do you test Lombok at IBM's SKDs at all? |
👤 setanta.mathews 🕗 Aug 28, 2013 at 10:54 UTC For what it's worth, I'm having the same problem with J9. |
👤 r.spilker 🕗 Aug 28, 2013 at 18:39 UTC To answer the question: no we never tested with IBM's SDK. From the stacktrace I do see that something is not as expected. We'll have a go soon to try this out, but currently it is still holiday season over here. And we're also working hard on java8 support since the new Netbeans uses the java8 compiler internally, and that has higher priority. |
👤 tom.bujok 🕗 Aug 29, 2013 at 09:01 UTC Tomorrow we are organising a Hackergarten meeting with @ aalmiray and other geeks. We could have a look at this issue. Do you think it's feasible to solve it in couple of hours? |
👤 setanta.mathews 🕗 Aug 29, 2013 at 11:50 UTC It might be as simple as dealing with nulls instead of expecting empty arrays. See the following bug against spring. |
👤 r.spilker 🕗 Aug 29, 2013 at 12:08 UTC That might be the case. In ecj we expects nulls, in javac empty lists. What would be my strategy for tracking this down:
|
👤 r.spilker 🕗 Aug 29, 2013 at 12:16 UTC Looking at the code, it might be as simple as inserting a check on lombok.javac.apt.Processor.java:213 to test if unwrapped == null and if it is return from the method. |
👤 tom.bujok 🕗 Aug 29, 2013 at 12:19 UTC Perfect. Thanks for the hints. Would be nice to have it done. We will try to tackle it... Do you have twitter? To ping you if we are stuck or sth? |
👤 askoning 🕗 Oct 07, 2013 at 18:44 UTC Issue #618 has been merged into this issue. |
👤 askoning 🕗 Oct 07, 2013 at 18:46 UTC From issue #618: maven isn't the problem. One down, N to go? |
👤 r.spilker 🕗 Jan 20, 2014 at 02:45 UTC I think this has been fixed already in f0cdc27. Can anyone confirm? We will be closing this issue unless someone speaks up within two weeks. |
👤 r.spilker 🕗 Feb 28, 2014 at 01:01 UTC |
👤 r.spilker 🕗 Jun 03, 2014 at 23:38 UTC According to http://stackoverflow.com/questions/23812105/annotating-a-list-of-fields-instead-of-a-single-field-with-lombok-v-0-9-2 this bug is still open. A possible workaround is to replace the whole IdentityHashMap by a different map implementation or a ReferenceFieldAugment. |
👤 r.spilker 🕗 Jun 03, 2014 at 23:46 UTC Alternatively, we can use a regular HashMap with a key that holds a reference to the JCCompilationUnit and implements equals and hashcode by doing identity operations on it. |
👤 Maaartinus 🕗 Jun 05, 2014 at 04:34 UTC You might be able to use normal |
👤 r.spilker 🕗 Jun 11, 2014 at 09:32 UTC In the 1.14.2 we've changed the code a bit to at least no longer use IdentityHashMapEntry﹟setValue() but since we cannot reproduce the problem I have no idea if this fixes the problem. |
👤 vzorge 🕗 Jun 11, 2014 at 13:53 UTC Thanks you! Running with IBM jdk 6 that comes with Websphere 7 Cheers, |
👤 r.spilker 🕗 Feb 06, 2015 at 12:50 UTC Thanks for the feedback |
End of migration |
Migrated from Google Code (issue 554)
The text was updated successfully, but these errors were encountered: