Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Daniel2013-12-10 05:27:39 -0500
committerKrzysztof Daniel2013-12-10 05:27:39 -0500
commitac04b8c07dd5eab87eeb337bdbea929d6e1dd247 (patch)
tree52f588b1eba9b9203b9bf539b6d52ed861810723 /bundles/org.eclipse.equinox.p2.tests
parenta2344e5ad39e041ee5e822d8bddc4a71bdcd3c03 (diff)
downloadrt.equinox.p2-ac04b8c07dd5eab87eeb337bdbea929d6e1dd247.tar.gz
rt.equinox.p2-ac04b8c07dd5eab87eeb337bdbea929d6e1dd247.tar.xz
rt.equinox.p2-ac04b8c07dd5eab87eeb337bdbea929d6e1dd247.zip
bug 423628 - False positives warnings in the official build.I20131211-0800I20131210-2000I20131210-0800
False positives are caused by projects settings being different than build settings. Typical example is that project is configured to warn about local variable hiding a field, and suppression is added, but the regular releng build is not configured to warn, and it finds unnecessary suppression. I have did following things: * fixed warnings that I was able to fix (renamed variables, added generics, comments, etc, etc). * reduced the number of warnings in tests * commented warnings that must not be suppresed in the workspace unless we want "Unnecessary @SuppressWarnings" at build time. Change-Id: Iab2c962e5c331eab170b5f6e08d9bb29d05f0cc4
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/.settings/org.eclipse.jdt.core.prefs28
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/DirectorApplicationTest.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/EquinoxExecutableActionTest.java62
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/BundlesTxtTest.java6
4 files changed, 60 insertions, 37 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.tests/.settings/org.eclipse.jdt.core.prefs
index f6678b8de..24cdeed50 100644
--- a/bundles/org.eclipse.equinox.p2.tests/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.tests/.settings/org.eclipse.jdt.core.prefs
@@ -8,6 +8,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
@@ -28,6 +34,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=
org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
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
@@ -35,6 +42,7 @@ 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
@@ -45,7 +53,9 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
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.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
@@ -55,25 +65,39 @@ 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.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
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=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+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=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
+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
@@ -82,15 +106,17 @@ 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.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=error
+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=error
org.eclipse.jdt.core.compiler.source=1.6
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/DirectorApplicationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/DirectorApplicationTest.java
index 62f7ea21e..c00ab4795 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/DirectorApplicationTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/director/DirectorApplicationTest.java
@@ -721,7 +721,6 @@ public class DirectorApplicationTest extends AbstractProvisioningTest {
delete(destinationRepo);
}
- @SuppressWarnings("unused")
private final class DummyCertificate extends Certificate {
DummyCertificate(String type) {
super(type);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/EquinoxExecutableActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/EquinoxExecutableActionTest.java
index b01672482..3f42f4fb7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/EquinoxExecutableActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/EquinoxExecutableActionTest.java
@@ -102,38 +102,36 @@ public class EquinoxExecutableActionTest extends ActionTest {
debug("Completed EquinoxExecutableActionTest " + idBase + " test."); //$NON-NLS-1$ //$NON-NLS-2$
}
- @SuppressWarnings("hiding")
- private void verifyResults(String idBase, String configSpec) {
+ private void verifyResults(String idBase, String confSpec) {
ArrayList iuList = new ArrayList(publisherResult.getIUs(null, IPublisherResult.ROOT));
- verifyExecIU(iuList, idBase, configSpec);
- verifyEclipseIU(iuList, idBase, configSpec);
- verifyCU(iuList, idBase, configSpec);
- if (configSpec.contains("macosx"))
+ verifyExecIU(iuList, idBase, confSpec);
+ verifyEclipseIU(iuList, idBase, confSpec);
+ verifyCU(iuList, idBase, confSpec);
+ if (confSpec.contains("macosx"))
assertTrue(iuList.size() == 4);
else
assertTrue(iuList.size() == 3);
}
- @SuppressWarnings("hiding")
- private void verifyCU(ArrayList iuList, String idBase, String configSpec) {
- String[] config = AbstractPublisherAction.parseConfigSpec(configSpec);
- String ws = config[0];
- String os = config[1];
- String arch = config[2];
+ private void verifyCU(ArrayList iuList, String idBase, String confSpec) {
+ String[] config = AbstractPublisherAction.parseConfigSpec(confSpec);
+ String _ws = config[0];
+ String _os = config[1];
+ String _arch = config[2];
for (int i = 0; i < iuList.size(); i++) {
IInstallableUnit possibleEclipse = (IInstallableUnit) iuList.get(i);
- if (possibleEclipse.getId().equals(flavorArg + idBase + ".executable." + configSpec)) {//$NON-NLS-1$
+ if (possibleEclipse.getId().equals(flavorArg + idBase + ".executable." + confSpec)) {//$NON-NLS-1$
IInstallableUnitFragment fragment = (IInstallableUnitFragment) iuList.get(i);
Collection<IProvidedCapability> providedCapability = fragment.getProvidedCapabilities();
- verifyProvidedCapability(providedCapability, IInstallableUnit.NAMESPACE_IU_ID, flavorArg + idBase + ".executable." + configSpec, version); //$NON-NLS-1$
+ verifyProvidedCapability(providedCapability, IInstallableUnit.NAMESPACE_IU_ID, flavorArg + idBase + ".executable." + confSpec, version); //$NON-NLS-1$
assertTrue(providedCapability.size() == 1);
Collection<IRequirement> requiredCapability = fragment.getHost();
- verifyRequiredCapability(requiredCapability, IInstallableUnit.NAMESPACE_IU_ID, idBase + ".executable." + configSpec, new VersionRange(version, true, version, true)); //$NON-NLS-1$
+ verifyRequiredCapability(requiredCapability, IInstallableUnit.NAMESPACE_IU_ID, idBase + ".executable." + confSpec, new VersionRange(version, true, version, true)); //$NON-NLS-1$
assertTrue(requiredCapability.size() == 1);
- assertTrue(fragment.getFilter().getParameters()[0].toString().indexOf("(osgi.ws=" + ws + ")") != -1);
- assertTrue(fragment.getFilter().getParameters()[0].toString().indexOf("(osgi.os=" + os + ")") != -1);
- assertTrue(fragment.getFilter().getParameters()[0].toString().indexOf("(osgi.arch=" + arch + ")") != -1);
+ assertTrue(fragment.getFilter().getParameters()[0].toString().indexOf("(osgi.ws=" + _ws + ")") != -1);
+ assertTrue(fragment.getFilter().getParameters()[0].toString().indexOf("(osgi.os=" + _os + ")") != -1);
+ assertTrue(fragment.getFilter().getParameters()[0].toString().indexOf("(osgi.arch=" + _arch + ")") != -1);
assertTrue(fragment.getProperty("org.eclipse.equinox.p2.type.fragment").equals("true")); //$NON-NLS-1$ //$NON-NLS-2$
return;//pass
}
@@ -141,14 +139,13 @@ public class EquinoxExecutableActionTest extends ActionTest {
fail();
}
- @SuppressWarnings("hiding")
- private void verifyEclipseIU(ArrayList iuList, String idBase, String configSpec) {
+ private void verifyEclipseIU(ArrayList iuList, String idBase, String confSpec) {
for (int i = 0; i < iuList.size(); i++) {
IInstallableUnit possibleEclipse = (IInstallableUnit) iuList.get(i);
- if (possibleEclipse.getId().equals((idBase + ".executable." + configSpec + "." + EXECUTABLE_NAME))) { //$NON-NLS-1$//$NON-NLS-2$
+ if (possibleEclipse.getId().equals((idBase + ".executable." + confSpec + "." + EXECUTABLE_NAME))) { //$NON-NLS-1$//$NON-NLS-2$
assertTrue(possibleEclipse.getVersion().equals(version));
Collection<IProvidedCapability> providedCapability = possibleEclipse.getProvidedCapabilities();
- verifyProvidedCapability(providedCapability, IInstallableUnit.NAMESPACE_IU_ID, idBase + ".executable." + configSpec + "." + EXECUTABLE_NAME, version); //$NON-NLS-1$ //$NON-NLS-2$
+ verifyProvidedCapability(providedCapability, IInstallableUnit.NAMESPACE_IU_ID, idBase + ".executable." + confSpec + "." + EXECUTABLE_NAME, version); //$NON-NLS-1$ //$NON-NLS-2$
assertTrue(providedCapability.size() == 1);
Collection<IRequirement> req = possibleEclipse.getRequirements();
assertTrue(req.size() == 0);
@@ -158,28 +155,27 @@ public class EquinoxExecutableActionTest extends ActionTest {
fail();
}
- @SuppressWarnings("hiding")
- private void verifyExecIU(ArrayList iuList, String idBase, String configSpec) {
- String[] config = AbstractPublisherAction.parseConfigSpec(configSpec);
- String ws = config[0];
- String os = config[1];
- String arch = config[2];
+ private void verifyExecIU(ArrayList iuList, String idBase, String confSpec) {
+ String[] config = AbstractPublisherAction.parseConfigSpec(confSpec);
+ String _ws = config[0];
+ String _os = config[1];
+ String _arch = config[2];
for (int i = 0; i < iuList.size(); i++) {
IInstallableUnit possibleExec = (IInstallableUnit) iuList.get(i);
- if (possibleExec.getId().equals(idBase + ".executable." + configSpec)) { //$NON-NLS-1$
+ if (possibleExec.getId().equals(idBase + ".executable." + confSpec)) { //$NON-NLS-1$
//keep checking
- assertTrue(possibleExec.getFilter().equals(InstallableUnit.parseFilter("(& (osgi.ws=" + ws + ")(osgi.os=" + os + ")(osgi.arch=" + arch + "))"))); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$
+ assertTrue(possibleExec.getFilter().equals(InstallableUnit.parseFilter("(& (osgi.ws=" + _ws + ")(osgi.os=" + _os + ")(osgi.arch=" + _arch + "))"))); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$
IArtifactKey eKey = possibleExec.getArtifacts().iterator().next();
assertTrue(eKey.getClassifier().equals("binary")); //$NON-NLS-1$
- assertTrue(eKey.getId().equals(idBase + ".executable." + configSpec)); //$NON-NLS-1$
+ assertTrue(eKey.getId().equals(idBase + ".executable." + confSpec)); //$NON-NLS-1$
assertTrue(eKey.getVersion().equals(version));
Collection<IProvidedCapability> providedCapabilities = possibleExec.getProvidedCapabilities();
- verifyProvidedCapability(providedCapabilities, IInstallableUnit.NAMESPACE_IU_ID, idBase + ".executable." + configSpec, version); //$NON-NLS-1$
+ verifyProvidedCapability(providedCapabilities, IInstallableUnit.NAMESPACE_IU_ID, idBase + ".executable." + confSpec, version); //$NON-NLS-1$
verifyProvidedCapability(providedCapabilities, flavorArg + idBase, idBase + ".executable", version); //$NON-NLS-1$
assertTrue(providedCapabilities.size() == 2);
Collection<IRequirement> requiredCapability = possibleExec.getRequirements();
- verifyRequiredCapability(requiredCapability, IInstallableUnit.NAMESPACE_IU_ID, "org.eclipse.equinox.launcher." + (idBase.equals("mac") || idBase.equals("macCocoa") ? configSpec.substring(0, configSpec.lastIndexOf(".")) : configSpec), VersionRange.emptyRange); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ verifyRequiredCapability(requiredCapability, IInstallableUnit.NAMESPACE_IU_ID, "org.eclipse.equinox.launcher." + (idBase.equals("mac") || idBase.equals("macCocoa") ? confSpec.substring(0, confSpec.lastIndexOf(".")) : confSpec), VersionRange.emptyRange); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertTrue(requiredCapability.size() == 1);
try {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/BundlesTxtTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/BundlesTxtTest.java
index 5c4097269..b5a8f4998 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/BundlesTxtTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/BundlesTxtTest.java
@@ -16,8 +16,10 @@ import org.eclipse.equinox.p2.tests.TestData;
import org.osgi.framework.BundleContext;
public class BundlesTxtTest extends AbstractSimpleConfiguratorTest {
- @SuppressWarnings("hiding")
- private static String BUNDLE_JAR_DIRECTORY = "simpleConfiguratorTest/bundlesTxt";
+
+ {
+ BUNDLE_JAR_DIRECTORY = "simpleConfiguratorTest/bundlesTxt";
+ }
private File[] jars = null;
private File bundleInfo = null;

Back to the top