Skip to content

Commit

Permalink
Update spotbugs
Browse files Browse the repository at this point in the history
  • Loading branch information
onigoetz committed Feb 7, 2024
1 parent de3ecb7 commit 6b4afa3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.github.swissquote.carnotzet.core.maven.ResourcesManager;
import com.google.common.base.Strings;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
Expand Down Expand Up @@ -73,6 +74,7 @@ public class Carnotzet {
@Getter
private final Boolean supportLegacyDnsNames;

@SuppressFBWarnings("CT_CONSTRUCTOR_THROW")
public Carnotzet(CarnotzetConfig config) {
log.debug("Creating new carnotzet with config [{}]", config);
this.config = config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.github.swissquote.carnotzet.core.docker.registry.ImageRef;
import com.github.swissquote.carnotzet.core.runtime.DefaultCommandRunner;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import lombok.Getter;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -147,6 +148,7 @@ public static class StartupWrapper {
// Local images may not be available for target runtime environment (ie : cloud)
private Boolean ignoreLocalImages = false;

@SuppressFBWarnings("CT_CONSTRUCTOR_THROW")
public StartupWrapper(@NonNull CarnotzetModule moduleToWrap) {
this.moduleToWrap = moduleToWrap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class FileSystemCache<T> {
private final Class<T> deserializationType;
private final ObjectMapper jsonMapper;

@SuppressFBWarnings("CT_CONSTRUCTOR_THROW")
public FileSystemCache(Path cachePath, Class<T> deserializationType) {
this.cachePath = cachePath;
this.deserializationType = deserializationType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.google.common.io.Files;
import com.google.common.io.Resources;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

Expand All @@ -24,6 +25,7 @@ public class WelcomePageGenerator {
private final String after;
private final List<WelcomePagePostProcessor> postProcessors;

@SuppressFBWarnings("CT_CONSTRUCTOR_THROW")
public WelcomePageGenerator() {

try {
Expand All @@ -37,6 +39,7 @@ public WelcomePageGenerator() {
this.postProcessors = Collections.emptyList();
}

@SuppressFBWarnings("CT_CONSTRUCTOR_THROW")
public WelcomePageGenerator(List<WelcomePagePostProcessor> postProcessors) {
try {
this.before = Resources.toString(Thread.currentThread().getContextClassLoader().getResource("welcome/before.html"), Charsets.UTF_8);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.swissquote.carnotzet.runtime.extension;

import java.io.File;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Comparator;
Expand Down Expand Up @@ -44,9 +45,11 @@ public CarnotzetModule beforeStart(CarnotzetModule module, ContainerOrchestratio
@SneakyThrows
public CarnotzetModule afterStart(CarnotzetModule module, ContainerOrchestrationRuntime runtime, Carnotzet carnotzet) {
log.info("After start");
dumpDirectory.toFile().mkdirs();
if (!dumpDirectory.toFile().mkdirs()) {
log.info("Could not delete [{}]", dumpDirectory);
}
Container container = runtime.getContainer(module.getServiceId());
byte[] ipStrBytes = container.getIp().getBytes();
byte[] ipStrBytes = container.getIp().getBytes(StandardCharsets.UTF_8);
Files.write(dumpDirectory.resolve(module.getServiceId()), ipStrBytes);
return module;
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.7.1.1</version>
<version>4.8.3.0</version>
<configuration>
<effort>Max</effort>
<threshold>Low</threshold>
Expand Down

0 comments on commit 6b4afa3

Please sign in to comment.