Skip to content

Commit

Permalink
errorprone :: ignore warnings in Executrix and UnixCmdPlace (#962)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-mlb authored Oct 4, 2024
1 parent a58a9c3 commit b3ec308
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/emissary/place/UnixCommandPlace.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ protected void logMessages(String tempDir) {
* Run the file process
*/
@Nullable
@SuppressWarnings("AvoidObjectArrays")
public byte[] fileProcess(String[] cmd, String outputFile) {
logger.debug("fileProcess({})", Arrays.asList(cmd));
StringBuilder errbuf = new StringBuilder();
Expand All @@ -195,6 +196,7 @@ public byte[] fileProcess(String[] cmd, String outputFile) {
* @return bytes of output from command execution
*/
@Nullable
@SuppressWarnings("AvoidObjectArrays")
public byte[] stdOutProcess(String[] cmd, boolean chop) {
logger.debug("stdOutProcess({},{}) with charset {}", Arrays.asList(cmd), chop, charset);
StringBuilder outbuf = new StringBuilder();
Expand Down Expand Up @@ -274,6 +276,7 @@ protected void unSynchronizedProcess(IBaseDataObject theDataObject) throws Resou
* @param data the bytes to run the command on
* @return byte array of output
*/
@SuppressWarnings("CatchingUnchecked")
protected byte[] runCommandOn(byte[] data) throws ResourceException {
String[] names = executrix.makeTempFilenames();
String tempDirName = names[Executrix.DIR];
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/emissary/util/shell/Executrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
/**
* This class wraps up things related to exec-ing of external processes and reading and writing disk files.
*/
@SuppressWarnings("AvoidObjectArrays")
public class Executrix {
private static final Logger logger = LoggerFactory.getLogger(Executrix.class);

Expand Down Expand Up @@ -1248,6 +1249,7 @@ public static boolean cleanupDirectory(final String dir) {
* @param dir the directory to remove
* @return true if it works, false otherwise
*/
@SuppressWarnings("CatchingUnchecked")
public static boolean cleanupDirectory(final File dir) {
if (!dir.exists()) {
return true;
Expand Down Expand Up @@ -1363,6 +1365,7 @@ public ProcessBuilder getProcessBuilder() {

}

@SuppressWarnings("MethodCanBeStatic")
public ProcessReader getStdOutProcessReader(Process p) {
return new ReadOutputLogger("stdOut", p.getInputStream());
}
Expand Down

0 comments on commit b3ec308

Please sign in to comment.