Skip to content

Commit

Permalink
errorprone :: activate (#1000)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-mlb authored Nov 1, 2024
1 parent 7a6cf9a commit dde463a
Show file tree
Hide file tree
Showing 20 changed files with 36 additions and 54 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,6 @@ jobs:
- name: Build with Maven
run: mvn -B -e -ntp "-Dstyle.color=always" site

error-prone-build:
name: Maven errorProne build
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Configure Java & Maven
uses: actions/setup-java@v4
with:
java-version: 11
cache: "maven"
distribution: "corretto"

- name: Build with Maven
run: mvn -B -e -ntp "-Dstyle.color=always" -PerrorProne verify -DskipTests

slack-notify:
if: ${{ github.event_name == 'push' && github.repository == 'NationalSecurityAgency/emissary' }}
needs: build
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1457,11 +1457,12 @@
</build>
</profile>
<profile>
<!-- on by default, but disable with '-P !errorProne' or '-DskipErrorProne' -->
<id>errorProne</id>
<activation>
<jdk>[11,)</jdk>
<property>
<name>errorProne</name>
<name>!skipErrorProne</name>
</property>
</activation>
<build>
Expand Down Expand Up @@ -1494,7 +1495,6 @@
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne \
-XepAllDisabledChecksAsWarnings \
-XepAllErrorsAsWarnings \
-XepAllSuggestionsAsWarnings \
-XepDisableWarningsInGeneratedCode \
-Xep:AndroidJdkLibsChecker:OFF \
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/emissary/core/BaseDataObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ public byte[] header() {
}

@Override
@Deprecated(forRemoval = true)
@Deprecated
public ByteBuffer headerBuffer() {
return ByteBuffer.wrap(header());
}
Expand All @@ -1114,13 +1114,13 @@ public byte[] footer() {


@Override
@Deprecated(forRemoval = true)
@Deprecated
public ByteBuffer footerBuffer() {
return ByteBuffer.wrap(footer());
}

@Override
@Deprecated(forRemoval = true)
@Deprecated
public ByteBuffer dataBuffer() {
return ByteBuffer.wrap(data());
}
Expand Down Expand Up @@ -1151,7 +1151,7 @@ public void setFileType(@Nullable final String v) {
}

@Override
@Deprecated(forRemoval = true)
@Deprecated
public boolean setFileTypeIfEmpty(final String v, final String[] empties) {
if (isFileTypeEmpty(empties)) {
setFileType(v);
Expand Down Expand Up @@ -1239,7 +1239,7 @@ public void appendAlternateView(final String name, final byte[] data, final int
*/
@Nullable
@Override
@Deprecated(forRemoval = true)
@Deprecated
public ByteBuffer getAlternateViewBuffer(final String s) {
final byte[] viewdata = getAlternateView(s);
if (viewdata == null) {
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/emissary/core/ExtractedRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,44 +35,44 @@ private void configure() {
}

@Override
@Deprecated(forRemoval = true)
@Deprecated
@Nullable
public List<IBaseDataObject> getExtractedRecords() {
return null;
}

@Override
@Deprecated(forRemoval = true)
@Deprecated
public void setExtractedRecords(final List<? extends IBaseDataObject> extractedRecords) {
throw new UnsupportedOperationException();
}

@Override
@Deprecated(forRemoval = true)
@Deprecated
public void addExtractedRecord(final IBaseDataObject extractedRecord) {
throw new UnsupportedOperationException();
}

@Override
@Deprecated(forRemoval = true)
@Deprecated
public void addExtractedRecords(final List<? extends IBaseDataObject> extractedRecords) {
throw new UnsupportedOperationException();
}

@Override
@Deprecated(forRemoval = true)
@Deprecated
public boolean hasExtractedRecords() {
return false;
}

@Override
@Deprecated(forRemoval = true)
@Deprecated
public void clearExtractedRecords() {
throw new UnsupportedOperationException();
}

@Override
@Deprecated(forRemoval = true)
@Deprecated
public int getExtractedRecordCount() {
return 0;
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/emissary/core/IBaseDataObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,23 +215,23 @@ enum MergePolicy {
*
* @return buffer required by the HTML Velocity templates.
*/
@Deprecated(forRemoval = true)
@Deprecated
ByteBuffer headerBuffer();

/**
* Return the footer wrapped in a ByteBuffer class.
*
* @return buffer required by the HTML Velocity templates.
*/
@Deprecated(forRemoval = true)
@Deprecated
ByteBuffer footerBuffer();

/**
* Return theData wrapped in a ByteBuffer class.
*
* @return buffer required by the HTML Velocity templates.
*/
@Deprecated(forRemoval = true)
@Deprecated
ByteBuffer dataBuffer();

/**
Expand Down Expand Up @@ -406,7 +406,7 @@ enum MergePolicy {
* @return true if it was empty and set
* @deprecated Use {@link #setFileType(String)} instead.
*/
@Deprecated(forRemoval = true)
@Deprecated
@SuppressWarnings("AvoidObjectArrays")
boolean setFileTypeIfEmpty(String arg1, String[] arg2);

Expand Down Expand Up @@ -453,7 +453,7 @@ enum MergePolicy {
* @param arg1 the name of the view to retrieve
* @return buffer of alternate view data
*/
@Deprecated(forRemoval = true)
@Deprecated
ByteBuffer getAlternateViewBuffer(String arg1);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ protected void finalize(Path rolledOutputPath, Path finalOutputPath) throws IOEx
finalizeRoll(rolledOutputPath, finalOutputPath);
}

@Deprecated(forRemoval = true)
@Deprecated
@SuppressWarnings("InconsistentOverloads")
protected void finalizeRoll(Collection<Journal> journals, Path rolledOutputPath, Path finalOutputPath) throws IOException {
finalizeRoll(rolledOutputPath, finalOutputPath, journals);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emissary/parser/ParserFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public SessionParser makeSessionParser(SeekableByteChannel channel) {
* @return SessionParser implementation
* @deprecated use {@link #makeSessionParser(SeekableByteChannel, String)}
*/
@Deprecated(forRemoval = true)
@Deprecated
@SuppressWarnings("InconsistentOverloads")
public SessionParser makeSessionParser(String type, SeekableByteChannel channel) {
return makeSessionParser(channel, type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ protected int processSingleChild(IBaseDataObject d, File f, byte[] theData) {
* @return 0 when it works
* @deprecated use {@link #processSingleChild(IBaseDataObject, File, byte[])}
*/
@Deprecated(forRemoval = true)
@Deprecated
@SuppressWarnings("InconsistentOverloads")
protected int processSingleChild(IBaseDataObject d, byte[] theData, File f) {
return processSingleChild(d, f, theData);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emissary/transform/HtmlEscapePlace.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import static emissary.core.constants.Parameters.SUFFIXES_HTML_ESCAPE;
import static emissary.core.constants.Parameters.SUMMARY;

@Deprecated(forRemoval = true)
@Deprecated
public class HtmlEscapePlace extends ServiceProviderPlace {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import static emissary.core.constants.Configurations.OUTPUT_FORM;

@Deprecated(forRemoval = true)
@Deprecated
public class JavascriptEscapePlace extends ServiceProviderPlace {

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emissary/transform/JsonEscapePlace.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import static emissary.core.constants.Configurations.OUTPUT_FORM;

@Deprecated(forRemoval = true)
@Deprecated
public class JsonEscapePlace extends ServiceProviderPlace {

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emissary/transform/decode/HtmlEscape.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.regex.Pattern;
import javax.annotation.Nullable;

@Deprecated(forRemoval = true)
@Deprecated
@SuppressWarnings("all")
public class HtmlEscape {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;

@Deprecated(forRemoval = true)
@Deprecated
public class JavascriptEscape {

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emissary/transform/decode/JsonEscape.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;

@Deprecated(forRemoval = true)
@Deprecated
public class JsonEscape {

private static final String ESCAPES = "ntr\"'/\\";
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/emissary/util/shell/Executrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ public File writeDataToNewTempDir(final byte[] data, final String dirn) {
* @deprecated use {@link #writeDataToNewTempDir(byte[], String)}
*/
@Nullable
@Deprecated(forRemoval = true)
@Deprecated
@SuppressWarnings("InconsistentOverloads")
public File writeDataToNewTempDir(final String dirn, final byte[] data) {
return writeDataToNewTempDir(data, dirn);
Expand Down Expand Up @@ -1017,7 +1017,7 @@ public String[] getCommand(final String[] tmpNames, final String commandArg, fin
* @return the value of command
* @deprecated use {@link #getCommand(String[], String)}
*/
@Deprecated(forRemoval = true)
@Deprecated
@SuppressWarnings("InconsistentOverloads")
public String[] getCommand(final String commandArg, final String[] tmpNames) {
return getCommand(tmpNames, commandArg);
Expand All @@ -1036,7 +1036,7 @@ public String[] getCommand(final String commandArg, final String[] tmpNames) {
* @return the value of command
* @deprecated use {@link #getCommand(String[], String, int, int)}
*/
@Deprecated(forRemoval = true)
@Deprecated
@SuppressWarnings("InconsistentOverloads")
public String[] getCommand(final String commandArg, final String[] tmpNames, final int cpuLimit, final int vmSzLimit) {
return getCommand(tmpNames, commandArg, cpuLimit, vmSzLimit);
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/emissary/transform/HtmlEscapePlaceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import static emissary.core.constants.Parameters.SUMMARY;
import static org.junit.jupiter.api.Assertions.assertEquals;

@Deprecated(forRemoval = true)
@Deprecated
public class HtmlEscapePlaceTest extends ExtractionTest {

public static Stream<? extends Arguments> data() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.io.IOException;
import java.util.stream.Stream;

@Deprecated(forRemoval = true)
@Deprecated
class JavascriptEscapePlaceTest extends ExtractionTest {

public static Stream<? extends Arguments> data() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/emissary/transform/JsonEscapePlaceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.io.IOException;
import java.util.stream.Stream;

@Deprecated(forRemoval = true)
@Deprecated
class JsonEscapePlaceTest extends ExtractionTest {

public static Stream<? extends Arguments> data() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;

@Deprecated(forRemoval = true)
@Deprecated
class HtmlEscapeTest extends UnitTest {

private static final String W = "Президент Буш";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;

@Deprecated(forRemoval = true)
@Deprecated
class JsonEscapeTest extends UnitTest {
@Test
void testEscapedAngleBracketChars() {
Expand Down

0 comments on commit dde463a

Please sign in to comment.