Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/codan
diff options
context:
space:
mode:
authorSergey Prigogin2011-03-04 23:13:45 +0000
committerSergey Prigogin2011-03-04 23:13:45 +0000
commit9a7ecdfa7cffd116adf9d02ff843bfb8028704b3 (patch)
tree9ce52d041b72be713421acda3f1ff722b6f73b1f /codan
parent9738529f904f09af92c21610aafc225563bcd639 (diff)
downloadorg.eclipse.cdt-9a7ecdfa7cffd116adf9d02ff843bfb8028704b3.tar.gz
org.eclipse.cdt-9a7ecdfa7cffd116adf9d02ff843bfb8028704b3.tar.xz
org.eclipse.cdt-9a7ecdfa7cffd116adf9d02ff843bfb8028704b3.zip
Bug 338569 - Not found problem with customized settings makes Codan Preference UI unusable. Patch by Alex Ruiz.
Diffstat (limited to 'codan')
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java
index 04099cf2ecf..1517e86fe3e 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/CodanPreferencePage.java
@@ -70,7 +70,7 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork
if (event.getSelection() instanceof ITreeSelection) {
ITreeSelection s = (ITreeSelection) event.getSelection();
ArrayList<IProblem> list = new ArrayList<IProblem>();
- for (Iterator iterator = s.iterator(); iterator.hasNext();) {
+ for (Iterator<?> iterator = s.iterator(); iterator.hasNext();) {
Object o = iterator.next();
if (o instanceof IProblem) {
list.add((IProblem) o);
@@ -184,7 +184,9 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork
private void restoreWidgetValues() {
String id = CodanUIActivator.getDefault().getDialogSettings().get(getWidgetId());
if (id != null && id.length() > 0 && checkedTreeEditor != null) {
- checkedTreeEditor.getTreeViewer().setSelection(new StructuredSelection(profile.findProblem(id)), true);
+ IProblem problem = profile.findProblem(id);
+ if (problem != null)
+ checkedTreeEditor.getTreeViewer().setSelection(new StructuredSelection(problem), true);
} else {
setSelectedProblems(null);
}

Back to the top