From dfb00f41c25aa94671c494a44a89cd135336e358 Mon Sep 17 00:00:00 2001 From: Shevek Date: Thu, 1 Jan 2015 11:12:49 -0800 Subject: Fix some findbugs warnings. --- src/main/java/org/anarres/cpp/InputLexerSource.java | 2 +- src/main/java/org/anarres/cpp/NumericValue.java | 5 +++-- src/main/java/org/anarres/cpp/Preprocessor.java | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main/java/org/anarres/cpp/InputLexerSource.java b/src/main/java/org/anarres/cpp/InputLexerSource.java index ab2e397..93cda54 100644 --- a/src/main/java/org/anarres/cpp/InputLexerSource.java +++ b/src/main/java/org/anarres/cpp/InputLexerSource.java @@ -59,6 +59,6 @@ public class InputLexerSource extends LexerSource { @Override public String toString() { - return getPath(); + return String.valueOf(getPath()); } } diff --git a/src/main/java/org/anarres/cpp/NumericValue.java b/src/main/java/org/anarres/cpp/NumericValue.java index 52fd2d8..e4235d3 100644 --- a/src/main/java/org/anarres/cpp/NumericValue.java +++ b/src/main/java/org/anarres/cpp/NumericValue.java @@ -103,8 +103,9 @@ public class NumericValue extends Number { // XXX Wrong for anything but base 10. scale += t_fraction.length(); } - if (getExponent() != null) - scale -= Integer.parseInt(getExponent()); + String t_exponent = getExponent(); + if (t_exponent != null) + scale -= Integer.parseInt(t_exponent); BigInteger unscaled = new BigInteger(text, getBase()); return new BigDecimal(unscaled, scale); } diff --git a/src/main/java/org/anarres/cpp/Preprocessor.java b/src/main/java/org/anarres/cpp/Preprocessor.java index 5dacc91..27f609f 100644 --- a/src/main/java/org/anarres/cpp/Preprocessor.java +++ b/src/main/java/org/anarres/cpp/Preprocessor.java @@ -511,7 +511,7 @@ public class Preprocessor implements Closeable { * @see #push_source(Source,boolean) * @see #pop_source() */ - @CheckForNull + // @CheckForNull protected Source getSource() { return source; } @@ -522,7 +522,7 @@ public class Preprocessor implements Closeable { * @see #getSource() * @see #pop_source() */ - protected void push_source(Source source, boolean autopop) { + protected void push_source(@Nonnull Source source, boolean autopop) { source.init(this); source.setParent(this.source, autopop); // source.setListener(listener); -- cgit v1.2.3