diff options
author | Alexander Kurtakov | 2018-01-30 08:28:42 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-01-30 08:28:42 +0000 |
commit | 8d990a7a055c3b929818fb4cb3b8cc5525b75b52 (patch) | |
tree | 6ba5b137d6db79214308b20f287e6dafbaa46640 | |
parent | d8c703314ff500c8933466044d4e90a91001217b (diff) | |
download | rt.equinox.p2-8d990a7a055c3b929818fb4cb3b8cc5525b75b52.tar.gz rt.equinox.p2-8d990a7a055c3b929818fb4cb3b8cc5525b75b52.tar.xz rt.equinox.p2-8d990a7a055c3b929818fb4cb3b8cc5525b75b52.zip |
Bug 530486 - Remove useless thrown exceptions.I20180130-2000
Change-Id: Ieb5178a2eecbeaab88afd5e00bc3806bc615c7ae
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
9 files changed, 51 insertions, 31 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepositoryIO.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepositoryIO.java index 5d7193203..6544033db 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepositoryIO.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepositoryIO.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. + * Copyright (c) 2007, 2018 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 @@ -219,7 +219,7 @@ public class SimpleArtifactRepositoryIO { // XML writer for a SimpleArtifactRepository protected class Writer extends XMLWriter implements XMLConstants { - public Writer(OutputStream output) throws IOException { + public Writer(OutputStream output) { super(output, PI_DEFAULTS); } diff --git a/bundles/org.eclipse.equinox.p2.discovery.compatibility/src/org/eclipse/equinox/internal/p2/discovery/compatibility/util/DefaultSaxErrorHandler.java b/bundles/org.eclipse.equinox.p2.discovery.compatibility/src/org/eclipse/equinox/internal/p2/discovery/compatibility/util/DefaultSaxErrorHandler.java index d5528c398..38cee1947 100644 --- a/bundles/org.eclipse.equinox.p2.discovery.compatibility/src/org/eclipse/equinox/internal/p2/discovery/compatibility/util/DefaultSaxErrorHandler.java +++ b/bundles/org.eclipse.equinox.p2.discovery.compatibility/src/org/eclipse/equinox/internal/p2/discovery/compatibility/util/DefaultSaxErrorHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2017 Tasktop Technologies and others. + * Copyright (c) 2009, 2018 Tasktop Technologies 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 @@ -21,7 +21,7 @@ import org.xml.sax.*; public class DefaultSaxErrorHandler implements ErrorHandler { @Override - public void warning(SAXParseException exception) throws SAXException { + public void warning(SAXParseException exception) { // ignore } diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java index 7f9e93085..1d68d7498 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. + * Copyright (c) 2007, 2018 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 @@ -10,7 +10,6 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.engine; -import java.io.IOException; import java.io.OutputStream; import java.util.*; import org.eclipse.equinox.internal.p2.metadata.repository.io.MetadataWriter; @@ -20,7 +19,7 @@ import org.eclipse.equinox.p2.query.QueryUtil; public class ProfileWriter extends MetadataWriter implements ProfileXMLConstants { - public ProfileWriter(OutputStream output, ProcessingInstruction[] processingInstructions) throws IOException { + public ProfileWriter(OutputStream output, ProcessingInstruction[] processingInstructions) { super(output, processingInstructions); } diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java index 328991eae..c5539bafc 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. All rights reserved. This + * Copyright (c) 2007, 2018 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 http://www.eclipse.org/legal/epl-v10.html @@ -701,7 +701,7 @@ public class SimpleProfileRegistry implements IProfileRegistry, IAgentService { static class Writer extends ProfileWriter { - public Writer(OutputStream output) throws IOException { + public Writer(OutputStream output) { super(output, new ProcessingInstruction[] {ProcessingInstruction.makeTargetVersionInstruction(PROFILE_TARGET, ProfileXMLConstants.CURRENT_VERSION)}); } } diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java index 4243ad59d..41d676990 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. + * Copyright (c) 2007, 2018 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 @@ -123,7 +123,7 @@ public class MetadataRepositoryIO { // XML writer for a IMetadataRepository protected class Writer extends MetadataWriter implements XMLConstants { - public Writer(OutputStream output, Class<? extends IMetadataRepository> repositoryClass) throws IOException { + public Writer(OutputStream output, Class<? extends IMetadataRepository> repositoryClass) { super(output, createPI(repositoryClass)); } diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java index d1e524a12..4571096b5 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java +++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2017 IBM Corporation and others. + * Copyright (c) 2009, 2018 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 @@ -208,7 +208,7 @@ public class Repo2Runnable extends AbstractApplication implements IApplication { static class Writer extends ProfileWriter { - public Writer(OutputStream output) throws IOException { + public Writer(OutputStream output) { super(output, new ProcessingInstruction[] {ProcessingInstruction.makeTargetVersionInstruction(PROFILE_TARGET, ProfileXMLConstants.CURRENT_VERSION)}); } } 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 83c44ed84..7ac211dbd 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. + * Copyright (c) 2007, 2018 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 @@ -10,21 +10,34 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.engine; -import java.io.*; -import java.util.*; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.StringReader; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; import java.util.Map.Entry; import javax.xml.parsers.ParserConfigurationException; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.equinox.internal.p2.engine.*; +import org.eclipse.equinox.internal.p2.engine.ISurrogateProfileHandler; +import org.eclipse.equinox.internal.p2.engine.Profile; +import org.eclipse.equinox.internal.p2.engine.ProfileParser; +import org.eclipse.equinox.internal.p2.engine.ProfileWriter; import org.eclipse.equinox.p2.core.ProvisionException; import org.eclipse.equinox.p2.engine.IProfile; import org.eclipse.equinox.p2.engine.IProfileRegistry; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.metadata.Version; -import org.eclipse.equinox.p2.query.*; +import org.eclipse.equinox.p2.query.Collector; +import org.eclipse.equinox.p2.query.IQuery; +import org.eclipse.equinox.p2.query.IQueryResult; +import org.eclipse.equinox.p2.query.QueryUtil; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; import org.osgi.framework.BundleContext; -import org.xml.sax.*; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; /** * Simple test of the engine API. @@ -160,7 +173,7 @@ public class ProfileTest extends AbstractProvisioningTest { class ProfileStringWriter extends ProfileWriter { - public ProfileStringWriter(ByteArrayOutputStream stream) throws IOException { + public ProfileStringWriter(ByteArrayOutputStream stream) { super(stream, new ProcessingInstruction[] {ProcessingInstruction.makeTargetVersionInstruction(PROFILE_TEST_TARGET, PROFILE_TEST_VERSION)}); } diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/StandaloneSerializationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/StandaloneSerializationTest.java index ad97decb2..47d5bcbe1 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/StandaloneSerializationTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/StandaloneSerializationTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2017 Sonatype, Inc. and others. + * Copyright (c) 2011, 2018 Sonatype, Inc. 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 @@ -10,15 +10,23 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.metadata.repository; -import java.io.*; -import java.util.*; -import javax.xml.parsers.ParserConfigurationException; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; import junit.framework.TestCase; -import org.eclipse.equinox.p2.metadata.*; +import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.p2.metadata.MetadataFactory; +import org.eclipse.equinox.p2.metadata.Version; import org.eclipse.equinox.p2.metadata.io.IUDeserializer; import org.eclipse.equinox.p2.metadata.io.IUSerializer; -import org.xml.sax.SAXNotRecognizedException; -import org.xml.sax.SAXNotSupportedException; public class StandaloneSerializationTest extends TestCase { public void testNothingToWrite() { @@ -38,7 +46,7 @@ public class StandaloneSerializationTest extends TestCase { } } - public void testNoContent() throws SAXNotRecognizedException, SAXNotSupportedException, ParserConfigurationException { + public void testNoContent() { //Write file w/o content File f = null; try { @@ -71,7 +79,7 @@ public class StandaloneSerializationTest extends TestCase { f.delete(); } - public void testWritingThenLoading() throws SAXNotRecognizedException, SAXNotSupportedException, ParserConfigurationException { + public void testWritingThenLoading() { MetadataFactory.InstallableUnitDescription iu = new MetadataFactory.InstallableUnitDescription(); iu.setId("foo"); iu.setVersion(Version.create("1.0.0")); diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java index 9d96f4664..75c30aea1 100644 --- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java +++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/UpdateSite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2017 IBM Corporation and others. + * Copyright (c) 2008, 2018 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 @@ -477,7 +477,7 @@ public class UpdateSite { /* * Load and return the bundle references in this update site. */ - public synchronized BundleDescription[] loadBundles(IProgressMonitor monitor) throws ProvisionException { + public synchronized BundleDescription[] loadBundles(IProgressMonitor monitor) { if (!bundleCache.isEmpty()) return bundleCache.values().toArray(new BundleDescription[bundleCache.size()]); BundleDescription[] result = null; // TODO loadBundlesFromDigest(monitor); |