Skip to content

Commit

Permalink
errorprone :: suppress system out in main method (#859)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-mlb authored Jul 30, 2024
1 parent 084248b commit 4bc6f61
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/emissary/admin/Startup.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ private static String makeConfig(final String path, final String file) {
/**
* The main entry point
*/
@SuppressWarnings("SystemOut")
public static void main(final String[] args) throws IOException, EmissaryException {


Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/command/Banner.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public Banner() {
}
}

@SuppressWarnings("SystemOut")
public void dump() {
System.out.println(bannerText);
}
Expand Down
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 @@ -76,6 +76,7 @@ private static boolean hasFileEnding(final String resource) {
/**
* Run from the command line specifying a set of resources to be extracted
*/
@SuppressWarnings("SystemOut")
public static void main(final String[] args) {
final ExtractResource ex = new ExtractResource();

Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/jni/JniRepositoryPlace.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public void process(final IBaseDataObject theDataObject) {}
* Test standalone main
*/

@SuppressWarnings("SystemOut")
public static void main(final String[] argv) {

if (argv.length < 1) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/kff/KffChainLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ private static int loadFrom(KffChain chain, Map<String, String> m, KffFilter.Fil
/**
* Load the configured chain and run some data
*/
@SuppressWarnings("SystemOut")
public static void main(String[] args) throws Exception {
KffChain kff = getChainInstance();

Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/kff/KffQuincyFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public KffQuincyFile(String filename, String filterName, FilterType ftype) throw
super.myPreferredAlgorithm = "MD5";
}

@SuppressWarnings("SystemOut")
public static void main(String[] args) throws Exception {
KffChain kff = new KffChain();
KffFile kfile = new KffQuincyFile(args[0], "QUINCYTEST", FilterType.Ignore);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/kff/SpamSumSignature.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public byte[] getHashPart2() {
return hash2;
}

@SuppressWarnings("SystemOut")
public static void main(String[] args) {
if (args.length != 2) {
System.out.println("Usage: SpamSumSignature ssdeep1 ssdeep2\nUse the full ssdeep value (xx:yyy:zzz)."
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/kff/Ssdeep.java
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ public int Compare(@Nullable final SpamSumSignature signature1, @Nullable final
return (int) score;
}

@SuppressWarnings("SystemOut")
public static void main(final String[] args) throws Exception {
final Ssdeep ss = new Ssdeep();
for (final String f : args) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/output/filter/DataFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ protected boolean writeDataStream(final IBaseDataObject d, final IBaseDataObject
/**
* Main to test output types
*/
@SuppressWarnings("SystemOut")
public static void main(final String[] args) throws IOException {
final String name = args.length > 0 ? args[0] : null;

Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/output/filter/XmlOutputFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public byte[] convert(final List<IBaseDataObject> list, final Map<String, Object
/**
* Main to test output types
*/
@SuppressWarnings("SystemOut")
public static void main(String[] args) throws IOException {
String name = args.length > 0 ? args[0] : null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ public static Collection<Path> getJournalPaths(Path dir) throws IOException {
/**
* Prints contents of a Journal to stdout.
*/
@SuppressWarnings("SystemOut")
public static void main(String[] args) throws Exception {
String path = args[0];
try (JournalReader jr = new JournalReader(Paths.get(path))) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/parser/DataIdentifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public int getTestStringMaxSize() {
return DATA_ID_STR_SZ;
}

@SuppressWarnings("SystemOut")
public static void main(String[] args) throws Exception {
DataIdentifier dataIdentifier = new DataIdentifier();

Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/transform/decode/HtmlEscape.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ private static String getValueForHtmlEntity(String entity) {
/** This class is not meant to be instantiated. */
private HtmlEscape() {}

@SuppressWarnings("SystemOut")
public static void main(String[] args) throws Exception {
boolean useString = false;
int i = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public static byte[] unescape(byte[] data) {
/** This class is not meant to be instantiated. */
private JavascriptEscape() {}

@SuppressWarnings("SystemOut")
public static void main(String[] args) throws Exception {
int i = 0;

Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/transform/decode/JsonEscape.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ protected static boolean isOctalDigit(byte b) {
/** This class is not meant to be instantiated. */
private JsonEscape() {}

@SuppressWarnings("SystemOut")
public static void main(String[] args) throws Exception {
for (int i = 0; i < args.length; i++) {
byte[] content = Executrix.readDataFromFile(args[i]);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/util/ClassComparator.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class ClassComparator {
/** This class is not meant to be instantiated. */
private ClassComparator() {}

@SuppressWarnings("SystemOut")
public static void main(final String[] args) {

if (args.length < 2) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/util/Hexl.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public static String toHexString(byte[] data, int limit) {
/** This class is not meant to be instantiated. */
private Hexl() {}

@SuppressWarnings("SystemOut")
public static void main(String[] argv) {

if (argv.length < 1) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/util/HtmlEntityMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public void dumpTestPage(PrintStream out) {
out.println("</html>");
}

@SuppressWarnings("SystemOut")
public static void main(String[] args) {
HtmlEntityMap h = new HtmlEntityMap();
h.dumpTestPage(System.out);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/util/UnixFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public String evaluateByMagicNumber(byte[] bytes) throws IOException {
/**
* Test standalone main
*/
@SuppressWarnings("SystemOut")
public static void main(String[] args) throws Exception {
if (args.length < 2) {
log.info("Usage: UnixFile [-v] magicfile file1 [file2 ...]");
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/util/WatcherThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void run() {
}
}

@SuppressWarnings("SystemOut")
public static void main(String[] args) throws IOException {
WatcherThread wt = new WatcherThread();
String name = wt.getClass().getName();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/util/io/FileFind.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public Iterator<?> find(String filename, FileFilter filter) throws IOException {
return new FileIterator(filename, filter);
}

@SuppressWarnings("SystemOut")
public static void main(String[] args) {

FileFind ff = new FileFind(FILES_FLAG | DIRECTORIES_FLAG);
Expand Down

0 comments on commit 4bc6f61

Please sign in to comment.