Skip to content

Commit

Permalink
errorprone: misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdahlke committed Oct 11, 2024
1 parent 2576ceb commit 5df638e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/main/java/emissary/config/ExtractResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public static void main(final String[] args) {
}
}

@SuppressWarnings("SystemOut")
private static void printUsage() {
System.out.println("Usage: scripts/run.sh " + ExtractResource.class.getName() + " [ -o output_directory ] package/to/Resource[.cfg] ...");
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/core/ExtractedRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ private void configure() {

@Override
@Deprecated(forRemoval = true)
@Nullable
public List<IBaseDataObject> getExtractedRecords() {
return null;
}
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/emissary/place/CoordinationPlace.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,15 @@ protected void cleanUpHook(IBaseDataObject d) {
/**
* Classes can override this method to do anything to the list of sprouted data objects from this coordination
*/
protected void sproutHook(List<IBaseDataObject> sproutList, IBaseDataObject parent) {
logger.debug("In base sproutHook with {}", sproutList.size());
protected void sproutHook(List<IBaseDataObject> sproutCollection, IBaseDataObject d) {
logger.debug("In base sproutHook with {}", sproutCollection.size());
}

private void sproutHook(List<IBaseDataObject> sproutCollection, IBaseDataObject d, boolean hd) {
// Allow derived classes a shot at the sprouts
if (hd) {
sproutHook(sproutCollection, d);
}
}

/**
Expand Down Expand Up @@ -250,21 +257,14 @@ protected List<IBaseDataObject> coordinate(IBaseDataObject d, boolean hd) {

applyForm(d, errorOccurred);

sproutHook(d, hd, sproutCollection);
sproutHook(sproutCollection, d, hd);

// Allow derived classes a shot to clean up the parent
cleanUpHook(d);

return sproutCollection;
}

private void sproutHook(IBaseDataObject d, boolean hd, List<IBaseDataObject> sproutCollection) {
// Allow derived classes a shot at the sprouts
if (hd) {
sproutHook(sproutCollection, d);
}
}

/**
* Allow derived classes a shot to handle a place exception
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emissary/util/CharsetUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public static char[] jGetUtfCharArray(final byte[] byteArray, @Nullable final St
*/
public static String getUtfString(final String s, final String charSet) {
try {
return new String(s.getBytes("ISO8859_1"), charSet);
return new String(s.getBytes(StandardCharsets.ISO_8859_1), charSet);
} catch (UnsupportedEncodingException uue) {
logger.warn("Unable to convert to " + charSet);
}
Expand Down

0 comments on commit 5df638e

Please sign in to comment.