Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 544330

Summary: [12] NPE when opening Compile compliance configuration dialog
Product: [Eclipse Project] JDT Reporter: Jay Arthanareeswaran <jarthana>
Component: UIAssignee: Noopur Gupta <noopur_gupta>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, kalyan_prasad
Version: 4.10Flags: kalyan_prasad: review+
Target Milestone: BETA J12   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/136762
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=d4b293106058130913dc1f2e5112999dcf7ecdbe
https://git.eclipse.org/r/137353
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=f9a1a1ea2cece3ca9bd17d44215532966b8337be
Whiteboard:
Bug Depends on:    
Bug Blocks: 545120    

Description Jay Arthanareeswaran CLA 2019-02-11 04:58:30 EST
The NPE occurs with the latest Y build

https://download.eclipse.org/eclipse/downloads/drops4/Y20190208-0505/

when I go to the compiler compliance page. The following trace is from the log:

java.lang.NullPointerException
	at org.eclipse.jdt.internal.ui.preferences.ComplianceConfigurationBlock.getCurrentCompliance(ComplianceConfigurationBlock.java:1197)
	at org.eclipse.jdt.internal.ui.preferences.ComplianceConfigurationBlock.settingsUpdated(ComplianceConfigurationBlock.java:262)
	at org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock.<init>(OptionsConfigurationBlock.java:361)
	at org.eclipse.jdt.internal.ui.preferences.ComplianceConfigurationBlock.<init>(ComplianceConfigurationBlock.java:218)
	at org.eclipse.jdt.internal.ui.preferences.CompliancePreferencePage.createControl(CompliancePreferencePage.java:73)
	at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1429)
	at org.eclipse.jface.preference.PreferenceDialog$8.run(PreferenceDialog.java:1196)
Comment 1 Jay Arthanareeswaran CLA 2019-02-11 04:59:43 EST
This may be related to the new options we added for preview features on this page.

FWIW, I am opening an existing workspace with the new build.
Comment 2 Noopur Gupta CLA 2019-02-12 03:10:44 EST
I am not able to reproduce this issue with latest changes from beta branches of core, ui and debug, even with a Java 8 project in my workspace.

Kalyan was getting this issue but is not getting it anymore after pulling the latest changes which also contain the fix for bug 544266, which may be the cause.

However, even after reverting the fix for bug 544266, I am still not getting this issue.

Jay, can you please pull the latest code in all branches and check if you can reproduce it in your use case?
Comment 3 Noopur Gupta CLA 2019-02-12 03:36:21 EST
I am able to reproduce it now. The difference was in Compiler preferences and properties page.
Comment 4 Eclipse Genie CLA 2019-02-12 08:03:53 EST
New Gerrit change created: https://git.eclipse.org/r/136762
Comment 5 Noopur Gupta CLA 2019-02-12 08:09:44 EST
(In reply to Eclipse Genie from comment #4)
> New Gerrit change created: https://git.eclipse.org/r/136762

The issue was that the EE options were not returning the preview properties for a project < 11 but we were still checking for their default values in UI. 

The same will also be applicable to the options returned from JavaCore i.e. we won't get the preview options for a project < 11.

I made a pass over all the related code in UI and updated it. It will be good to get another check over this. Kalyan, can you please have a look?
Comment 6 Jay Arthanareeswaran CLA 2019-02-21 04:07:05 EST
(In reply to Eclipse Genie from comment #4)
> New Gerrit change created: https://git.eclipse.org/r/136762

Can we get this in soon please? It's impossible for me to do any work on the Y build now.
Comment 7 Eclipse Genie CLA 2019-02-21 06:03:45 EST
Gerrit change https://git.eclipse.org/r/136762 was merged to [BETA_JAVA_12].
Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=d4b293106058130913dc1f2e5112999dcf7ecdbe
Comment 8 Eclipse Genie CLA 2019-02-21 06:07:11 EST
New Gerrit change created: https://git.eclipse.org/r/137353
Comment 9 Eclipse Genie CLA 2019-02-21 06:07:53 EST
Gerrit change https://git.eclipse.org/r/137353 was merged to [BETA_JAVA_12].
Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=f9a1a1ea2cece3ca9bd17d44215532966b8337be