diff --git a/pmd/etc/build.xml b/pmd/etc/build.xml
index db1348ef4d..b00817c268 100644
--- a/pmd/etc/build.xml
+++ b/pmd/etc/build.xml
@@ -86,6 +86,12 @@
+
+
+
+
+
+
diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt
index 35f187ac46..91590e4168 100644
--- a/pmd/etc/changelog.txt
+++ b/pmd/etc/changelog.txt
@@ -6,6 +6,7 @@ Fixed bug 674393 - OnlyOneReturn rule no longer counts returns that are inside a
Fixed bug 674420 - AvoidReassigningParametersRule no longer counts parameter field reassignment as a violation. Thx to C. Lamont Gilbert for the bug report.
Fixed bug 673662 - The Ant task's "failOnError" attribute works again. Changed the semantics of this attribute, though, so it fails the build if errors occurred. A new attribute 'failOnRuleViolation' serves the purpose of stopping the build if rule violations are found.
Fixed bug 676340 - Symbol table now creates new scope level when it encounters a switch statement. See the bug for code details; generally, this bug would have triggered runtime exceptions on certain blocks of code.
+Fixed bug 683465 - JavaCC parser no longer has ability to throw java.lang.Error; now it only throws java.lang.RuntimeExceptions. Thx to Gunnlaugur Thor Briem for a good discussion on this topic.
Fixed bug in OverrideBothEqualsAndHashcodeRule - it no longer bails out with a NullPtrException on interfaces that declare a method signature "equals(Object)". Thx to Don Leckie for catching that.
Added an optional Ant task formatter attribute 'isReportFilePathAbsolute'. Thx to Andriy Rozeluk for the feedback.
Added an optional Ant task attribute 'failOnRuleViolation'. This stops the build if any rule violations are found.
diff --git a/pmd/etc/scp.bat b/pmd/etc/scp.bat
index 23175fa685..844a43d374 100755
--- a/pmd/etc/scp.bat
+++ b/pmd/etc/scp.bat
@@ -3,7 +3,6 @@ set CVSROOT=:ext:tomcopeland@cvs.pmd.sourceforge.net:/cvsroot/pmd
set CVS_RSH=c:\bin\ssh\ssh
set HOME=c:
set ANT_HOME=c:\ant
-set PATH=%PATH%;c:\maven\bin
set CLASSPATH=../build/
set CLASSPATH=%CLASSPATH%;../test-data/
set CLASSPATH=%CLASSPATH%;../
diff --git a/pmd/src/net/sourceforge/pmd/ast/JavaCharStream.java b/pmd/src/net/sourceforge/pmd/ast/JavaCharStream.java
index a6f5bdb419..646a4d0625 100644
--- a/pmd/src/net/sourceforge/pmd/ast/JavaCharStream.java
+++ b/pmd/src/net/sourceforge/pmd/ast/JavaCharStream.java
@@ -118,7 +118,7 @@ public final class JavaCharStream
}
catch (Throwable t)
{
- throw new Error(t.getMessage());
+ throw new RuntimeException(t.getMessage());
}
available = (bufsize += 2048);
@@ -317,7 +317,7 @@ public final class JavaCharStream
}
catch(java.io.IOException e)
{
- throw new Error("Invalid escape character at line " + line +
+ throw new RuntimeException("Invalid escape character at line " + line +
" column " + column + ".");
}
diff --git a/pmd/src/net/sourceforge/pmd/ast/JavaParser.java b/pmd/src/net/sourceforge/pmd/ast/JavaParser.java
index 0a9ee1136e..afeaadf3c5 100644
--- a/pmd/src/net/sourceforge/pmd/ast/JavaParser.java
+++ b/pmd/src/net/sourceforge/pmd/ast/JavaParser.java
@@ -71,13 +71,13 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
- throw new Error("Missing return statement in function");
+ throw new RuntimeException("Missing return statement in function");
}
final public void PackageDeclaration() throws ParseException {
@@ -102,7 +102,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -142,7 +142,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -188,7 +188,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -255,7 +255,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -304,7 +304,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -369,7 +369,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -448,7 +448,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -514,7 +514,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -597,7 +597,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -653,7 +653,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -725,7 +725,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -801,7 +801,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -863,7 +863,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -957,7 +957,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -994,7 +994,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -1091,7 +1091,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -1173,7 +1173,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -1284,7 +1284,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -1327,7 +1327,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -1386,7 +1386,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -1423,7 +1423,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -1546,7 +1546,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -1618,7 +1618,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -1654,7 +1654,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -1716,7 +1716,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -1830,7 +1830,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -1902,7 +1902,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -1953,7 +1953,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -2367,7 +2367,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -2396,7 +2396,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -2539,7 +2539,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -2609,7 +2609,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -2646,7 +2646,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -2726,7 +2726,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -2790,7 +2790,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -2847,7 +2847,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -2949,7 +2949,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -2990,7 +2990,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3053,7 +3053,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3130,7 +3130,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3238,7 +3238,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3268,7 +3268,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3348,7 +3348,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3431,7 +3431,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3481,7 +3481,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3604,7 +3604,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3701,7 +3701,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3743,7 +3743,7 @@ public class JavaParser/*@bgen(jjtree)*/implements JavaParserTreeConstants, Java
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3790,7 +3790,7 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false;
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3822,7 +3822,7 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false;
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3856,7 +3856,7 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false;
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -3984,7 +3984,7 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false;
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -4046,7 +4046,7 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false;
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -4087,7 +4087,7 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false;
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -4115,7 +4115,7 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false;
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -4224,7 +4224,7 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false;
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -4254,7 +4254,7 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false;
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -4286,7 +4286,7 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false;
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -4351,7 +4351,7 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false;
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
@@ -4390,7 +4390,7 @@ jjtree.openNodeScope(jjtn000);boolean hasElse = false;
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
- {if (true) throw (Error)jjte000;}
+ {if (true) throw (RuntimeException)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
diff --git a/pmd/src/net/sourceforge/pmd/ast/JavaParserTokenManager.java b/pmd/src/net/sourceforge/pmd/ast/JavaParserTokenManager.java
index 9a735e79d7..2e94a85d58 100644
--- a/pmd/src/net/sourceforge/pmd/ast/JavaParserTokenManager.java
+++ b/pmd/src/net/sourceforge/pmd/ast/JavaParserTokenManager.java
@@ -1464,7 +1464,7 @@ protected char curChar;
public JavaParserTokenManager(JavaCharStream stream)
{
if (JavaCharStream.staticFlag)
- throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
+ throw new RuntimeException("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
input_stream = stream;
}
public JavaParserTokenManager(JavaCharStream stream, int lexState)
diff --git a/pmd/src/net/sourceforge/pmd/ast/TokenMgrError.java b/pmd/src/net/sourceforge/pmd/ast/TokenMgrError.java
index a937e66bd1..a866926fc7 100644
--- a/pmd/src/net/sourceforge/pmd/ast/TokenMgrError.java
+++ b/pmd/src/net/sourceforge/pmd/ast/TokenMgrError.java
@@ -1,7 +1,7 @@
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 2.1 */
package net.sourceforge.pmd.ast;
-public class TokenMgrError extends Error
+public class TokenMgrError extends RuntimeException
{
/*
* Ordinals for various reasons why an Error of this type can be thrown.
diff --git a/pmd/src/net/sourceforge/pmd/rules/SymbolTableTestRule.java b/pmd/src/net/sourceforge/pmd/rules/SymbolTableTestRule.java
index 4708a949c7..aa922b3b37 100644
--- a/pmd/src/net/sourceforge/pmd/rules/SymbolTableTestRule.java
+++ b/pmd/src/net/sourceforge/pmd/rules/SymbolTableTestRule.java
@@ -6,12 +6,12 @@ import net.sourceforge.pmd.ast.ASTPrimarySuffix;
import net.sourceforge.pmd.ast.ASTPrimaryPrefix;
import net.sourceforge.pmd.ast.ASTName;
import net.sourceforge.pmd.ast.ASTExplicitConstructorInvocation;
+import net.sourceforge.pmd.ast.ASTArguments;
public class SymbolTableTestRule extends AbstractRule implements Rule {
public Object visit(ASTExplicitConstructorInvocation node, Object data) {
- System.out.println("ASTExplicitConstructorInvocation: isSuper: " + node.isSuper());
- System.out.println("ASTExplicitConstructorInvocation: isThis: " + node.isThis());
+ System.out.println("ASTExplicitConstructorInvocation: arg count = " + ((ASTArguments)node.jjtGetChild(0)).getArgumentCount());
return super.visit(node,data);
}
diff --git a/pmd/xdocs/credits.xml b/pmd/xdocs/credits.xml
index 2da26c55a7..495d8eb876 100644
--- a/pmd/xdocs/credits.xml
+++ b/pmd/xdocs/credits.xml
@@ -10,6 +10,7 @@
+ - Gunnlaugur Thor Briem - bug report on JavaCC parser's use of java.lang.Error
- C. Lamont Gilbert - bug reports, feature requests, and documentation improvements
- Vladimir Bossicard - numerous feature requests and bug reports, several rule suggestions derived from JUnit-Addons, evangelism :-)
- Frédéric Harper - bug report and subsequent troubleshooting