diff options
16 files changed, 53 insertions, 53 deletions
diff --git a/bundles/org.eclipse.osgi.compatibility.state/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.osgi.compatibility.state/.settings/org.eclipse.jdt.core.prefs index df8c0b940..1153de13f 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.osgi.compatibility.state/.settings/org.eclipse.jdt.core.prefs @@ -6,6 +6,12 @@ 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.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.codegen.unusedLocal=preserve @@ -26,6 +32,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod= 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=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=warning @@ -44,7 +51,9 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning 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.missingJavadocComments=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled @@ -61,13 +70,20 @@ org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignor 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.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=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=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 @@ -75,10 +91,12 @@ 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.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +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=warning org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning @@ -97,6 +115,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference= org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled 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=error org.eclipse.jdt.core.compiler.source=1.6 diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/ReadOnlyState.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/ReadOnlyState.java index be8a87637..880ef0e5f 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/ReadOnlyState.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/compatibility/state/ReadOnlyState.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2011 IBM Corporation and others. + * Copyright (c) 2004, 2013 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 @@ -157,7 +157,6 @@ public final class ReadOnlyState implements State { throw new UnsupportedOperationException(); } - @SuppressWarnings("rawtypes") public Dictionary[] getPlatformProperties() { return platformAdmin.getSystemState().getPlatformProperties(); } diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/MappedList.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/MappedList.java index a104a2434..6c9482788 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/MappedList.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/MappedList.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2013 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 @@ -20,8 +20,7 @@ import java.util.*; public class MappedList<K, V> { // the mapping with key -> Object[] mapping protected final HashMap<K, List<V>> internal = new HashMap<K, List<V>>(); - @SuppressWarnings("unchecked") - protected final List<V> empty = Collections.EMPTY_LIST; + protected final List<V> empty = Collections.<V> emptyList(); public void put(K key, V value) { List<V> existing = internal.get(key); diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java index d6dff31c0..e891188bc 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/module/ResolverImpl.java @@ -230,6 +230,7 @@ public class ResolverImpl implements Resolver { // Checks a bundle to make sure it is valid. If this method returns false for // a given bundle, then that bundle will not even be considered for resolution + @SuppressWarnings("unchecked") private boolean isResolvable(ResolverBundle bundle, Dictionary<Object, Object>[] platformProperties, Collection<ResolverBundle> hookDisabled) { BundleDescription bundleDesc = bundle.getBundleDescription(); @@ -439,7 +440,6 @@ public class ResolverImpl implements Resolver { currentlyResolved[i] = bundleMapping.get(resolvedBundles[i]); } // attempt to resolve all unresolved bundles - @SuppressWarnings("unchecked") Collection<ResolverBundle> hookDisabled = Collections.EMPTY_LIST; if (hook != null) { List<ResolverBundle> resolvableBundles = new ArrayList<ResolverBundle>(unresolvedBundles); @@ -475,7 +475,6 @@ public class ResolverImpl implements Resolver { // Now resolve the rest resolveBundles(toResolve.toArray(new ResolverBundle[toResolve.size()]), platformProperties, hookDisabled); - @SuppressWarnings("unchecked") Collection<ResolverBundle> optionalResolved = resolveOptional ? resolveOptionalConstraints(currentlyResolved) : Collections.EMPTY_LIST; ResolverHook current = hook; if (current != null) { diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java index ee6cdb91c..e460d9c91 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2013 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 @@ -1182,8 +1182,7 @@ public final class BundleDescriptionImpl extends BaseDescriptionImpl implements public List<BundleWire> getRequiredWires(String namespace) { if (!isInUse()) return null; - @SuppressWarnings("unchecked") - List<BundleWire> result = Collections.EMPTY_LIST; + List<BundleWire> result = Collections.<BundleWire> emptyList(); Map<String, List<StateWire>> wireMap = getWires(); if (namespace == null) { result = new ArrayList<BundleWire>(); @@ -1220,7 +1219,6 @@ public final class BundleDescriptionImpl extends BaseDescriptionImpl implements throw new UnsupportedOperationException(); } - public List<URL> findEntries(String path, String filePattern, int options) { return null; } diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java index 6946f4d7e..c0776d788 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/BundleSpecificationImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2011 IBM Corporation and others. + * Copyright (c) 2003, 2013 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 @@ -146,10 +146,9 @@ public class BundleSpecificationImpl extends VersionConstraintImpl implements Bu return filter.toString(); } - @SuppressWarnings("unchecked") @Override protected Map<String, Object> getInteralAttributes() { - return Collections.EMPTY_MAP; + return Collections.<String, Object> emptyMap(); } @Override diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericDescriptionImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericDescriptionImpl.java index 9e438f033..d6ce6d87b 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericDescriptionImpl.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericDescriptionImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2013 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 @@ -108,11 +108,10 @@ public class GenericDescriptionImpl extends BaseDescriptionImpl implements Gener return version instanceof Version ? (Version) version : super.getVersion(); } - @SuppressWarnings("unchecked") public Map<String, String> getDeclaredDirectives() { synchronized (this.monitor) { if (directives == null) - return Collections.EMPTY_MAP; + return Collections.<String, String> emptyMap(); return Collections.unmodifiableMap(directives); } } @@ -125,7 +124,7 @@ public class GenericDescriptionImpl extends BaseDescriptionImpl implements Gener String key = keys.nextElement(); Object value = attributes.get(key); if (value instanceof List) - value = Collections.unmodifiableList((List<Object>) value); + value = Collections.unmodifiableList((List<?>) value); result.put(key, value); } return Collections.unmodifiableMap(result); diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericSpecificationImpl.java index 1cddaf1ad..f53e941b9 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericSpecificationImpl.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/GenericSpecificationImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2013 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 @@ -184,11 +184,10 @@ public class GenericSpecificationImpl extends VersionConstraintImpl implements G return result; } - @SuppressWarnings("unchecked") @Override protected Map<String, Object> getInteralAttributes() { synchronized (this.monitor) { - return attributes == null ? Collections.EMPTY_MAP : new HashMap<String, Object>(attributes); + return attributes == null ? Collections.<String, Object> emptyMap() : new HashMap<String, Object>(attributes); } } diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/HostSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/HostSpecificationImpl.java index 2f6d77841..2b2f2f6ff 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/HostSpecificationImpl.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/HostSpecificationImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2011 IBM Corporation and others. + * Copyright (c) 2003, 2013 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 @@ -161,10 +161,9 @@ public class HostSpecificationImpl extends VersionConstraintImpl implements Host return filter.toString(); } - @SuppressWarnings("unchecked") @Override protected Map<String, Object> getInteralAttributes() { - return Collections.EMPTY_MAP; + return Collections.<String, Object> emptyMap(); } @Override diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java index 43971b940..a81392533 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/ImportPackageSpecificationImpl.java @@ -249,10 +249,9 @@ public class ImportPackageSpecificationImpl extends VersionConstraintImpl implem return filter.toString(); } - @SuppressWarnings("unchecked") @Override protected Map<String, Object> getInteralAttributes() { - return Collections.EMPTY_MAP; + return Collections.<String, Object> emptyMap(); } @Override diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeDescriptionImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeDescriptionImpl.java index 1bb587a8b..fec85857c 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeDescriptionImpl.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeDescriptionImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 IBM Corporation and others. + * Copyright (c) 2007, 2013 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 @@ -207,13 +207,11 @@ public class NativeCodeDescriptionImpl extends BaseDescriptionImpl implements Na this.supplier = supplier; } - @SuppressWarnings("unchecked") public Map<String, String> getDeclaredDirectives() { - return Collections.EMPTY_MAP; + return Collections.<String, String> emptyMap(); } - @SuppressWarnings("unchecked") public Map<String, Object> getDeclaredAttributes() { - return Collections.EMPTY_MAP; + return Collections.<String, Object> emptyMap(); } } diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java index 3e117fa94..f15e47ae4 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java @@ -49,6 +49,7 @@ public class NativeCodeSpecificationImpl extends VersionConstraintImpl implement } } + @SuppressWarnings("unchecked") public boolean isSatisfiedBy(BaseDescription supplier) { if (!(supplier instanceof NativeCodeDescription)) return false; @@ -179,14 +180,12 @@ public class NativeCodeSpecificationImpl extends VersionConstraintImpl implement return sb.toString(); } - @SuppressWarnings("unchecked") protected Map<String, String> getInternalDirectives() { - return Collections.EMPTY_MAP; + return Collections.<String, String> emptyMap(); } - @SuppressWarnings("unchecked") protected Map<String, Object> getInteralAttributes() { - return Collections.EMPTY_MAP; + return Collections.<String, Object> emptyMap(); } @Override diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateImpl.java index a3368c274..5972e4363 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateImpl.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateImpl.java @@ -979,8 +979,7 @@ public abstract class StateImpl implements State { } } - @SuppressWarnings("rawtypes") - public Dictionary[] getPlatformProperties() { + public Dictionary<Object, Object>[] getPlatformProperties() { return platformProperties; } diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateObjectFactoryImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateObjectFactoryImpl.java index 2c69a98b4..a80ae2af2 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateObjectFactoryImpl.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateObjectFactoryImpl.java @@ -495,12 +495,11 @@ public class StateObjectFactoryImpl implements StateObjectFactory { writer.saveStateDeprecated((StateImpl) state, stream); } - @SuppressWarnings("unchecked") public List<BundleSpecification> createBundleSpecifications(String declaration) { try { ManifestElement[] elements = ManifestElement.parseHeader(Constants.REQUIRE_BUNDLE, declaration); if (elements == null) - return Collections.EMPTY_LIST; + return Collections.<BundleSpecification> emptyList(); List<BundleSpecification> result = new ArrayList<BundleSpecification>(elements.length); for (ManifestElement element : elements) result.add(StateBuilder.createRequiredBundle(element)); @@ -510,12 +509,11 @@ public class StateObjectFactoryImpl implements StateObjectFactory { } } - @SuppressWarnings("unchecked") public List<HostSpecification> createHostSpecifications(String declaration) { try { ManifestElement[] elements = ManifestElement.parseHeader(Constants.FRAGMENT_HOST, declaration); if (elements == null) - return Collections.EMPTY_LIST; + return Collections.<HostSpecification> emptyList(); List<HostSpecification> result = new ArrayList<HostSpecification>(elements.length); for (ManifestElement element : elements) result.add(StateBuilder.createHostSpecification(element, null)); @@ -525,12 +523,11 @@ public class StateObjectFactoryImpl implements StateObjectFactory { } } - @SuppressWarnings("unchecked") public List<ImportPackageSpecification> createImportPackageSpecifications(String declaration) { try { ManifestElement[] elements = ManifestElement.parseHeader(Constants.IMPORT_PACKAGE, declaration); if (elements == null) - return Collections.EMPTY_LIST; + return Collections.<ImportPackageSpecification> emptyList(); List<ImportPackageSpecification> result = new ArrayList<ImportPackageSpecification>(elements.length); for (ManifestElement element : elements) StateBuilder.addImportPackages(element, result, 2, false); @@ -540,36 +537,33 @@ public class StateObjectFactoryImpl implements StateObjectFactory { } } - @SuppressWarnings("unchecked") public List<GenericDescription> createGenericDescriptions(String declaration) { try { ManifestElement[] elements = ManifestElement.parseHeader(Constants.PROVIDE_CAPABILITY, declaration); if (elements == null) - return Collections.EMPTY_LIST; + return Collections.<GenericDescription> emptyList(); return StateBuilder.createOSGiCapabilities(elements, new ArrayList<GenericDescription>(elements.length), (Integer) null); } catch (BundleException e) { throw (IllegalArgumentException) new IllegalArgumentException("Declaration is invalid: " + declaration).initCause(e); //$NON-NLS-1$ } } - @SuppressWarnings("unchecked") public List<GenericSpecification> createGenericSpecifications(String declaration) { try { ManifestElement[] elements = ManifestElement.parseHeader(Constants.REQUIRE_CAPABILITY, declaration); if (elements == null) - return Collections.EMPTY_LIST; + return Collections.<GenericSpecification> emptyList(); return StateBuilder.createOSGiRequires(elements, new ArrayList<GenericSpecification>(elements.length)); } catch (BundleException e) { throw (IllegalArgumentException) new IllegalArgumentException("Declaration is invalid: " + declaration).initCause(e); //$NON-NLS-1$ } } - @SuppressWarnings("unchecked") public List<ExportPackageDescription> createExportPackageDescriptions(String declaration) { try { ManifestElement[] elements = ManifestElement.parseHeader(Constants.IMPORT_PACKAGE, declaration); if (elements == null) - return Collections.EMPTY_LIST; + return Collections.<ExportPackageDescription> emptyList(); List<ExportPackageDescription> result = new ArrayList<ExportPackageDescription>(elements.length); for (ManifestElement element : elements) StateBuilder.addExportPackages(element, result, false); diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateReader.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateReader.java index f121b267a..149c0cb7d 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateReader.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/StateReader.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2013 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 @@ -255,6 +255,7 @@ final class StateReader { return result; } + @SuppressWarnings("unchecked") private BundleDescriptionImpl readBundleDescriptionLazyData(DataInputStream in, int skip) throws IOException { if (skip > 0) in.skipBytes(skip); @@ -592,6 +593,7 @@ final class StateReader { return result; } + @SuppressWarnings("unchecked") private GenericDescription readGenericDescription(DataInputStream in) throws IOException { byte tag = readTag(in); if (tag == NULL) @@ -613,6 +615,7 @@ final class StateReader { } } result.setAttributes(attrs); + @SuppressWarnings("rawtypes") Map directives = readMap(in); if (directives != null) result.setDirectives(directives); diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java index 9860c70c9..d2371a12d 100644 --- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java +++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java @@ -135,12 +135,10 @@ abstract class VersionConstraintImpl implements VersionConstraint { return namespace; } - @SuppressWarnings("unchecked") public Map<String, String> getDirectives() { return Collections.unmodifiableMap(getInternalDirectives()); } - @SuppressWarnings("unchecked") public Map<String, Object> getAttributes() { return Collections.unmodifiableMap(getInteralAttributes()); } |