Skip to content
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

errorprone: misc fixes #971

Merged
merged 1 commit into from
Oct 18, 2024
Merged
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
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