forked from phoedos/pmd
Nice patch from Johan Stuyts to clean up various things; added unit test to nail down bug 1339470
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@3958 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -1,12 +1,14 @@
|
|||||||
<project name="pmd" default="pmd" basedir="../">
|
<project name="pmd" default="pmd" basedir="../">
|
||||||
|
|
||||||
|
<property file="bin/local.properties"/>
|
||||||
|
|
||||||
<property name="dir.lib" value="lib\"/>
|
<property name="dir.lib" value="lib\"/>
|
||||||
<property name="dir.src" value="src\"/>
|
<property name="dir.src" value="src\"/>
|
||||||
<property name="dir.build" value="build\"/>
|
<property name="dir.build" value="build\"/>
|
||||||
<property name="dir.rulesets" value="rulesets\"/>
|
<property name="dir.rulesets" value="rulesets\"/>
|
||||||
<property name="dir.regress" value="regress\"/>
|
<property name="dir.regress" value="regress\"/>
|
||||||
<property name="version" value="3.3"/>
|
<property name="version" value="3.3"/>
|
||||||
<property name="keystore" value="/home/tom/myKeyStore"/>
|
<property name="keystore" value="${keystore.path}"/>
|
||||||
|
|
||||||
<path id="dependencies.path">
|
<path id="dependencies.path">
|
||||||
<pathelement location="${dir.build}"/>
|
<pathelement location="${dir.build}"/>
|
||||||
@ -139,8 +141,8 @@
|
|||||||
<delete file="src/net/sourceforge/pmd/ast/JavaParserConstants.java"/>
|
<delete file="src/net/sourceforge/pmd/ast/JavaParserConstants.java"/>
|
||||||
<delete file="src/net/sourceforge/pmd/ast/JavaParserTreeConstants.java"/>
|
<delete file="src/net/sourceforge/pmd/ast/JavaParserTreeConstants.java"/>
|
||||||
<delete file="src/net/sourceforge/pmd/ast/JavaParserTokenManager.java"/>
|
<delete file="src/net/sourceforge/pmd/ast/JavaParserTokenManager.java"/>
|
||||||
<jjtree target="etc/grammar/Java.jjt" outputdirectory="src/net/sourceforge/pmd/ast" javacchome="/usr/local/javacc/"/>
|
<jjtree target="etc/grammar/Java.jjt" outputdirectory="src/net/sourceforge/pmd/ast" javacchome="${javacc-home.path}"/>
|
||||||
<javacc target="src/net/sourceforge/pmd/ast/Java.jj" outputdirectory="src/net/sourceforge/pmd/ast" javacchome="/usr/local/javacc/"/>
|
<javacc target="src/net/sourceforge/pmd/ast/Java.jj" outputdirectory="src/net/sourceforge/pmd/ast" javacchome="${javacc-home.path}"/>
|
||||||
<delete file="src/net/sourceforge/pmd/ast/Java.jj"/>
|
<delete file="src/net/sourceforge/pmd/ast/Java.jj"/>
|
||||||
<replace file="src/net/sourceforge/pmd/ast/JavaParserTokenManager.java" token="throw new Error" value="throw new RuntimeException"/>
|
<replace file="src/net/sourceforge/pmd/ast/JavaParserTokenManager.java" token="throw new Error" value="throw new RuntimeException"/>
|
||||||
<replace file="src/net/sourceforge/pmd/ast/JavaParser.java" token="(Error)" value="(RuntimeException)"/>
|
<replace file="src/net/sourceforge/pmd/ast/JavaParser.java" token="(Error)" value="(RuntimeException)"/>
|
||||||
@ -160,7 +162,7 @@
|
|||||||
<exclude name="SymtabManager.java"/>
|
<exclude name="SymtabManager.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
</delete>
|
</delete>
|
||||||
<javacc target="../etc/grammar/cpp.jj" outputdirectory="src/net/sourceforge/pmd/cpd/cppast" javacchome="/usr/local/javacc/"/>
|
<javacc target="../etc/grammar/cpp.jj" outputdirectory="src/net/sourceforge/pmd/cpd/cppast" javacchome="${javacc-home.path}"/>
|
||||||
<replace file="src/net/sourceforge/pmd/cpd/cppast/ParseException.java" token="extends Exception" value="extends RuntimeException"/>
|
<replace file="src/net/sourceforge/pmd/cpd/cppast/ParseException.java" token="extends Exception" value="extends RuntimeException"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
@ -198,7 +200,7 @@
|
|||||||
<taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" />
|
<taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask" />
|
||||||
<!-- ignoreIdentifiers="true" -->
|
<!-- ignoreIdentifiers="true" -->
|
||||||
<cpd ignoreLiterals="true" minimumTokenCount="20" outputFile="cpd.txt" format="text">
|
<cpd ignoreLiterals="true" minimumTokenCount="20" outputFile="cpd.txt" format="text">
|
||||||
<fileset dir="/usr/local/java/src/java/lang/ref">
|
<fileset dir="${java-source.path}/java/lang/ref">
|
||||||
<include name="**/*.java"/>
|
<include name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
</cpd>
|
</cpd>
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
package test.net.sourceforge.pmd.ast;
|
||||||
|
|
||||||
|
import test.net.sourceforge.pmd.testframework.ParserTst;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.sourceforge.pmd.ast.ASTImportDeclaration;
|
||||||
|
import net.sourceforge.pmd.ast.ParseException;
|
||||||
|
import net.sourceforge.pmd.ast.ASTInitializer;
|
||||||
|
import net.sourceforge.pmd.TargetJDK1_5;
|
||||||
|
import net.sourceforge.pmd.PMD;
|
||||||
|
|
||||||
|
public class ASTInitializerTest extends ParserTst {
|
||||||
|
|
||||||
|
public void testDontCrashOnBlockStatement() throws Throwable {
|
||||||
|
try {
|
||||||
|
getNodes(ASTInitializer.class, TEST1);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// FIXME
|
||||||
|
// e.printStackTrace();
|
||||||
|
//fail("Couldn't parse:\n" + TEST1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final String TEST1 =
|
||||||
|
"public class Foo {" + PMD.EOL +
|
||||||
|
" {" + PMD.EOL +
|
||||||
|
" x = 5;" + PMD.EOL +
|
||||||
|
" }" + PMD.EOL +
|
||||||
|
"}";
|
||||||
|
|
||||||
|
}
|
@ -45,6 +45,7 @@
|
|||||||
</subsection>
|
</subsection>
|
||||||
<subsection name="Contributors">
|
<subsection name="Contributors">
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>Johan Stuyts - nice patch to clean up build environment</li>
|
||||||
<li>Brian Remedios - code improvements to Eclipse plugin</li>
|
<li>Brian Remedios - code improvements to Eclipse plugin</li>
|
||||||
<li>Chris Grindstaff - fixed SWTException when Eclipse plugin is run on a file with syntax error</li>
|
<li>Chris Grindstaff - fixed SWTException when Eclipse plugin is run on a file with syntax error</li>
|
||||||
<li>Eduard Naum - fixed JDK 1.3 runtime problems in Eclipse plugin</li>
|
<li>Eduard Naum - fixed JDK 1.3 runtime problems in Eclipse plugin</li>
|
||||||
|
Reference in New Issue
Block a user