Skip to content

Some code suggestion from CodeGuru #577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public void remove(String Key){
}

public Object get(String key) {
return store.containsKey(key)?store.get(key).value:null;
ValueNode node = store.get(key);
return node != null ? node.value : null;
}

public boolean hasExpired(String key, Instant now) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private <T> void processFailedMessages(List<T> successReturns,
map(SQSMessage::getMessageId)
.collect(toList());

LOG.debug(format("[%s] records failed processing, but exceptions are suppressed. " +
LOG.debug(format("[%d] records failed processing, but exceptions are suppressed. " +
"Failed messages %s", failedMessages.size(), messageIds));
} else {
throw new SQSBatchProcessingException(exceptions, failedMessages, successReturns);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,6 @@ public static JsonSchema getJsonSchema(String schema) {
* @return the loaded json schema
*/
public static JsonSchema getJsonSchema(String schema, boolean validateSchema) {
JsonSchema jsonSchema = schemas.get(schema);

if (jsonSchema != null) {
return jsonSchema;
}

if (schema.startsWith(CLASSPATH)) {
String filePath = schema.substring(CLASSPATH.length());
try (InputStream schemaStream = ValidationAspect.class.getResourceAsStream(filePath)) {
Expand All @@ -260,7 +254,7 @@ public static JsonSchema getJsonSchema(String schema, boolean validateSchema) {
}
}

schemas.put(schema, jsonSchema);
schemas.putIfAbsent(schema, jsonSchema);

return jsonSchema;
}
Expand Down