Skip to content

Commit

Permalink
chore: suppress new spotbug issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sparsick committed Nov 17, 2022
1 parent 3a7ba37 commit 4b38a8a
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 10 deletions.
Expand Up @@ -25,7 +25,7 @@ import org.reficio.p2.resolver.eclipse.EclipseResolutionRequest
import org.reficio.p2.resolver.eclipse.EclipseResolutionResponse
import org.reficio.p2.resolver.eclipse.EclipseResolver

@SuppressFBWarnings("SE_NO_SERIALVERSIONID")
@SuppressFBWarnings(value = ["EI_EXPOSE_REP", "SE_NO_SERIALVERSIONID"])
class DefaultEclipseResolver implements EclipseResolver {

final File target
Expand Down
Expand Up @@ -20,7 +20,7 @@ package org.reficio.p2.resolver.eclipse.impl

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

@SuppressFBWarnings("SE_NO_SERIALVERSIONID")
@SuppressFBWarnings(value = ["EI_EXPOSE_REP", "EI_EXPOSE_REP2" , "SE_NO_SERIALVERSIONID"])
class FileBinaryCategory {
def static leftShift(File file, URL url) {
url.withInputStream { is ->
Expand Down
Expand Up @@ -18,6 +18,7 @@
*/
package org.reficio.p2.resolver.maven.impl

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings
import org.reficio.p2.resolver.maven.impl.facade.AetherEclipseFacade
import org.reficio.p2.resolver.maven.impl.facade.AetherFacade
import org.reficio.p2.resolver.maven.impl.facade.AetherSonatypeFacade
Expand All @@ -28,6 +29,7 @@ import org.reficio.p2.resolver.maven.impl.facade.AetherSonatypeFacade
* http://www.reficio.org
* @since 1.1.0
*/
@SuppressFBWarnings(value = ["EI_EXPOSE_REP", "EI_EXPOSE_REP2"])
class Aether {

static AetherFacade facade(def repositorySystemSession) {
Expand Down
Expand Up @@ -34,7 +34,7 @@ import org.reficio.p2.resolver.maven.ResolvedArtifact
* http://www.reficio.org
* @since 1.0.0
*/
@SuppressFBWarnings("SE_NO_SERIALVERSIONID")
@SuppressFBWarnings(value = ["EI_EXPOSE_REP", "SE_NO_SERIALVERSIONID"])
class AetherResolver implements ArtifactResolver {

static final String DEFAULT_SCOPE = "compile"
Expand Down
Expand Up @@ -39,7 +39,7 @@ import org.reficio.p2.resolver.maven.Artifact
* http://www.reficio.org
* @since 1.1.0
*/
@SuppressFBWarnings("SE_NO_SERIALVERSIONID")
@SuppressFBWarnings(value = [ "EI_EXPOSE_REP2" , "EI_EXPOSE_REP" , "SE_NO_SERIALVERSIONID" ])
class AetherEclipseFacade implements AetherFacade {

@Override
Expand Down
Expand Up @@ -39,7 +39,7 @@ import org.sonatype.aether.util.graph.PreorderNodeListGenerator
* http://www.reficio.org
* @since 1.1.0
*/
@SuppressFBWarnings("SE_NO_SERIALVERSIONID")
@SuppressFBWarnings(value = ["EI_EXPOSE_REP2" , "EI_EXPOSE_REP" , "SE_NO_SERIALVERSIONID" ])
class AetherSonatypeFacade implements AetherFacade {

@Override
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/reficio/p2/FeatureBuilder.java
Expand Up @@ -38,6 +38,7 @@
public class FeatureBuilder {


@SuppressFBWarnings("EI_EXPOSE_REP2")
public FeatureBuilder(P2FeatureDefinition p2FeatureDefintion,
final P2ArtifactMap<ArtifactBundlerInstructions> bundlerInstructions,
boolean generateSourceFeature,
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/reficio/p2/P2Artifact.java
Expand Up @@ -18,7 +18,10 @@
*/
package org.reficio.p2;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -33,6 +36,7 @@
* http://www.reficio.org
* @since 1.0.0
*/
@SuppressFBWarnings({"EI_EXPOSE_REP2", "EI_EXPOSE_REP"})
public class P2Artifact {

/**
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/reficio/p2/P2FeatureDefinition.java
Expand Up @@ -18,6 +18,8 @@
*/
package org.reficio.p2;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -31,6 +33,7 @@
* http://www.itemis.de
* @since 1.1.2
*/
@SuppressFBWarnings(value = "EI_EXPOSE_REP")
public class P2FeatureDefinition {

public P2FeatureDefinition() {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/reficio/p2/TychoFeatureBuilder.java
Expand Up @@ -31,6 +31,8 @@

import java.io.File;
import java.io.IOException;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.BuildPluginManager;
import org.apache.maven.plugin.MojoExecutionException;
Expand All @@ -39,6 +41,7 @@
import org.eclipse.tycho.core.osgitools.targetplatform.DefaultDependencyArtifacts;
import org.reficio.p2.utils.Utils;

@SuppressFBWarnings(value = "EI_EXPOSE_REP")
public class TychoFeatureBuilder {

File featureFile;
Expand Down
Expand Up @@ -19,6 +19,8 @@
package org.reficio.p2.bundler;


import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
Expand All @@ -29,6 +31,7 @@
* http://www.reficio.org
* @since 1.1.0
*/
@SuppressFBWarnings(value = "EI_EXPOSE_REP")
public final class ArtifactBundlerInstructions {

/**
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/reficio/p2/publisher/BundlePublisher.java
Expand Up @@ -18,6 +18,7 @@
*/
package org.reficio.p2.publisher;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.BuildPluginManager;
import org.apache.maven.plugin.MojoExecutionException;
Expand All @@ -35,6 +36,7 @@
* http://www.reficio.org
* @since 1.0.0
*/
@SuppressFBWarnings(value = "EI_EXPOSE_REP2")
public class BundlePublisher {

private final Boolean compressSite;
Expand Down
Expand Up @@ -36,6 +36,7 @@
* http://www.reficio.org
* @since 1.0.0
*/
@SuppressFBWarnings("EI_EXPOSE_REP2")
public class CategoryPublisher {

private static final String CATEGORY_PUBLISHER_APP_NAME = "org.eclipse.equinox.p2.publisher.CategoryPublisher";
Expand All @@ -46,7 +47,6 @@ public class CategoryPublisher {
private final String categoryFileLocation;
private final String metadataRepositoryLocation;

@SuppressFBWarnings("EI_EXPOSE_REP2")
public CategoryPublisher(P2ApplicationLauncher launcher, int forkedProcessTimeoutInSeconds, String[] additionalArgs,
String categoryFileLocation, String metadataRepositoryLocation) {
this.launcher = launcher;
Expand Down
Expand Up @@ -18,7 +18,10 @@
*/
package org.reficio.p2.resolver.eclipse;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

import java.io.File;
import java.util.Collections;
import java.util.List;

/**
Expand All @@ -27,12 +30,13 @@
* http://www.reficio.org
* @since 1.1.2
*/
@SuppressFBWarnings(value = {"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
public class EclipseResolutionResponse {

private final List<File> resolved;

public EclipseResolutionResponse(List<File> resolved) {
this.resolved = resolved;
this.resolved = Collections.unmodifiableList(resolved);
}

public List<File> getResolved() {
Expand Down
Expand Up @@ -19,6 +19,7 @@
package org.reficio.p2.resolver.maven;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
Expand Down Expand Up @@ -47,7 +48,7 @@ public String getRootArtifactId() {
}

public List<String> getExcludes() {
return excludes;
return Collections.unmodifiableList(excludes);
}

public boolean isResolveTransitive() {
Expand Down
Expand Up @@ -19,6 +19,7 @@
package org.reficio.p2.bundler.impl;


import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.maven.plugin.logging.SystemStreamLog;
import org.assertj.core.api.ThrowableAssert;
import org.junit.AfterClass;
Expand All @@ -37,6 +38,7 @@
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.Mockito.mockStatic;

@SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE")
public class AquteBundlerTest {


Expand Down
6 changes: 4 additions & 2 deletions src/test/java/org/reficio/p2/resolver/impl/AetherTest.java
Expand Up @@ -18,12 +18,14 @@
*/
package org.reficio.p2.resolver.impl;

import org.hamcrest.core.IsInstanceOf;
import org.junit.Test;
import org.reficio.p2.resolver.maven.impl.Aether;
import org.reficio.p2.resolver.maven.impl.facade.AetherEclipseFacade;
import org.reficio.p2.resolver.maven.impl.facade.AetherFacade;
import org.reficio.p2.resolver.maven.impl.facade.AetherSonatypeFacade;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;

Expand All @@ -44,7 +46,7 @@ public void facade_sonatypeAetherSystem() {
AetherFacade facade = Aether.facade(repositorySystem);

// THEN
assertTrue("Wrong facade type", facade instanceof AetherSonatypeFacade);
assertThat(facade).isInstanceOf(AetherSonatypeFacade.class);
}

@Test
Expand All @@ -56,7 +58,7 @@ public void facade_eclipseAetherSystem() {
AetherFacade facade = Aether.facade(repositorySystem);

// THEN
assertTrue("Wrong facade type", facade instanceof AetherEclipseFacade);
assertThat(facade).isInstanceOf(AetherEclipseFacade.class);
}

}

0 comments on commit 4b38a8a

Please sign in to comment.