...
CodanApplication_Options=Options:
CodanApplication_all_option= -all - run on all projects in workspace
CodanApplication_verbose_option= -verbose - print verbose build information
-CodanBuilder_Code_Analysis_On=Code analysis on
-CodanSeverity_Error=Error
-CodanSeverity_Info=Info
-CodanSeverity_Warning=Warning
-FileScopeProblemPreference_Label=Exclusion and Inclusion
+CodanRunner_Code_Analysis_On=Code analysis on {0}
diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java
index e1e63830d69..bec13249e65 100644
--- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java
+++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/model/ProblemProfile.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.cdt.codan.internal.core.model;
+import java.util.ArrayList;
+import java.util.Collection;
+
import org.eclipse.cdt.codan.core.model.IProblem;
import org.eclipse.cdt.codan.core.model.IProblemCategory;
import org.eclipse.cdt.codan.core.model.IProblemProfile;
@@ -19,15 +22,13 @@ import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.SafeRunner;
-import java.util.ArrayList;
-import java.util.Collection;
-
/**
* @author Alena
*/
public class ProblemProfile implements IProblemProfile, Cloneable {
private CodanProblemCategory rootCategory;
private Object resource;
+ private ListenerList preferenceChangeListeners;
/**
* @param resource
@@ -106,7 +107,6 @@ public class ProblemProfile implements IProblemProfile, Cloneable {
public IProblemCategory getParentCategory() {
return getRoot();
}
- private ListenerList preferenceChangeListeners;
@Override
public void addProfileChangeListener(IProblemProfileChangeListener listener) {
@@ -120,7 +120,7 @@ public class ProblemProfile implements IProblemProfile, Cloneable {
if (preferenceChangeListeners == null)
return;
preferenceChangeListeners.remove(listener);
- if (preferenceChangeListeners.size() == 0)
+ if (preferenceChangeListeners.isEmpty())
preferenceChangeListeners = null;
}
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java
index 5755b01010e..f89c7024440 100644
--- a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java
@@ -12,15 +12,13 @@
*******************************************************************************/
package org.eclipse.cdt.codan.internal.ui.cxx;
-import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.core.model.CheckerLaunchMode;
-import org.eclipse.cdt.codan.internal.core.CodanBuilder;
+import org.eclipse.cdt.codan.internal.core.CodanRunner;
import org.eclipse.cdt.internal.ui.editor.CEditor;
import org.eclipse.cdt.ui.ICEditor;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osgi.util.NLS;
@@ -38,8 +36,6 @@ import org.eclipse.ui.PlatformUI;
* @author Alena Laskavaia
*/
public class Startup implements IStartup {
- private static final IProgressMonitor NULL_PROGRESS_MONITOR = new NullProgressMonitor();
-
@Override
public void earlyStartup() {
registerListeners();
@@ -86,13 +82,12 @@ public class Startup implements IStartup {
}
}
}
-
+
private void processResource(final IResource resource) {
Job job = new Job(NLS.bind(Messages.Startup_AnalyzingFile, resource.getName())) {
@Override
protected IStatus run(IProgressMonitor monitor) {
- CodanBuilder builder = (CodanBuilder) CodanRuntime.getInstance().getBuilder();
- builder.processResource(resource, NULL_PROGRESS_MONITOR, CheckerLaunchMode.RUN_ON_FILE_OPEN);
+ CodanRunner.processResource(resource, monitor, CheckerLaunchMode.RUN_ON_FILE_OPEN);
return Status.OK_STATUS;
}
};
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 b8ba26fedc9..60f6ddfeb1d 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
@@ -11,6 +11,9 @@
*******************************************************************************/
package org.eclipse.cdt.codan.internal.ui.preferences;
+import java.util.ArrayList;
+import java.util.Iterator;
+
import org.eclipse.cdt.codan.core.CodanCorePlugin;
import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.core.model.ICheckersRegistry;
@@ -41,17 +44,15 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
-import java.util.ArrayList;
-import java.util.Iterator;
-
/**
- * This class represents a preference page that is contributed to the Preferences dialog. By
- * subclassing {@code FieldEditorPreferencePage}, we can use built-in field support in JFace to
- * create a page that is both small and knows how to save, restore and apply its values.
+ * This class represents a preference page that is contributed to the Preferences dialog.
+ * By subclassing {@code FieldEditorPreferencePage}, we can use built-in field support in
+ * JFace to create a page that is both small and knows how to save, restore and apply its
+ * values.
*
- * This page is used to modify preferences only. They are stored in the preference store that
- * belongs to the main plug-in class. That way, preferences can be accessed directly via the
- * preference store.
+ * This page is used to modify preferences only. They are stored in the preference store that
+ * belongs to the main plug-in class. That way, preferences can be accessed directly via
+ * the preference store.
*
*/
public class CodanPreferencePage extends FieldEditorOverlayPage implements IWorkbenchPreferencePage {
@@ -89,8 +90,10 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork
}
/**
- * Creates the field editors. Field editors are abstractions of the common GUI blocks needed to
- * manipulate various types of preferences. Each field editor knows how to save and restore
+ * Creates the field editors. Field editors are abstractions of the common
+ * GUI blocks needed to
+ * manipulate various types of preferences. Each field editor knows how to
+ * save and restore
* its own value.
*/
@Override
@@ -156,13 +159,13 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork
}
private void saveWidgetValues() {
- String id = (!hasSelectedProblems()) ? EMPTY_STRING : selectedProblems.get(0).getId();
+ String id = !hasSelectedProblems() ? EMPTY_STRING : selectedProblems.get(0).getId();
getDialogSettings().put(getWidgetId(), id);
}
private void restoreWidgetValues() {
String id = getDialogSettings().get(getWidgetId());
- if (id != null && id.length() > 0 && checkedTreeEditor != null) {
+ if (id != null && !id.isEmpty() && checkedTreeEditor != null) {
IProblem problem = profile.findProblem(id);
if (problem != null) {
checkedTreeEditor.getTreeViewer().setSelection(new StructuredSelection(problem), true);
@@ -194,12 +197,11 @@ public class CodanPreferencePage extends FieldEditorOverlayPage implements IWork
return;
}
IProblem[] selected = selectedProblems.toArray(new IProblem[selectedProblems.size()]);
- CustomizeProblemDialog dialog =
- new CustomizeProblemDialog(getShell(), selected, (IResource) getElement());
+ CustomizeProblemDialog dialog = new CustomizeProblemDialog(getShell(), selected, (IResource) getElement());
dialog.open();
checkedTreeEditor.getTreeViewer().refresh(true);
}
-
+
private boolean hasSelectedProblems() {
return selectedProblems != null && !selectedProblems.isEmpty();
}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
index d498be65f88..39b860b7167 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.cdt.codan.internal.ui.preferences;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.cdt.codan.core.CodanCorePlugin;
import org.eclipse.cdt.codan.core.PreferenceConstants;
import org.eclipse.cdt.codan.internal.ui.CodanUIActivator;
@@ -40,9 +43,6 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbenchPropertyPage;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* @author Berthold Daum
*/
@@ -269,7 +269,7 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
return super.getPreferenceStore();
}
- /*
+ /**
* Enables or disables the field editors and buttons of this page
*/
private void updateFieldEditors() {
@@ -293,8 +293,8 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
}
/**
- * We override the performOk method. In case of property pages we copy the
- * values in the overlay store into the property values of the selected
+ * We override the performOk method. In case of property pages we copy
+ * the values in the overlay store into the property values of the selected
* project. We also save the state of the radio buttons.
*
* @see org.eclipse.jface.preference.IPreferencePage#performOk()