Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2013-11-15 01:39:49 -0500
committerAlexander Kurtakov2013-11-15 01:40:43 -0500
commitc2ffd5860b51fc5ca6b19bf4b4bdb879c1d297fa (patch)
tree861e3f9e21069fc19f843295f7703ebc42458aa2 /bundles/org.eclipse.equinox.p2.tests
parent10d37f35fc48d728419738510c54d3a4a78abf2e (diff)
downloadrt.equinox.p2-c2ffd5860b51fc5ca6b19bf4b4bdb879c1d297fa.tar.gz
rt.equinox.p2-c2ffd5860b51fc5ca6b19bf4b4bdb879c1d297fa.tar.xz
rt.equinox.p2-c2ffd5860b51fc5ca6b19bf4b4bdb879c1d297fa.zip
Bug 421798 - Fix various warnings.
* Remove unneeded casts. * Remove unneeded throws. * Remove unneeded semicolons. Change-Id: I7454ea216cfc194a0d394550feecc29042d23363 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug351944.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CorruptedJar.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/JarURLArtifactRepositoryTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState2.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileReaderTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AbstractSharedInstallTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/EclipseTouchpointTest.java2
15 files changed, 20 insertions, 25 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java
index c5e130083..eb81e2c03 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java
@@ -17,7 +17,6 @@ import java.net.URISyntaxException;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRequest;
-import org.eclipse.equinox.internal.p2.repository.AuthenticationFailedException;
import org.eclipse.equinox.internal.p2.repository.Transport;
import org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler;
@@ -77,12 +76,12 @@ public class TestArtifactRepository extends AbstractArtifactRepository {
}
@Override
- public InputStream stream(URI toDownload, IProgressMonitor monitor) throws FileNotFoundException, CoreException, AuthenticationFailedException {
+ public InputStream stream(URI toDownload, IProgressMonitor monitor) {
throw new IllegalStateException("Method should not be called");
}
@Override
- public long getLastModified(URI toDownload, IProgressMonitor monitor) throws CoreException, FileNotFoundException, AuthenticationFailedException {
+ public long getLastModified(URI toDownload, IProgressMonitor monitor) {
throw new IllegalStateException("Method should not be called");
}
};
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java
index d36a545b9..e3281977f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/ArtifactOutputStreamTest.java
@@ -147,7 +147,7 @@ public class ArtifactOutputStreamTest extends AbstractProvisioningTest {
}
}
- public void write(int b) throws IOException {
+ public void write(int b) {
if (baos != null)
baos.write(b);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug351944.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug351944.java
index ee795e22c..a511fc0d1 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug351944.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug351944.java
@@ -12,7 +12,6 @@ package org.eclipse.equinox.p2.tests.artifact.repository;
import java.io.File;
import java.net.URI;
-import java.net.URISyntaxException;
import java.util.*;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
@@ -57,7 +56,7 @@ public class Bug351944 extends AbstractProvisioningTest {
delete(artifactRepoFile);
}
- public void testSimpleRepositoryPerformanceOnLoadReadonlyLocalRepository() throws ProvisionException, URISyntaxException {
+ public void testSimpleRepositoryPerformanceOnLoadReadonlyLocalRepository() throws ProvisionException {
if (!Platform.OS_WIN32.equals(Platform.getOS())) {
final URI testRepo = artifactRepoFile.toURI();
IArtifactRepositoryManager artifactRepositoryManager = getArtifactRepositoryManager();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CorruptedJar.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CorruptedJar.java
index 2400e3301..99a39d529 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CorruptedJar.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CorruptedJar.java
@@ -46,7 +46,7 @@ public class CorruptedJar extends AbstractProvisioningTest {
ProvisioningContext ctx = new ProvisioningContext(getAgent());
ctx.setArtifactRepositories(new URI[] {getTestData("CorruptedJar repo", testDataLocation).toURI()});
DownloadManager mgr = new DownloadManager(ctx, getAgent());
- IArtifactKey key = (IArtifactKey) source.query(ArtifactKeyQuery.ALL_KEYS, null).iterator().next();
+ IArtifactKey key = source.query(ArtifactKeyQuery.ALL_KEYS, null).iterator().next();
mgr.add(new MirrorRequest(key, target, null, null, getTransport()));
IStatus s = mgr.start(new NullProgressMonitor());
assertNotOK(s);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/JarURLArtifactRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/JarURLArtifactRepositoryTest.java
index 3fb273053..8b7e1c66c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/JarURLArtifactRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/JarURLArtifactRepositoryTest.java
@@ -44,7 +44,7 @@ public class JarURLArtifactRepositoryTest extends TestCase {
manager = null;
}
- public void testJarURLRepository() throws ProvisionException, URISyntaxException {
+ public void testJarURLRepository() throws ProvisionException {
URL engineJar = TestActivator.getContext().getBundle().getEntry("/testData/enginerepo.jar");
URI jarRepoLocation = null;
try {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepTest.java
index 293d50ed2..15948b184 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepTest.java
@@ -67,7 +67,7 @@ public class ProcessingStepTest extends TestCase {
public void testFlush() throws IOException {
OutputStream destination = new OutputStream() {
- public void write(int b) throws IOException {
+ public void write(int b) {
}
public void flush() {
@@ -82,7 +82,7 @@ public class ProcessingStepTest extends TestCase {
public void testCloseSimpleOutputStreamAsDestination() throws IOException {
OutputStream destination = new OutputStream() {
- public void write(int b) throws IOException {
+ public void write(int b) {
}
public void close() {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java
index 8610f4cb4..a28eb7e69 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileRegistryTest.java
@@ -257,7 +257,7 @@ public class ProfileRegistryTest extends AbstractProvisioningTest {
}
- public void testProfileLockingNested() throws IOException {
+ public void testProfileLockingNested() {
File testData = getTestData("0.1", "testData/engineTest/SimpleRegistry");
File tempFolder = getTempFolder();
copy("0.2", testData, tempFolder);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java
index fae0e5406..69fb0c3ec 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileTest.java
@@ -229,7 +229,7 @@ public class ProfileTest extends AbstractProvisioningTest {
protected void handleRootAttributes(Attributes attributes) {
}
- public void startElement(String name, Attributes attributes) throws SAXException {
+ public void startElement(String name, Attributes attributes) {
if (PROFILES_ELEMENT.equals(name)) {
if (profilesHandler == null) {
profilesHandler = new ProfilesHandler(this, attributes);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java
index 9da7f809d..6a49b333d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java
@@ -556,7 +556,7 @@ public class MetadataRepositoryManagerTest extends AbstractProvisioningTest {
assertEquals(1, loadRepository.query(QueryUtil.createIUAnyQuery(), null).toSet().size());
}
- public void testUnreadableFailingFilter() throws ProvisionException {
+ public void testUnreadableFailingFilter() {
File site = getTestData("unreadable", "/testData/metadataRepo/badFilter/unreadable");
PrintStream out = System.out;
try {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java
index 856686a2b..7567b6eaa 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java
@@ -10,11 +10,10 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
-
import java.io.File;
import java.util.ArrayList;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
@@ -44,7 +43,7 @@ public class Bug252682 extends AbstractProvisioningTest {
}
public void testInstallFeaturePatch() {
- IInstallableUnit p2Feature = (IInstallableUnit) profile.query(QueryUtil.createIUQuery("org.eclipse.equinox.p2.user.ui.feature.group"), new NullProgressMonitor()).iterator().next();
+ IInstallableUnit p2Feature = profile.query(QueryUtil.createIUQuery("org.eclipse.equinox.p2.user.ui.feature.group"), new NullProgressMonitor()).iterator().next();
System.out.println(p2Feature);
IQueryResult c = profile.query(QueryUtil.createIUQuery("org.eclipse.equinox.p2.core.patch"), new NullProgressMonitor());
assertEquals(1, queryResultSize(c));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState2.java
index a82c0b225..ab9c8f761 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState2.java
@@ -10,9 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.planner;
-import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
-
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.*;
@@ -62,7 +61,7 @@ public class NonMinimalState2 extends AbstractProvisioningTest {
IPlanner planner = createPlanner();
ProfileChangeRequest request = new ProfileChangeRequest(profile);
- request.addInstallableUnits((IInstallableUnit[]) getMetadataRepositoryManager().query(QueryUtil.createIUQuery("org.mortbay.jetty.server"), null).toArray(IInstallableUnit.class));
+ request.addInstallableUnits(getMetadataRepositoryManager().query(QueryUtil.createIUQuery("org.mortbay.jetty.server"), null).toArray(IInstallableUnit.class));
IProvisioningPlan plan = planner.getProvisioningPlan(request, null, new NullProgressMonitor());
assertOK("Plan OK", plan.getStatus());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileReaderTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileReaderTest.java
index 04d75677d..2deccbcf8 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileReaderTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/repository/FileReaderTest.java
@@ -58,7 +58,7 @@ public class FileReaderTest extends AbstractTestServerClientCase {
/**
* Tests a successful read.
*/
- public void testRead() throws URISyntaxException, CoreException, IOException {
+ public void testRead() throws URISyntaxException {
RepositoryTransport transport = new RepositoryTransport();
URI toDownload = new URI(getBaseURL() + "/public/index.html");
OutputStream target = new ByteArrayOutputStream();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AbstractSharedInstallTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AbstractSharedInstallTest.java
index b458836c7..1d939287f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AbstractSharedInstallTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/AbstractSharedInstallTest.java
@@ -173,7 +173,7 @@ public abstract class AbstractSharedInstallTest extends AbstractReconcilerTest {
if (withConfigFlag)
args = new String[] {"-configuration", userBase.getAbsolutePath() + java.io.File.separatorChar + "configuration", "-application", "org.eclipse.equinox.p2.tests.verifier.application", "-verifier.properties", verifierConfig.getAbsolutePath(), "-consoleLog"};
else
- args = new String[] {"-application", "org.eclipse.equinox.p2.tests.verifier.application", "-verifier.properties", verifierConfig.getAbsolutePath(), "-consoleLog"};;
+ args = new String[] {"-application", "org.eclipse.equinox.p2.tests.verifier.application", "-verifier.properties", verifierConfig.getAbsolutePath(), "-consoleLog"};
assertEquals(0, runEclipse("Running verifier", output, args));
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java
index e47e2f59b..9639094aa 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/AddRepositoryActionTest.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.touchpoint.eclipse;
-import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
-
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
+import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.p2.metadata.TouchpointInstruction;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.Util;
import org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.ActionConstants;
@@ -220,7 +219,7 @@ public class AddRepositoryActionTest extends AbstractProvisioningTest {
//perform the update and install an ordinary bundle
IMetadataRepository repo = getMetadataRepositoryManager().loadRepository(site, getMonitor());
- IInstallableUnit bundle = (IInstallableUnit) repo.query(QueryUtil.createIUQuery("aBundle"), getMonitor()).iterator().next();
+ IInstallableUnit bundle = repo.query(QueryUtil.createIUQuery("aBundle"), getMonitor()).iterator().next();
request = new ProfileChangeRequest(profile);
final IInstallableUnit[] newIUs = new IInstallableUnit[] {newIU, bundle};
request.addInstallableUnits(newIUs);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/EclipseTouchpointTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/EclipseTouchpointTest.java
index 194066753..d48c8a6d9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/EclipseTouchpointTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/touchpoint/eclipse/EclipseTouchpointTest.java
@@ -218,7 +218,7 @@ public class EclipseTouchpointTest extends AbstractProvisioningTest {
getArtifactRepositoryManager().addRepository(site);
IMetadataRepository repo = getMetadataRepositoryManager().loadRepository(site, getMonitor());
- IInstallableUnit iu = (IInstallableUnit) repo.query(QueryUtil.createIUQuery("test.bundle"), getMonitor()).iterator().next();
+ IInstallableUnit iu = repo.query(QueryUtil.createIUQuery("test.bundle"), getMonitor()).iterator().next();
assertNotNull(iu);
profile = createProfile("test", profileProperties);
ProfileChangeRequest request = new ProfileChangeRequest(profile);

Back to the top