Use constants directly.
Add comment and silence the warning where this is done intentionally.
Change-Id: I9ff95c7b6283fd6fec7aeccff30b3cf460f946cb
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/MavenJdtPlugin.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/MavenJdtPlugin.java
index 0382c7a..a27888a 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/MavenJdtPlugin.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/MavenJdtPlugin.java
@@ -115,8 +115,11 @@
workspaceSourceDownloadJob = new WorkspaceSourceDownloadJob();
mavenConfiguration.addConfigurationChangeListener(new AbstractMavenConfigurationChangeListener() {
+ @SuppressWarnings("static-access")
public void mavenConfigurationChange(MavenConfigurationChangeEvent event) {
String key = event.getKey();
+
+ // use those constants from the event class is to have an overview of supported event keys
if((MavenConfigurationChangeEvent.P_DOWNLOAD_JAVADOC.equals(key) && mavenConfiguration.isDownloadJavaDoc())
|| (MavenConfigurationChangeEvent.P_DOWNLOAD_SOURCES.equals(key)
&& mavenConfiguration.isDownloadSources())) {
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java
index 3142724..fc1b4f8 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/DefaultClasspathManagerDelegate.java
@@ -89,12 +89,11 @@
IProgressMonitor monitor) throws CoreException {
ArtifactFilter scopeFilter;
- if(BuildPathManager.CLASSPATH_RUNTIME == kind) {
+ if(IClasspathManager.CLASSPATH_RUNTIME == kind) {
// ECLIPSE-33: runtime+provided scope
// ECLIPSE-85: adding system scope
scopeFilter = artifact -> BuildPathManager.SCOPE_FILTER_RUNTIME.include(artifact)
- || Artifact.SCOPE_PROVIDED.equals(artifact.getScope())
- || Artifact.SCOPE_SYSTEM.equals(artifact.getScope());
+ || Artifact.SCOPE_PROVIDED.equals(artifact.getScope()) || Artifact.SCOPE_SYSTEM.equals(artifact.getScope());
} else {
// ECLIPSE-33: test scope (already includes provided)
scopeFilter = BuildPathManager.SCOPE_FILTER_TEST;
diff --git a/org.eclipse.m2e.profiles.ui/src/org/eclipse/m2e/profiles/ui/internal/actions/ProfileSelectionHandler.java b/org.eclipse.m2e.profiles.ui/src/org/eclipse/m2e/profiles/ui/internal/actions/ProfileSelectionHandler.java
index 5b2dd14..bc50738 100644
--- a/org.eclipse.m2e.profiles.ui/src/org/eclipse/m2e/profiles/ui/internal/actions/ProfileSelectionHandler.java
+++ b/org.eclipse.m2e.profiles.ui/src/org/eclipse/m2e/profiles/ui/internal/actions/ProfileSelectionHandler.java
@@ -42,9 +42,9 @@
import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
-import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
@@ -125,7 +125,7 @@
List<ProfileSelection> sharedProfiles = getProfilesJob.getSharedProfiles();
Map<IMavenProjectFacade, List<ProfileData>> allProfiles = getProfilesJob.getAllProfiles();
final SelectProfilesDialog dialog = new SelectProfilesDialog(shell, facades, sharedProfiles);
- if(dialog.open() == Dialog.OK) {
+ if(dialog.open() == Window.OK) {
Job job = new UpdateProfilesJob(allProfiles, sharedProfiles, profileManager, dialog);
job.setRule(MavenPlugin.getProjectConfigurationManager().getRule());
job.schedule();