Skip to content

Commit

Permalink
[KOGITO-9584] Review comments and sonar warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Jul 17, 2023
1 parent ddfd1d9 commit abb3674
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import org.eclipse.microprofile.openapi.models.media.Schema;
import org.kie.kogito.jackson.utils.ObjectMapperFactory;
import org.kie.kogito.serverless.workflow.io.URIContentLoaderFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
Expand All @@ -44,6 +46,8 @@
@JsonInclude(JsonInclude.Include.NON_NULL)
public class JsonSchemaImpl extends SchemaImpl {

private static final Logger logger = LoggerFactory.getLogger(JsonSchemaImpl.class);

@JsonSetter("$ref")
@Override
public void setRef(String ref) {
Expand All @@ -63,6 +67,7 @@ public void setRef(String ref) {
ref = OpenApiConstants.REF_PREFIX_SCHEMA + key;
} catch (URISyntaxException | IOException e) {
// if not a valid uri, let super handle it
logger.info("Error loading ref {}", ref, e);
}
}
super.setRef(ref);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ private RefSchemas() {
}

private static class ThreadInfo {
public int counter;
public String id;
public Map<String, Schema> map = new HashMap<>();
private final String id;
private final Map<String, Schema> map = new HashMap<>();
private int counter;

public ThreadInfo(String id) {
private ThreadInfo(String id) {
this.id = id;
}
}
Expand All @@ -52,6 +52,6 @@ public static String getKey() {
}

public static void reset() {
threadInfo.set(null);
threadInfo.remove();
}
}

0 comments on commit abb3674

Please sign in to comment.