Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepository.java5
-rw-r--r--src/main/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryConfigurator.java3
-rw-r--r--src/main/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryTemplateProvider.java7
-rw-r--r--src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/ParsedRequest.java2
-rw-r--r--src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/RequestPathConverter.java5
-rw-r--r--src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/UnzipCache.java2
-rw-r--r--src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItem.java2
-rw-r--r--src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryAgainstHostedRepositoryTest.java1
-rw-r--r--src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryAgainstProxyRepositoryTest.java1
-rw-r--r--src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryTest.java3
-rw-r--r--src/test/java/org/eclipse/tycho/nexus/internal/plugin/cache/PathLockTest.java21
-rw-r--r--src/test/java/org/eclipse/tycho/nexus/internal/plugin/cache/RequestPathConverterTest.java8
-rw-r--r--src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItemTest.java1
13 files changed, 13 insertions, 48 deletions
diff --git a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepository.java b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepository.java
index fd5feb7..e45249e 100644
--- a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepository.java
+++ b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepository.java
@@ -191,10 +191,9 @@ public class DefaultUnzipRepository extends AbstractShadowRepository implements
@Subscribe
public void onRepositoryRegistryEventAdd(RepositoryRegistryEventAdd evt) {
- final RepositoryRegistryEventAdd repoAddEvent = (RepositoryRegistryEventAdd) evt;
- if (repoAddEvent.getRepository().getId().equals(getMasterRepositoryId())) {
+ if (evt.getRepository().getId().equals(getMasterRepository().getId())) {
try {
- setMasterRepositoryId(repoAddEvent.getRepository().getId());
+ setMasterRepositoryId(evt.getRepository().getId());
} catch (final NoSuchRepositoryException e) {
getLogger().warn("Master Repository not available", e);
} catch (final IncompatibleMasterRepositoryException e) {
diff --git a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryConfigurator.java b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryConfigurator.java
index d7cf745..2f83b61 100644
--- a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryConfigurator.java
+++ b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryConfigurator.java
@@ -12,7 +12,6 @@ package org.eclipse.tycho.nexus.internal.plugin;
import org.codehaus.plexus.component.annotations.Component;
import org.sonatype.configuration.ConfigurationException;
-import org.sonatype.nexus.configuration.Configurator;
import org.sonatype.nexus.configuration.ExternalConfiguration;
import org.sonatype.nexus.configuration.application.ApplicationConfiguration;
import org.sonatype.nexus.configuration.model.CRepositoryCoreConfiguration;
@@ -20,7 +19,7 @@ import org.sonatype.nexus.proxy.repository.AbstractShadowRepositoryConfigurator;
import org.sonatype.nexus.proxy.repository.Repository;
@Component(role = UnzipRepositoryConfigurator.class)
-public class UnzipRepositoryConfigurator extends AbstractShadowRepositoryConfigurator implements Configurator {
+public class UnzipRepositoryConfigurator extends AbstractShadowRepositoryConfigurator {
@Override
public void doApplyConfiguration(final Repository repository, final ApplicationConfiguration configuration,
diff --git a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryTemplateProvider.java b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryTemplateProvider.java
index 9d233f7..b55db53 100644
--- a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryTemplateProvider.java
+++ b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/UnzipRepositoryTemplateProvider.java
@@ -11,8 +11,6 @@
package org.eclipse.tycho.nexus.internal.plugin;
import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
-import org.sonatype.nexus.proxy.registry.RepositoryTypeRegistry;
import org.sonatype.nexus.templates.TemplateProvider;
import org.sonatype.nexus.templates.TemplateSet;
import org.sonatype.nexus.templates.repository.AbstractRepositoryTemplateProvider;
@@ -21,11 +19,6 @@ import org.sonatype.nexus.templates.repository.AbstractRepositoryTemplateProvide
@Component(role = TemplateProvider.class, hint = "unzipRepo-templates")
public class UnzipRepositoryTemplateProvider extends AbstractRepositoryTemplateProvider {
- private static final String UNZIP_REPOSITORY_PREFIX = "unzip";
-
- @Requirement
- private RepositoryTypeRegistry repositoryTypeRegistry;
-
@Override
public TemplateSet getTemplates() {
final TemplateSet templates = new TemplateSet(null);
diff --git a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/ParsedRequest.java b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/ParsedRequest.java
index d5f0730..4ec69da 100644
--- a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/ParsedRequest.java
+++ b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/ParsedRequest.java
@@ -90,7 +90,7 @@ abstract class ParsedRequest {
}
@SuppressWarnings("deprecation")
- private String getLatestVersion(final Versioning versioning, final boolean findSnapshots)
+ private static String getLatestVersion(final Versioning versioning, final boolean findSnapshots)
throws ItemNotFoundException {
final List<ArtifactVersion> artifactVersions = new ArrayList<ArtifactVersion>();
for (final String version : versioning.getVersions()) {
diff --git a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/RequestPathConverter.java b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/RequestPathConverter.java
index 392e05d..b759db4 100644
--- a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/RequestPathConverter.java
+++ b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/RequestPathConverter.java
@@ -56,8 +56,7 @@ public class RequestPathConverter {
return parsedRequest.resolve(repository);
}
- private static ParsedRequest parseRequest(final ResourceStoreRequest request, final boolean useVirtualVersions)
- throws IllegalRequestException {
+ private static ParsedRequest parseRequest(final ResourceStoreRequest request, final boolean useVirtualVersions) {
final String requestPath = request.getRequestPath();
if (useVirtualVersions) {
@@ -97,7 +96,7 @@ public class RequestPathConverter {
return new UnchangedRequest(requestPath);
}
- private static VersionRange parseVersionRange(final ResourceStoreRequest request) throws IllegalRequestException {
+ private static VersionRange parseVersionRange(final ResourceStoreRequest request) {
// TODO: create versionRange form requestUrl.
return null;
}
diff --git a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/UnzipCache.java b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/UnzipCache.java
index e47011c..87443ff 100644
--- a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/UnzipCache.java
+++ b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/cache/UnzipCache.java
@@ -134,7 +134,7 @@ public class UnzipCache {
}
}
- private String getRequestPathParent(final String path) {
+ private static String getRequestPathParent(final String path) {
return ItemPathUtils.getParentPath(path) + ItemPathUtils.PATH_SEPARATOR;
}
diff --git a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItem.java b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItem.java
index cbe2db7..c9efb05 100644
--- a/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItem.java
+++ b/src/main/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItem.java
@@ -95,7 +95,7 @@ public class ZippedItem {
zippedStorageItem = createZippedStorageItem();
}
- private String removeTrailingSlash(final String path) {
+ private static String removeTrailingSlash(final String path) {
return (path.endsWith("/") ? path.substring(0, path.length() - 1) : path);
}
diff --git a/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryAgainstHostedRepositoryTest.java b/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryAgainstHostedRepositoryTest.java
index 76a9ce6..2110ac2 100644
--- a/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryAgainstHostedRepositoryTest.java
+++ b/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryAgainstHostedRepositoryTest.java
@@ -31,7 +31,6 @@ import org.sonatype.nexus.util.ItemPathUtils;
/**
* Tests the DefaultUnzipRepository with a hosted repository as master repository.
*/
-@SuppressWarnings("nls")
public class DefaultUnzipRepositoryAgainstHostedRepositoryTest extends DefaultUnzipRepositoryTest {
@Override
diff --git a/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryAgainstProxyRepositoryTest.java b/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryAgainstProxyRepositoryTest.java
index 8808b9e..1c1ad57 100644
--- a/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryAgainstProxyRepositoryTest.java
+++ b/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryAgainstProxyRepositoryTest.java
@@ -27,7 +27,6 @@ import org.eclipse.tycho.nexus.internal.plugin.test.RepositoryMock;
* Because of this this test does not include any test cases that directly request a collection (in
* opposite to {@link DefaultUnzipRepositoryAgainstHostedRepositoryTest}).
*/
-@SuppressWarnings("nls")
public class DefaultUnzipRepositoryAgainstProxyRepositoryTest extends DefaultUnzipRepositoryTest {
@Override
diff --git a/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryTest.java b/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryTest.java
index e515a2c..c31e48e 100644
--- a/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryTest.java
+++ b/src/test/java/org/eclipse/tycho/nexus/internal/plugin/DefaultUnzipRepositoryTest.java
@@ -17,8 +17,6 @@ import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.Collection;
-import org.eclipse.tycho.nexus.internal.plugin.DefaultUnzipRepository;
-import org.eclipse.tycho.nexus.internal.plugin.UnzipRepository;
import org.eclipse.tycho.nexus.internal.plugin.storage.Util;
import org.eclipse.tycho.nexus.internal.plugin.storage.ZippedStorageCollectionItem;
import org.eclipse.tycho.nexus.internal.plugin.test.RepositoryMock;
@@ -41,7 +39,6 @@ import org.sonatype.nexus.proxy.repository.ShadowRepository;
import org.sonatype.nexus.proxy.storage.UnsupportedStorageOperationException;
import org.sonatype.nexus.util.ItemPathUtils;
-@SuppressWarnings("nls")
public abstract class DefaultUnzipRepositoryTest {
protected final RepositoryMock repositoryMock;
protected final DefaultUnzipRepository unzipRepo;
diff --git a/src/test/java/org/eclipse/tycho/nexus/internal/plugin/cache/PathLockTest.java b/src/test/java/org/eclipse/tycho/nexus/internal/plugin/cache/PathLockTest.java
index 0bc83da..91809eb 100644
--- a/src/test/java/org/eclipse/tycho/nexus/internal/plugin/cache/PathLockTest.java
+++ b/src/test/java/org/eclipse/tycho/nexus/internal/plugin/cache/PathLockTest.java
@@ -18,13 +18,8 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
-import org.eclipse.tycho.nexus.internal.plugin.cache.PathLock;
import org.eclipse.tycho.nexus.internal.plugin.cache.PathLock.PathLockMonitor;
-import org.junit.After;
-import org.junit.AfterClass;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
public class PathLockTest {
@@ -34,22 +29,6 @@ public class PathLockTest {
@SuppressWarnings("unused")
private static String cString = "";
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- }
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- }
-
- @Before
- public void setUp() throws Exception {
- }
-
- @After
- public void tearDown() throws Exception {
- }
-
public static void buildStrings(final String path) {
final PathLockMonitor lock = PathLock.getLock(path);
synchronized (lock) {
diff --git a/src/test/java/org/eclipse/tycho/nexus/internal/plugin/cache/RequestPathConverterTest.java b/src/test/java/org/eclipse/tycho/nexus/internal/plugin/cache/RequestPathConverterTest.java
index c1c775b..af4ec89 100644
--- a/src/test/java/org/eclipse/tycho/nexus/internal/plugin/cache/RequestPathConverterTest.java
+++ b/src/test/java/org/eclipse/tycho/nexus/internal/plugin/cache/RequestPathConverterTest.java
@@ -244,7 +244,7 @@ public class RequestPathConverterTest {
* @throws IOException
* @throws ItemNotFoundException
*/
- private void assertPathConversion(final String snapshotVersion, final String timestampVersion,
+ private static void assertPathConversion(final String snapshotVersion, final String timestampVersion,
final String pathInZip, final String classifier) throws Exception {
String appliedClassifier = "";
if (classifier.length() > 0) {
@@ -278,13 +278,13 @@ public class RequestPathConverterTest {
* empty a leading slash is needed.
* @throws Exception
*/
- private void assertPathConversion(final String snapshotVersion, final String timestampVersion,
+ private static void assertPathConversion(final String snapshotVersion, final String timestampVersion,
final String pathInZip) throws Exception {
assertPathConversion(snapshotVersion, timestampVersion, pathInZip, "");
}
@SuppressWarnings("unchecked")
- private MavenRepository createRepositoryMock(final String pathToArtifact, final String pathToTestMetadata) {
+ private static MavenRepository createRepositoryMock(final String pathToArtifact, final String pathToTestMetadata) {
final String pathToMetadataXML = pathToArtifact + "maven-metadata.xml";
final MavenRepository repositoryMock = EasyMock.createMock(MavenRepository.class);
final Capture<ResourceStoreRequest>[] captures = new Capture[] { new Capture<ResourceStoreRequest>() };
@@ -314,7 +314,7 @@ public class RequestPathConverterTest {
return repositoryMock;
}
- private MavenRepository createRepositoryMockNotFindingMetaData(final String pathToArtifact) {
+ private static MavenRepository createRepositoryMockNotFindingMetaData(final String pathToArtifact) {
final String pathToMetadataXML = pathToArtifact + "maven-metadata.xml";
final MavenRepository repositoryMock = EasyMock.createMock(MavenRepository.class);
try {
diff --git a/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItemTest.java b/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItemTest.java
index 17ff5ac..1093cbc 100644
--- a/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItemTest.java
+++ b/src/test/java/org/eclipse/tycho/nexus/internal/plugin/storage/ZippedItemTest.java
@@ -136,6 +136,7 @@ public class ZippedItemTest {
zippedStorageItem.getPath());
}
+ @SuppressWarnings("unused")
@Test(expected = LocalStorageException.class)
public void testZipItemNotFound() throws Exception {
final String pathInZip = "test.txt";

Back to the top