diff options
| author | Andrey Loskutov | 2015-04-03 22:12:03 +0000 |
|---|---|---|
| committer | Andrey Loskutov | 2015-04-04 07:32:47 +0000 |
| commit | 3a2fa1fad22a05ba57dcc425cf4dc199eb53e85a (patch) | |
| tree | d8ae4d4390dc6d76b1dbaa88f37b0ec8c0b81e29 | |
| parent | 03e73b9653ccbc060da30b8f45455d06e23c7517 (diff) | |
| download | eclipse.platform.ui-3a2fa1fad22a05ba57dcc425cf4dc199eb53e85a.tar.gz eclipse.platform.ui-3a2fa1fad22a05ba57dcc425cf4dc199eb53e85a.tar.xz eclipse.platform.ui-3a2fa1fad22a05ba57dcc425cf4dc199eb53e85a.zip | |
Bug 418661 - [Metadata] Get rid of compile warnings in platform projects
in official build - part 1
Cleaned up and updated to Java 7 org.eclipse.e4.ui.services
Change-Id: I08480c5c7a0b88bf615bad59e854bb43de68b40b
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
8 files changed, 130 insertions, 52 deletions
diff --git a/bundles/org.eclipse.e4.ui.services/.classpath b/bundles/org.eclipse.e4.ui.services/.classpath index 4c62a8048e6..e8ea977a694 100644 --- a/bundles/org.eclipse.e4.ui.services/.classpath +++ b/bundles/org.eclipse.e4.ui.services/.classpath @@ -2,6 +2,6 @@ <classpath> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/bundles/org.eclipse.e4.ui.services/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.ui.services/.settings/org.eclipse.jdt.core.prefs index 44829992bf8..98ad7900868 100644 --- a/bundles/org.eclipse.e4.ui.services/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.e4.ui.services/.settings/org.eclipse.jdt.core.prefs @@ -1,10 +1,104 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 diff --git a/bundles/org.eclipse.e4.ui.services/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.services/META-INF/MANIFEST.MF index 595ec622193..cd380873084 100644 --- a/bundles/org.eclipse.e4.ui.services/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.e4.ui.services/META-INF/MANIFEST.MF @@ -6,7 +6,7 @@ Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Import-Package: javax.annotation;version="1.0.0", javax.inject;version="1.0.0", org.osgi.framework;version="1.3.0", diff --git a/bundles/org.eclipse.e4.ui.services/build.properties b/bundles/org.eclipse.e4.ui.services/build.properties index 8d00ee80e0e..d69135ef744 100644 --- a/bundles/org.eclipse.e4.ui.services/build.properties +++ b/bundles/org.eclipse.e4.ui.services/build.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2013 IBM Corporation and others. +# Copyright (c) 2015 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -16,3 +16,4 @@ bin.includes = META-INF/,\ about.html source.. = src/ src.includes = about.html +jre.compilation.profile = JavaSE-1.7 diff --git a/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/internal/services/Activator.java b/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/internal/services/Activator.java index 68b253d6533..5a3de308e8d 100644 --- a/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/internal/services/Activator.java +++ b/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/internal/services/Activator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 IBM Corporation and others. + * Copyright (c) 2009, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,7 +12,6 @@ package org.eclipse.e4.ui.internal.services; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; import org.osgi.service.event.EventAdmin; import org.osgi.util.tracker.ServiceTracker; @@ -22,10 +21,7 @@ public class Activator implements BundleActivator { private static Activator singleton; - private ServiceRegistration contextServiceReg; - private ServiceRegistration handlerServiceReg; - - private ServiceTracker eventAdminTracker; + private ServiceTracker<EventAdmin, EventAdmin> eventAdminTracker; private BundleContext bundleContext; /* @@ -47,23 +43,14 @@ public class Activator implements BundleActivator { */ public EventAdmin getEventAdmin() { if (eventAdminTracker == null) { - eventAdminTracker = new ServiceTracker(bundleContext, EventAdmin.class.getName(), null); + eventAdminTracker = new ServiceTracker<>(bundleContext, EventAdmin.class, null); eventAdminTracker.open(); } - return (EventAdmin) eventAdminTracker.getService(); + return eventAdminTracker.getService(); } @Override public void stop(BundleContext context) throws Exception { - if (contextServiceReg != null) { - contextServiceReg.unregister(); - contextServiceReg = null; - } - if (handlerServiceReg != null) { - handlerServiceReg.unregister(); - handlerServiceReg = null; - } - if (eventAdminTracker != null) { eventAdminTracker.close(); eventAdminTracker = null; diff --git a/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/internal/services/ActiveContextsFunction.java b/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/internal/services/ActiveContextsFunction.java index b0f192ff4af..293a8e0c9d3 100644 --- a/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/internal/services/ActiveContextsFunction.java +++ b/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/internal/services/ActiveContextsFunction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2013 IBM Corporation and others. + * Copyright (c) 2009, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -24,9 +24,9 @@ public class ActiveContextsFunction extends ContextFunction { IEclipseContext current = context.getActiveLeaf(); //2 form an answer going up boolean inDialog = false; - Set<String> rc = new HashSet<String>(); + Set<Object> rc = new HashSet<>(); while (current != null) { - LinkedList<String> locals = (LinkedList<String>) current.getLocal(ContextContextService.LOCAL_CONTEXTS); + LinkedList<?> locals = (LinkedList<?>) current.getLocal(ContextContextService.LOCAL_CONTEXTS); if (locals != null) { if (!inDialog || !locals.contains("org.eclipse.ui.contexts.window")) { rc.addAll(locals); diff --git a/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/internal/services/ContextContextService.java b/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/internal/services/ContextContextService.java index fda2415ba1a..58a5925e9ee 100644 --- a/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/internal/services/ContextContextService.java +++ b/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/internal/services/ContextContextService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 IBM Corporation and others. + * Copyright (c) 2009, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -28,14 +28,13 @@ public class ContextContextService implements EContextService { private IEclipseContext eclipseContext; private ContextManager contextManager; - private boolean deferUpdates = false; + private boolean deferUpdates; - private int cachingRef = 0; + private int cachingRef; public ContextContextService(IEclipseContext context) { eclipseContext = context; - contextManager = (ContextManager) context.get(ContextManager.class - .getName()); + contextManager = context.get(ContextManager.class); } @Override @@ -44,8 +43,8 @@ public class ContextContextService implements EContextService { deferActivateContext(id); return; } - LinkedList<String> locals = (LinkedList<String>) eclipseContext - .getLocal(LOCAL_CONTEXTS); + @SuppressWarnings("unchecked") + LinkedList<String> locals = (LinkedList<String>) eclipseContext.getLocal(LOCAL_CONTEXTS); if (locals == null) { locals = new LinkedList<String>(); locals.add(id); @@ -89,8 +88,8 @@ public class ContextContextService implements EContextService { } private void deferActivateContext(String id) { - LinkedList<String> locals = (LinkedList<String>) eclipseContext - .getLocal(DEFERED_ACTIVATES); + @SuppressWarnings("unchecked") + LinkedList<String> locals = (LinkedList<String>) eclipseContext.getLocal(DEFERED_ACTIVATES); if (locals == null) { locals = new LinkedList<String>(); eclipseContext.set(DEFERED_ACTIVATES, locals); @@ -105,24 +104,23 @@ public class ContextContextService implements EContextService { } deferUpdates = false; - LinkedList<String> locals = (LinkedList<String>) eclipseContext - .getLocal(LOCAL_CONTEXTS); + @SuppressWarnings("unchecked") + LinkedList<String> locals = (LinkedList<String>) eclipseContext.getLocal(LOCAL_CONTEXTS); if (locals == null) { locals = new LinkedList<String>(); } - LinkedList<String> activates = (LinkedList<String>) eclipseContext - .getLocal(DEFERED_ACTIVATES); + @SuppressWarnings("unchecked") + LinkedList<String> activates = (LinkedList<String>) eclipseContext.getLocal(DEFERED_ACTIVATES); if (activates != null) { eclipseContext.remove(DEFERED_ACTIVATES); for (String id : activates) { locals.add(id); } } - LinkedList<String> deactivates = (LinkedList<String>) eclipseContext - .getLocal(DEFERED_DEACTIVATES); + LinkedList<?> deactivates = (LinkedList<?>) eclipseContext.getLocal(DEFERED_DEACTIVATES); if (deactivates != null) { eclipseContext.remove(DEFERED_DEACTIVATES); - for (String id : deactivates) { + for (Object id : deactivates) { locals.remove(id); } } @@ -135,8 +133,7 @@ public class ContextContextService implements EContextService { deferDeactivateContext(id); return; } - LinkedList<String> locals = (LinkedList<String>) eclipseContext - .getLocal(LOCAL_CONTEXTS); + LinkedList<?> locals = (LinkedList<?>) eclipseContext.getLocal(LOCAL_CONTEXTS); if (locals != null && locals.remove(id)) { boolean contained = locals.contains(id); if (!contained) { @@ -147,10 +144,10 @@ public class ContextContextService implements EContextService { } private void deferDeactivateContext(String id) { - LinkedList<String> locals = (LinkedList<String>) eclipseContext - .getLocal(DEFERED_DEACTIVATES); + @SuppressWarnings("unchecked") + LinkedList<String> locals = (LinkedList<String>) eclipseContext.getLocal(DEFERED_DEACTIVATES); if (locals == null) { - locals = new LinkedList<String>(); + locals = new LinkedList<>(); eclipseContext.set(DEFERED_DEACTIVATES, locals); } locals.add(id); @@ -158,8 +155,8 @@ public class ContextContextService implements EContextService { @Override public Collection<String> getActiveContextIds() { - Set<String> set = (Set<String>) eclipseContext - .get(IServiceConstants.ACTIVE_CONTEXTS); + @SuppressWarnings("unchecked") + Set<String> set = (Set<String>) eclipseContext.get(IServiceConstants.ACTIVE_CONTEXTS); if (set != null) { contextManager.setActiveContextIds(set); } diff --git a/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/services/ContextServiceAddon.java b/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/services/ContextServiceAddon.java index 7d22eb70d79..c26868653c0 100644 --- a/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/services/ContextServiceAddon.java +++ b/bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/services/ContextServiceAddon.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2013 IBM Corporation and others. + * Copyright (c) 2009, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,7 +11,6 @@ package org.eclipse.e4.ui.services; import java.util.Collections; - import java.util.Set; import javax.annotation.PostConstruct; import org.eclipse.core.commands.contexts.ContextManager; @@ -44,7 +43,7 @@ public final class ContextServiceAddon { if (manager != null) { Object s = context.get(IServiceConstants.ACTIVE_CONTEXTS); if (s instanceof Set) { - manager.setActiveContextIds((Set) s); + manager.setActiveContextIds((Set<?>) s); } else { manager.setActiveContextIds(Collections.EMPTY_SET); } |
