Skip to content

Commit

Permalink
- fix sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rathnapandi committed Oct 22, 2024
1 parent 0d872bb commit abb1f36
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class APIQuota {

String description;

Boolean system;
boolean system;

List<QuotaRestriction> restrictions;

Expand Down Expand Up @@ -61,11 +61,11 @@ public void setId(String id) {
this.id = id;
}

public Boolean getSystem() {
public boolean getSystem() {
return system;
}

public void setSystem(Boolean system) {
public void setSystem(boolean system) {
this.system = system;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@
import java.util.List;

public class CustomProperty {

private String label;

private String type;
private Boolean disabled;
private Boolean required;

private boolean disabled;

private boolean required;

private String help;

private List<Option> options;

private String defaultValue;

private String regex;

private Integer minValue;

private Integer maxValue;

private Integer decimalPlaces;

private String error;

private Object custom;

private CustomPropertyPermission permissions;

public String getLabel() {
Expand All @@ -48,19 +48,19 @@ public void setType(String type) {
this.type = type;
}

public Boolean getDisabled() {
public boolean getDisabled() {
return disabled;
}

public void setDisabled(Boolean disabled) {
public void setDisabled(boolean disabled) {
this.disabled = disabled;
}

public Boolean getRequired() {
public boolean getRequired() {
return required;
}

public void setRequired(Boolean required) {
public void setRequired(boolean required) {
this.required = required;
}

Expand Down Expand Up @@ -135,7 +135,7 @@ public Object getCustom() {
public void setCustom(Object custom) {
this.custom = custom;
}

public CustomPropertyPermission getPermissions() {
return permissions;
}
Expand Down Expand Up @@ -168,29 +168,29 @@ public void setUser(Permissions user) {
}
}
public static class Permissions {
private Boolean read;
private Boolean write;
private Boolean visible;
public Boolean getRead() {
private boolean read;
private boolean write;
private boolean visible;
public boolean getRead() {
return read;
}
public void setRead(Boolean read) {
public void setRead(boolean read) {
this.read = read;
}
public Boolean getWrite() {
public boolean getWrite() {
return write;
}
public void setWrite(Boolean write) {
public void setWrite(boolean write) {
this.write = write;
}
public Boolean getVisible() {
public boolean getVisible() {
return visible;
}
public void setVisible(Boolean visible) {
public void setVisible(boolean visible) {
this.visible = visible;
}
}
}

public static class Option {
private String value;
private String label;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class AppException extends JsonProcessingException {

private final ErrorCode error;

private String secondMessage;
private final String secondMessage;

public enum LogLevel {
INFO,
Expand All @@ -28,11 +28,13 @@ public AppException(String message, String secondMessage, ErrorCode errorCode, T
public AppException(String message, ErrorCode errorCode, Throwable throwable) {
super(message, throwable);
this.error = errorCode;
this.secondMessage = null;
}

public AppException(String message, ErrorCode errorCode) {
super(message);
this.error = errorCode;
this.secondMessage = null;
}

public ErrorCode getError() {
Expand Down Expand Up @@ -70,19 +72,14 @@ public void logException(Logger logger) {
}
}

public String getSecondMessage() {
return secondMessage;
}

public String getAllMessages() {
String message = getMessage();
String secondMessageLocal = getSecondMessage();

if (this.getCause() instanceof AppException) {
message += "\n | " + ((AppException) this.getCause()).getAllMessages();
}
if (secondMessageLocal != null) {
message += "\n | " + secondMessageLocal;
if (secondMessage != null) {
message += "\n | " + secondMessage;
}
return message;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static void copyTestAssets(File sourceDir, File testDir) {
if (!sourceDir.exists()) {
throw new ValidationException("Unable to copy test assets to test directory: '" + testDir + "'. Could not find sourceDir: '" + sourceDir + "'");
}
FileFilter filter = new WildcardFileFilter("*.crt", "*.jpg", "*.png", "*.pem");
FileFilter filter = WildcardFileFilter.builder().setWildcards("*.crt", "*.jpg", "*.png", "*.pem").get();
try {
LOG.info("Copy *.crt, *.jpg, *.png, *.pem from source: {} into test-dir: {}", sourceDir, testDir);
FileUtils.copyDirectory(sourceDir, testDir, filter, true);
Expand Down

0 comments on commit abb1f36

Please sign in to comment.