From d87e26787c30b6122baf0b68aee0068ee0380305 Mon Sep 17 00:00:00 2001 From: Alexander Kurtakov Date: Wed, 13 Dec 2017 16:16:54 +0200 Subject: Bug 528712 - Move launcher BREE to 1.7 Added missing Override annotations and removed redundant types. Change-Id: I526e1b892c747710a9950070ba1da8745258cdec Signed-off-by: Alexander Kurtakov --- bundles/org.eclipse.equinox.launcher/.classpath | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 64 ++++++++++++++++++++-- .../META-INF/MANIFEST.MF | 4 +- bundles/org.eclipse.equinox.launcher/pom.xml | 2 +- .../src/org/eclipse/equinox/launcher/Main.java | 27 ++++++--- .../org/eclipse/equinox/launcher/WebStartMain.java | 13 +++-- 6 files changed, 90 insertions(+), 22 deletions(-) (limited to 'bundles/org.eclipse.equinox.launcher') diff --git a/bundles/org.eclipse.equinox.launcher/.classpath b/bundles/org.eclipse.equinox.launcher/.classpath index ad32c83a7..098194ca4 100644 --- a/bundles/org.eclipse.equinox.launcher/.classpath +++ b/bundles/org.eclipse.equinox.launcher/.classpath @@ -1,6 +1,6 @@ - + diff --git a/bundles/org.eclipse.equinox.launcher/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.launcher/.settings/org.eclipse.jdt.core.prefs index c6687b05c..9fab336de 100644 --- a/bundles/org.eclipse.equinox.launcher/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.equinox.launcher/.settings/org.eclipse.jdt.core.prefs @@ -6,29 +6,45 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch org.eclipse.jdt.core.circularClasspath=error org.eclipse.jdt.core.classpath.exclusionPatterns=enabled org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +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.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +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.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +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.doc.comment.support=enabled org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000 +org.eclipse.jdt.core.compiler.problem.APILeak=warning 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=enabled org.eclipse.jdt.core.compiler.problem.discouragedReference=error org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +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=warning org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore 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=ignore org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning @@ -36,41 +52,79 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=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=warning +org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=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.pessimisticNullAnalysisForFreeTypeVariables=warning org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +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=warning +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=warning +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info 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=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedImport=error +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=enabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error +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.6 +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_enum_constant=16 diff --git a/bundles/org.eclipse.equinox.launcher/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.launcher/META-INF/MANIFEST.MF index 2933964fe..d8dcdf12f 100644 --- a/bundles/org.eclipse.equinox.launcher/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.launcher/META-INF/MANIFEST.MF @@ -2,11 +2,11 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.equinox.launcher;singleton:=true -Bundle-Version: 1.4.0.qualifier +Bundle-Version: 1.5.0.qualifier Main-Class: org.eclipse.equinox.launcher.Main Bundle-ClassPath: . Bundle-Vendor: %providerName -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-Localization: launcher Export-Package: org.eclipse.core.launcher;x-internal:=true, org.eclipse.equinox.internal.launcher;x-internal:=true, diff --git a/bundles/org.eclipse.equinox.launcher/pom.xml b/bundles/org.eclipse.equinox.launcher/pom.xml index 3eca62153..bce857531 100644 --- a/bundles/org.eclipse.equinox.launcher/pom.xml +++ b/bundles/org.eclipse.equinox.launcher/pom.xml @@ -19,6 +19,6 @@ org.eclipse.equinox org.eclipse.equinox.launcher - 1.4.0-SNAPSHOT + 1.5.0-SNAPSHOT eclipse-plugin diff --git a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java index c9d07f914..dff5953c2 100644 --- a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java +++ b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 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 @@ -111,6 +111,7 @@ public class Main { protected boolean splashDown = false; public final class SplashHandler extends Thread { + @Override public void run() { takeDownSplash(); } @@ -796,7 +797,7 @@ public class Main { protected String[] getArrayFromList(String prop) { if (prop == null || prop.trim().equals("")) //$NON-NLS-1$ return new String[0]; - Vector list = new Vector(); + Vector list = new Vector<>(); StringTokenizer tokens = new StringTokenizer(prop, ","); //$NON-NLS-1$ while (tokens.hasMoreTokens()) { String token = tokens.nextToken().trim(); @@ -815,7 +816,7 @@ public class Main { * @exception MalformedURLException if a problem occurs computing the class path */ private URL[] getDevPath(URL base) throws IOException { - ArrayList result = new ArrayList(5); + ArrayList result = new ArrayList<>(5); if (inDevelopmentMode) addDevEntries(base, result, OSGI); //The jars from the base always need to be added, even when running in dev mode (bug 46772) @@ -848,7 +849,7 @@ public class Main { private void readFrameworkExtensions(URL base, ArrayList result) throws IOException { String[] extensions = getArrayFromList(System.getProperties().getProperty(PROP_EXTENSIONS)); String parent = new File(base.getFile()).getParent().toString(); - ArrayList extensionResults = new ArrayList(extensions.length); + ArrayList extensionResults = new ArrayList<>(extensions.length); for (int i = 0; i < extensions.length; i++) { //Search the extension relatively to the osgi plugin String path = searchForBundle(extensions[i], parent); @@ -1046,7 +1047,7 @@ public class Main { if (candidates == null) return null; - ArrayList matches = new ArrayList(2); + ArrayList matches = new ArrayList<>(2); for (int i = 0; i < candidates.length; i++) { if (isMatchingCandidate(target, candidates[i], root)) matches.add(candidates[i]); @@ -1445,7 +1446,7 @@ public class Main { * @param argString the arguments string */ public static void main(String argString) { - Vector list = new Vector(5); + Vector list = new Vector<>(5); for (StringTokenizer tokens = new StringTokenizer(argString, " "); tokens.hasMoreElements();) //$NON-NLS-1$ list.addElement(tokens.nextToken()); main(list.toArray(new String[list.size()])); @@ -2242,7 +2243,7 @@ public class Main { String splashPath = System.getProperty(PROP_SPLASHPATH); if (splashPath != null) { String[] entries = getArrayFromList(splashPath); - ArrayList path = new ArrayList(entries.length); + ArrayList path = new ArrayList<>(entries.length); for (int i = 0; i < entries.length; i++) { String entry = resolve(entries[i]); if (entry != null && entry.startsWith(FILE_SCHEME)) { @@ -2429,7 +2430,7 @@ public class Main { private static String[] buildNLVariants(String locale) { //build list of suffixes for loading resource bundles String nl = locale; - ArrayList result = new ArrayList(4); + ArrayList result = new ArrayList<>(4); int lastSeparator; while (true) { result.add("nl" + File.separatorChar + nl.replace('_', File.separatorChar) + File.separatorChar + SPLASH_IMAGE); //$NON-NLS-1$ @@ -2749,22 +2750,27 @@ public class Main { private static final long serialVersionUID = 3258131349494708277L; // A simple PermissionCollection that only has AllPermission + @Override public void add(Permission permission) { //no adding to this policy } + @Override public boolean implies(Permission permission) { return true; } + @Override public Enumeration elements() { return new Enumeration() { int cur = 0; + @Override public boolean hasMoreElements() { return cur < 1; } + @Override public Permission nextElement() { if (cur == 0) { cur = 1; @@ -2777,24 +2783,28 @@ public class Main { }; } + @Override public PermissionCollection getPermissions(CodeSource codesource) { if (contains(codesource)) return allPermissions; return policy == null ? allPermissions : policy.getPermissions(codesource); } + @Override public PermissionCollection getPermissions(ProtectionDomain domain) { if (contains(domain.getCodeSource())) return allPermissions; return policy == null ? allPermissions : policy.getPermissions(domain); } + @Override public boolean implies(ProtectionDomain domain, Permission permission) { if (contains(domain.getCodeSource())) return true; return policy == null ? true : policy.implies(domain, permission); } + @Override public void refresh() { if (policy != null) policy.refresh(); @@ -2830,6 +2840,7 @@ public class Main { super(urls, parent, factory); } + @Override protected String findLibrary(String name) { if (extensionPaths == null) return super.findLibrary(name); diff --git a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/WebStartMain.java b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/WebStartMain.java index 3d425b8fe..9d568508f 100644 --- a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/WebStartMain.java +++ b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/WebStartMain.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2016 IBM Corporation and others. + * Copyright (c) 2005, 2017 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 @@ -65,6 +65,7 @@ public class WebStartMain extends Main { System.getProperties().put(PROP_OSGI_BUNDLES, DEFAULT_OSGI_BUNDLES); } + @Override protected void basicRun(String[] args) throws Exception { setDefaultBundles(); initializeBundleListStructure(); @@ -79,6 +80,7 @@ public class WebStartMain extends Main { super.basicRun(args); } + @Override protected void beforeFwkInvocation() { // set the check config option so we pick up modified bundle jars (bug 152825) if (System.getProperty(PROP_CHECK_CONFIG) == null) @@ -99,6 +101,7 @@ public class WebStartMain extends Main { * Find the target bundle among all the bundles that are on the classpath. * The start parameter is not used in this context */ + @Override protected String searchFor(final String target, String start) { List matches = allBundles.get(target); if (matches == null) @@ -154,7 +157,7 @@ public class WebStartMain extends Main { * Get all the bundles available on the webstart classpath */ private void discoverBundles() { - allBundles = new HashMap>(); + allBundles = new HashMap<>(); try { Enumeration resources = WebStartMain.class.getClassLoader().getResources(JarFile.MANIFEST_NAME); while (resources.hasMoreElements()) { @@ -163,7 +166,7 @@ public class WebStartMain extends Main { continue; List matching = allBundles.get(found.bsn); if (matching == null) { - matching = new ArrayList(1); + matching = new ArrayList<>(1); allBundles.put(found.bsn, matching); } matching.add(found); @@ -243,11 +246,11 @@ public class WebStartMain extends Main { //In webstart the bundles list can only contain bundle names with or without a version. String prop = System.getProperty(PROP_OSGI_BUNDLES); if (prop == null || prop.trim().equals("")) { //$NON-NLS-1$ - bundleList = new ArrayList(0); + bundleList = new ArrayList<>(0); return; } - bundleList = new ArrayList(10); + bundleList = new ArrayList<>(10); StringTokenizer tokens = new StringTokenizer(prop, ","); //$NON-NLS-1$ while (tokens.hasMoreTokens()) { String token = tokens.nextToken().trim(); -- cgit v1.2.3