Skip to content

Commit

Permalink
errorprone :: CheckedExceptionNotThrown (#967)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-mlb authored Oct 11, 2024
1 parent d96641b commit fa791af
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ public final long size() throws IOException {
* @throws IOException if an error occurs
*/
@Override
@SuppressWarnings("CheckedExceptionNotThrown")
public final SeekableByteChannel truncate(final long size) throws IOException {
throw new NonWritableChannelException();
}
Expand All @@ -200,6 +201,7 @@ public final SeekableByteChannel truncate(final long size) throws IOException {
* @param byteBuffer to write from
*/
@Override
@SuppressWarnings("CheckedExceptionNotThrown")
public final int write(final ByteBuffer byteBuffer) throws IOException {
throw new NonWritableChannelException();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emissary/output/filter/DataFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,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 {
public static void main(final String[] args) {
final String name = args.length > 0 ? args[0] : null;

final DataFilter filter = new DataFilter();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emissary/output/filter/XmlOutputFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,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 {
public static void main(String[] args) {
String name = args.length > 0 ? args[0] : null;

XmlOutputFilter filter = new XmlOutputFilter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class JournaledChannelPool implements AutoCloseable {
@Nullable
private JournaledChannel[] allchannels;

@SuppressWarnings("CheckedExceptionNotThrown")
public JournaledChannelPool(final Path directory, final String key, final int max) throws IOException {
this.max = max;
this.directory = directory;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/parser/SimpleNioParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class SimpleNioParser extends NIOSessionParser {
/**
* Create a session parser on the data
*/
@SuppressWarnings("CheckedExceptionNotThrown")
public SimpleNioParser(SeekableByteChannel channel) throws ParserException {
super(channel);
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/emissary/pickup/WorkSpace.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ public static void main(final String[] args) {
/**
* Construct the space
*/
@SuppressWarnings("CheckedExceptionNotThrown")
public WorkSpace() throws Exception {

}
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 @@ -340,7 +340,7 @@ private static String getValueForHtmlEntity(String entity) {
private HtmlEscape() {}

@SuppressWarnings("SystemOut")
public static void main(String[] args) throws Exception {
public static void main(String[] args) {
boolean useString = false;
int i = 0;
if (args.length > 0 && args[i].equals("-s")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static byte[] unescape(byte[] data) {
private JavascriptEscape() {}

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

for (; i < args.length; i++) {
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 @@ -78,7 +78,7 @@ protected static boolean isOctalDigit(byte b) {
private JsonEscape() {}

@SuppressWarnings("SystemOut")
public static void main(String[] args) throws Exception {
public static void main(String[] args) {
for (int i = 0; i < args.length; i++) {
byte[] content = Executrix.readDataFromFile(args[i]);
if (content == null) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emissary/util/magic/MagicNumberFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ private static byte[] resolveMask(String[] columns, MagicNumber item) {
// -----------------------------------------------------------------------
// COLUMN C: [UNARY_OPERATOR][Some value like 0x00]
// -----------------------------------------------------------------------
private static byte[] resolveValue(String[] columns, MagicNumber item) throws ParseException {
private static byte[] resolveValue(String[] columns, MagicNumber item) {
String subject = columns[2];

if (item.dataType == MagicNumber.TYPE_STRING && !(subject.length() == 1 && subject.charAt(0) == 'x')) {
Expand Down

0 comments on commit fa791af

Please sign in to comment.