Skip to content

Commit

Permalink
Merge pull request #2200 from qmonmert/sonar-java-intellij
Browse files Browse the repository at this point in the history
Clean code
  • Loading branch information
DanielFran authored Jun 21, 2022
2 parents 53786cc + 42c570c commit 3a2e1d4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public class Base64Utils {

private static SecureRandom random = new SecureRandom();
private static final SecureRandom random = new SecureRandom();

private Base64Utils() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ private Function<String, DockerImage> toDockerImage() {
return line -> {
int versionSeparatorIndex = line.lastIndexOf(":");

return new DockerImage(
line.substring(DOCKER_FROM.length(), versionSeparatorIndex),
line.substring(versionSeparatorIndex + 1, line.length())
);
return new DockerImage(line.substring(DOCKER_FROM.length(), versionSeparatorIndex), line.substring(versionSeparatorIndex + 1));
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public class GeneratorHistoryInterceptor {

private final GeneratorHistoryApplicationService generatorHistoryApplicationService;
private Clock clock;
private final Clock clock;

public GeneratorHistoryInterceptor(GeneratorHistoryApplicationService generatorHistoryApplicationService, Clock clock) {
this.generatorHistoryApplicationService = generatorHistoryApplicationService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private String buildProperties(PropertyKey key, PropertyValue value) throws IOEx
int propertyIndex = currentProperties.indexOf(propertyId(key));
if (propertyIndex != -1) {
String start = currentProperties.substring(0, propertyIndex);
String end = currentProperties.substring(currentProperties.indexOf(BREAK, propertyIndex), currentProperties.length());
String end = currentProperties.substring(currentProperties.indexOf(BREAK, propertyIndex));

return start + propertyLine(key, value) + end;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class ExceptionTranslator implements ProblemHandling {
private boolean exceptionWithDetails;

@Value("${application.exception.package}")
private List<String> packages = List.of();
private final List<String> packages = List.of();

/**
* Post-process the Problem payload to add the message key for the front-end if needed.
Expand Down

0 comments on commit 3a2e1d4

Please sign in to comment.