Community
Participate
Working Groups
Build Identifier: 20110204-0611 Let's say I have my own custom codan checker installed in X instance of Eclipse+CDT. I make configuration changes to the problems provided by that checker (e.g. I configure them to "run in editor" only.) Now I open the same workspace with Y instance of Eclipse+CDT that does not have my custom codan checker and I go to the codan preference UI. I will get error "The currently displayed page contains invalid values" and I won't be able to see any configuration settings for the checkers that do exist in this instance of Eclipse. I got the following stack trace in the console: org.eclipse.core.runtime.AssertionFailedException: null argument: at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85) at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:73) at org.eclipse.jface.viewers.StructuredSelection.<init>(StructuredSelection.java:74) at org.eclipse.cdt.codan.internal.ui.preferences.CodanPreferencePage.restoreWidgetValues(CodanPreferencePage.java:189) The problem is that CodanPreferencePage does not check in "restoreWidgetValues" if the found problem is null, before passing it to the StructuredSelection constructor. The fix is easy, just check for null before creating the StructuredSelection. Everything works fine after that. I'm attaching a patch. Reproducible: Always Steps to Reproduce: 1. Create a C/C++ project and change settings for a problem in the Codan Preference UI 2. Close Eclipse. 3. Remove the problem that was configured before from plugin.xml in the project 'org.eclipse.cdt.codan.checkers' 4. Restart Eclipse, opening same workspace as in #1 5. Go to the codan preference UI 6. Boom! Error!
Created attachment 190068 [details] Proposed patch Proposed solution.
Fixed in HEAD > 20110304.
*** cdt cvs genie on behalf of sprigogin *** Bug 338569 - Not found problem with customized settings makes Codan Preference UI unusable. Patch by Alex Ruiz. [*] CodanPreferencePage.java 1.28 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java?root=Tools_Project&r1=1.27&r2=1.28