summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorShevek <[email protected]>2015-01-01 11:12:49 -0800
committerShevek <[email protected]>2015-01-01 11:12:49 -0800
commitdfb00f41c25aa94671c494a44a89cd135336e358 (patch)
treec6bf77914ba77b0a2793a2e8fc9d410d63d2b44a /src/main
parent34f2c3f91099b19efc4ce4c5d26b8b8eedfb3aa8 (diff)
Fix some findbugs warnings.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/anarres/cpp/InputLexerSource.java2
-rw-r--r--src/main/java/org/anarres/cpp/NumericValue.java5
-rw-r--r--src/main/java/org/anarres/cpp/Preprocessor.java4
3 files changed, 6 insertions, 5 deletions
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);