Merge branch 'main' into issue-5249-5250

This commit is contained in:
Andreas Dangel
2024-10-18 16:30:01 +02:00
26 changed files with 563 additions and 282 deletions

View File

@ -7819,6 +7819,33 @@
"contributions": [ "contributions": [
"bug" "bug"
] ]
},
{
"login": "gudzpoz",
"name": "gudzpoz",
"avatar_url": "https://avatars.githubusercontent.com/u/14026120?v=4",
"profile": "https://kyo.iroiro.party/",
"contributions": [
"bug"
]
},
{
"login": "phansys",
"name": "Javier Spagnoletti",
"avatar_url": "https://avatars.githubusercontent.com/u/1231441?v=4",
"profile": "https://github.com/phansys",
"contributions": [
"bug"
]
},
{
"login": "Aryant-Tripathi",
"name": "Aryant Tripathi",
"avatar_url": "https://avatars.githubusercontent.com/u/60316716?v=4",
"profile": "https://github.com/Aryant-Tripathi",
"contributions": [
"code"
]
} }
], ],
"contributorsPerLine": 7, "contributorsPerLine": 7,

View File

@ -11,10 +11,11 @@
- root-node-name: name of the root node without prefix (eg "TopLevel"), will be made to implement RootNode - root-node-name: name of the root node without prefix (eg "TopLevel"), will be made to implement RootNode
See AntlrGeneratedParserBase See AntlrGeneratedParserBase
--> -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
<property name="target-package-dir" value="${antlr4.outputDirectory}/net/sourceforge/pmd/lang/${lang-id}/ast"/> <property name="target-package-dir" value="${antlr4.outputDirectory}/net/sourceforge/pmd/lang/${lang-id}/ast"/>
<property name="stamp-file" value="${project.build.directory}/last-generated-timestamp" />
<property name="lang-ast-package" value="net.sourceforge.pmd.lang.${lang-id}.ast" /> <property name="lang-ast-package" value="net.sourceforge.pmd.lang.${lang-id}.ast" />
@ -32,14 +33,100 @@
<property name="base-visitor-file" value="${target-package-dir}/${base-visitor-name}.java"/> <property name="base-visitor-file" value="${target-package-dir}/${base-visitor-name}.java"/>
<property name="listener-name" value="${lang-name}Listener"/> <property name="listener-name" value="${lang-name}Listener"/>
<property name="listener-file" value="${target-package-dir}/${visitor-name}.java"/> <property name="listener-file" value="${target-package-dir}/${listener-name}.java"/>
<property name="base-listener-name" value="${lang-name}BaseListener"/> <property name="base-listener-name" value="${lang-name}BaseListener"/>
<property name="base-listener-file" value="${target-package-dir}/${base-visitor-name}.java"/> <property name="base-listener-file" value="${target-package-dir}/${base-listener-name}.java"/>
<property name="node-itf-name" value="${lang-name}Node"/> <property name="node-itf-name" value="${lang-name}Node"/>
<property name="base-class-name" value="Abstract${lang-name}Node"/> <property name="base-class-name" value="Abstract${lang-name}Node"/>
<property name="lexer-name" value="${lang-name}Lexer"/>
<property name="lexer-file" value="${target-package-dir}/${lexer-name}.java"/>
<target name="check-up-to-date"
description="Checks the input files are up to date">
<uptodate property="processing-not-required" targetfile="${stamp-file}">
<srcfiles dir="${target-package-dir}" includes="*.java" />
<srcfiles file="${ant.file}" />
</uptodate>
<echo message="Up-to-date check: processing-not-required=${processing-not-required}" />
</target>
<target name="update-stamp-file" unless="processing-not-required">
<touch file="${stamp-file}" />
</target>
<target name="annotate-classes" description="Adds the @Generated annotation to all classes"
unless="processing-not-required">
<if>
<available file="${parser-file}"/>
<then>
<replace file="${parser-file}"
token="public class ${parser-name}"
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public class ${parser-name}'/>
<!-- Parse tree classes for each element -->
<replace file="${parser-file}"
token="public static class "
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public static class '/>
</then>
</if>
<if>
<available file="${visitor-file}"/>
<then>
<replace file="${visitor-file}"
token="public interface ${visitor-name}"
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public interface ${visitor-name}'/>
</then>
</if>
<if>
<available file="${base-visitor-file}"/>
<then>
<replace file="${base-visitor-file}"
token="public class ${base-visitor-name}"
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public class ${base-visitor-name}'/>
</then>
</if>
<if>
<available file="${listener-file}"/>
<then>
<replace file="${listener-file}"
token="public interface ${listener-name}"
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public interface ${listener-name}'/>
</then>
</if>
<if>
<available file="${base-listener-file}"/>
<then>
<replace file="${base-listener-file}"
token="public class ${base-listener-name}"
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public class ${base-listener-name}'/>
</then>
</if>
<if>
<available file="${lexer-file}"/>
<then>
<replace file="${lexer-file}"
token="public class ${lexer-name}"
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public class ${lexer-name}'/>
</then>
</if>
</target>
<condition property="rename-parser"> <condition property="rename-parser">
<and> <and>
<not> <not>
@ -72,7 +159,9 @@
tofile="${parser-file}"/> tofile="${parser-file}"/>
</target> </target>
<target name="cpd-language" description="Adapt Antlr sources for CPD-only languages"> <target name="cpd-language" depends="check-up-to-date, annotate-classes, cpd-language-processing, update-stamp-file"/>
<target name="cpd-language-processing" description="Adapt Antlr sources for CPD-only languages"
unless="processing-not-required">
<!-- We only need the Lexer file. --> <!-- We only need the Lexer file. -->
<delete file="${parser-file}"/> <delete file="${parser-file}"/>
<delete> <delete>
@ -83,7 +172,9 @@
</delete> </delete>
</target> </target>
<target name="pmd-language" description="Adapt Antlr sources for PMD languages" depends="rename-parser"> <target name="pmd-language" depends="check-up-to-date, annotate-classes, pmd-language-processing, update-stamp-file"/>
<target name="pmd-language-processing" description="Adapt Antlr sources for PMD languages" depends="rename-parser"
unless="processing-not-required">
<!-- Adapt parser. --> <!-- Adapt parser. -->
<replace file="${parser-file}"> <replace file="${parser-file}">

File diff suppressed because it is too large Load Diff

View File

@ -33,6 +33,9 @@ The old rule names still work but are deprecated.
### 🐛 Fixed Issues ### 🐛 Fixed Issues
* java * java
* [#4532](https://github.com/pmd/pmd/issues/4532): \[java] Rule misnomer for JUnit* rules * [#4532](https://github.com/pmd/pmd/issues/4532): \[java] Rule misnomer for JUnit* rules
* [#5261](https://github.com/pmd/pmd/issues/5261): \[java] Record patterns with empty deconstructor lists lead to NPE
* java-codestyle
* [#5253](https://github.com/pmd/pmd/issues/5253): \[java] BooleanGetMethodName: False-negatives with `Boolean` wrapper
* java-errorprone * java-errorprone
* [#5067](https://github.com/pmd/pmd/issues/5067): \[java] CloseResource: False positive for FileSystems.getDefault() * [#5067](https://github.com/pmd/pmd/issues/5067): \[java] CloseResource: False positive for FileSystems.getDefault()
* java-performance * java-performance
@ -52,9 +55,14 @@ The old rule names still work but are deprecated.
### ✨ Merged pull requests ### ✨ Merged pull requests
* [#4965](https://github.com/pmd/pmd/pull/4965): \[java] Rename JUnit rules with overly restrictive names - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) * [#4965](https://github.com/pmd/pmd/pull/4965): Fix #4532: \[java] Rename JUnit rules with overly restrictive names - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod)
* [#5225](https://github.com/pmd/pmd/pull/5225): \[java] Fix #5067: CloseResource: False positive for FileSystems.getDefault() - [Lukas Gräf](https://github.com/lukasgraef) (@lukasgraef) * [#5225](https://github.com/pmd/pmd/pull/5225): Fix #5067: \[java] CloseResource: False positive for FileSystems.getDefault() - [Lukas Gräf](https://github.com/lukasgraef) (@lukasgraef)
* [#5241](https://github.com/pmd/pmd/pull/5241): Ignore javacc code in coverage report - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod) * [#5241](https://github.com/pmd/pmd/pull/5241): Ignore javacc code in coverage report - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod)
* [#5258](https://github.com/pmd/pmd/pull/5258): Ignore generated antlr classes in coverage reports - [Juan Martín Sotuyo Dodero](https://github.com/jsotuyod) (@jsotuyod)
* [#5264](https://github.com/pmd/pmd/pull/5264): Fix #5261: \[java] Fix NPE with empty pattern list - [Clément Fournier](https://github.com/oowekyala) (@oowekyala)
* [#5269](https://github.com/pmd/pmd/pull/5269): Fix #5253: \[java] Support Boolean wrapper class for BooleanGetMethodName rule - [Aryant Tripathi](https://github.com/Aryant-Tripathi) (@Aryant-Tripathi)
* [#5275](https://github.com/pmd/pmd/pull/5275): Use plugin-classpath to simplify javacc-wrapper.xml - [Andreas Dangel](https://github.com/adangel) (@adangel)
* [#5278](https://github.com/pmd/pmd/pull/5278): \[java] CouplingBetweenObjects: improve violation message - [Andreas Dangel](https://github.com/adangel) (@adangel)
{% endtocmaker %} {% endtocmaker %}

View File

@ -25,9 +25,9 @@
It also uses the following maven properties: It also uses the following maven properties:
- javacc.outputDirectory: Directory in which to root the generated package tree - javacc.outputDirectory: Directory in which to root the generated package tree
- javacc.jar: JAR of JavaCC in the local maven repository - plugin-classpath: The classpath of maven-antrun-plugin with javacc.jar dependency
Provided by maven via "<property name="plugin-classpath" refid="maven.plugin.classpath"/>"
- some properties of project.build - some properties of project.build
--> -->
<condition property="lang-name-camelcase" value="${lang-name}"> <condition property="lang-name-camelcase" value="${lang-name}">
@ -40,8 +40,6 @@
<property name="target-package-dir" value="${javacc.outputDirectory}/net/sourceforge/pmd/lang/${lang-id}/ast" /> <property name="target-package-dir" value="${javacc.outputDirectory}/net/sourceforge/pmd/lang/${lang-id}/ast" />
<property name="stamp-file" value="${project.build.directory}/last-generated-timestamp" /> <property name="stamp-file" value="${project.build.directory}/last-generated-timestamp" />
<property name="javacc-home.path" value="${project.build.directory}/lib/javacc" />
<property name="lang-ast-package" value="net.sourceforge.pmd.lang.${lang-id}.ast" /> <property name="lang-ast-package" value="net.sourceforge.pmd.lang.${lang-id}.ast" />
<property name="ast-api-package" value="net.sourceforge.pmd.lang.ast" /> <property name="ast-api-package" value="net.sourceforge.pmd.lang.ast" />
<property name="ast-impl-package" value="${ast-api-package}.impl.javacc" /> <property name="ast-impl-package" value="${ast-api-package}.impl.javacc" />
@ -84,7 +82,7 @@
<target name="alljavacc" <target name="alljavacc"
description="Generates JavaCC sources and cleans them up" description="Generates JavaCC sources and cleans them up"
depends="checkUpToDate,init,jjtree,jjtree-ersatz,javacc,adapt-generated,default-visitor,cleanup" /> depends="checkUpToDate,init,jjtree,jjtree-ersatz,javacc,adapt-generated,default-visitor" />
<target name="checkUpToDate" <target name="checkUpToDate"
description="Checks the input files are up to date"> description="Checks the input files are up to date">
@ -104,9 +102,6 @@
<target name="init" unless="javaccBuildNotRequired" description="Initialize build"> <target name="init" unless="javaccBuildNotRequired" description="Initialize build">
<mkdir dir="${javacc-home.path}" />
<copy file="${javacc.jar}" tofile="${javacc-home.path}/javacc.jar" />
<mkdir dir="${javacc.outputDirectory}" /> <mkdir dir="${javacc.outputDirectory}" />
<touch file="${stamp-file}" /> <touch file="${stamp-file}" />
<delete dir="${target-package-dir}" /> <delete dir="${target-package-dir}" />
@ -117,11 +112,6 @@
</condition> </condition>
</target> </target>
<target name="cleanup" unless="javaccBuildNotRequired">
<delete dir="${javacc-home.path}" />
</target>
<target name="jjtree" unless="jjtreeBuildNotRequired" description="Runs JJTree"> <target name="jjtree" unless="jjtreeBuildNotRequired" description="Runs JJTree">
<!-- <!--
@ -130,7 +120,7 @@
--> -->
<java fork="true" <java fork="true"
classname="jjtree" classname="jjtree"
classpath="${javacc-home.path}/javacc.jar"> classpath="${plugin-classpath}">
<sysproperty key="file.encoding" value="UTF-8" /> <sysproperty key="file.encoding" value="UTF-8" />
<arg value="-OUTPUT_DIRECTORY:${target-package-dir}" /> <arg value="-OUTPUT_DIRECTORY:${target-package-dir}" />
<arg value="-NODE_USES_PARSER:false" /> <arg value="-NODE_USES_PARSER:false" />
@ -148,7 +138,7 @@
<target name="javacc" depends="jjtree" unless="javaccBuildNotRequired"> <target name="javacc" depends="jjtree" unless="javaccBuildNotRequired">
<java fork="true" <java fork="true"
classname="javacc" classname="javacc"
classpath="${javacc-home.path}/javacc.jar"> classpath="${plugin-classpath}">
<sysproperty key="file.encoding" value="UTF-8" /> <sysproperty key="file.encoding" value="UTF-8" />
<arg value="-STATIC:false" /> <arg value="-STATIC:false" />
<arg value="-USER_CHAR_STREAM:true" /> <arg value="-USER_CHAR_STREAM:true" />

View File

@ -11,7 +11,7 @@ import java.lang.annotation.RetentionPolicy;
/** /**
* Marks a class as generated code, and therefore to be ignored for code coverage purposes. * Marks a class as generated code, and therefore to be ignored for code coverage purposes.
* *
* @since 7.6.0 * @since 7.7.0
*/ */
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Documented @Documented

View File

@ -34,10 +34,10 @@
<configuration> <configuration>
<target> <target>
<ant antfile="${javacc.ant.wrapper}" target="alljavacc"> <ant antfile="${javacc.ant.wrapper}" target="alljavacc">
<property name="plugin-classpath" refid="maven.plugin.classpath"/>
<property name="no-jjtree" value="true" /> <!-- This is a CPD module --> <property name="no-jjtree" value="true" /> <!-- This is a CPD module -->
<property name="lang-name" value="Cpp" /> <property name="lang-name" value="Cpp" />
<property name="lang-id" value="cpp" /> <property name="lang-id" value="cpp" />
<property name="javacc.jar" value="${javacc.jar}" />
</ant> </ant>
</target> </target>
</configuration> </configuration>

View File

@ -1889,13 +1889,13 @@ void RecordPattern():
(Annotation())* ReferenceType() RecordStructurePattern() (Annotation())* ReferenceType() RecordStructurePattern()
} }
void RecordStructurePattern() #void: void RecordStructurePattern() #PatternList:
{} {}
{ {
"(" [ ComponentPatternList() ] ")" "(" [ ComponentPatternList() ] ")"
} }
void ComponentPatternList() #PatternList : void ComponentPatternList() #void :
{} {}
{ {
ComponentPattern() ( "," ComponentPattern() )* ComponentPattern() ( "," ComponentPattern() )*

View File

@ -105,7 +105,7 @@
<configuration> <configuration>
<target> <target>
<ant antfile="${javacc.ant.wrapper}" target="alljavacc"> <ant antfile="${javacc.ant.wrapper}" target="alljavacc">
<property name="javacc.jar" value="${javacc.jar}" /> <property name="plugin-classpath" refid="maven.plugin.classpath"/>
<property name="lang-name" value="Java" /> <property name="lang-name" value="Java" />
<property name="lang-id" value="java" /> <property name="lang-id" value="java" />
</ant> </ant>

View File

@ -52,9 +52,9 @@ public class CouplingBetweenObjectsRule extends AbstractJavaRule {
public Object visit(ASTCompilationUnit cu, Object data) { public Object visit(ASTCompilationUnit cu, Object data) {
super.visit(cu, data); super.visit(cu, data);
if (couplingCount > getProperty(THRESHOLD_DESCRIPTOR)) { Integer threshold = getProperty(THRESHOLD_DESCRIPTOR);
asCtx(data).addViolation(cu, if (couplingCount > threshold) {
"A value of " + couplingCount + " may denote a high amount of coupling within the class"); asCtx(data).addViolation(cu, couplingCount, threshold);
} }
couplingCount = 0; couplingCount = 0;

View File

@ -172,32 +172,33 @@ public class SomeJNIClass {
<rule name="BooleanGetMethodName" <rule name="BooleanGetMethodName"
language="java" language="java"
since="4.0" since="4.0"
message="A 'getX()' method which returns a boolean should be named 'isX()'" message="A 'getX()' method which returns a boolean or Boolean should be named 'isX()'"
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule" class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_codestyle.html#booleangetmethodname"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_codestyle.html#booleangetmethodname">
<description> <description>
Methods that return boolean results should be named as predicate statements to denote this. Methods that return boolean or Boolean results should be named as predicate statements to denote this.
I.e, 'isReady()', 'hasValues()', 'canCommit()', 'willFail()', etc. Avoid the use of the 'get' I.e., 'isReady()', 'hasValues()', 'canCommit()', 'willFail()', etc. Avoid the use of the 'get' prefix for these methods.
prefix for these methods.
</description> </description>
<priority>4</priority> <priority>4</priority>
<properties> <properties>
<property name="xpath"> <property name="xpath">
<value> <value>
<![CDATA[ <![CDATA[
//MethodDeclaration //MethodDeclaration
[starts-with(@Name, 'get')] [starts-with(@Name, 'get')]
[@Arity = 0 or $checkParameterizedMethods = true()] [@Arity = 0 or $checkParameterizedMethods = true()]
[ PrimitiveType[@Kind = 'boolean'] and @Overridden = false() ] [ (PrimitiveType[@Kind = 'boolean'] or ClassType[pmd-java:typeIs('java.lang.Boolean')]) and @Overridden = false() ]
]]> ]]>
</value> </value>
</property> </property>
<property name="checkParameterizedMethods" type="Boolean" description="Check parameterized methods" value="false"/> <property name="checkParameterizedMethods" type="Boolean" description="Check parameterized methods" value="false"/>
</properties> </properties>
<example> <example>
<![CDATA[ <![CDATA[
public boolean getFoo(); // bad public boolean getFoo(); // bad
public Boolean getFoo(); // bad
public boolean isFoo(); // ok public boolean isFoo(); // ok
public Boolean isFoo(); // ok
public boolean getFoo(boolean bar); // ok, unless checkParameterizedMethods=true public boolean getFoo(boolean bar); // ok, unless checkParameterizedMethods=true
]]> ]]>
</example> </example>

View File

@ -377,7 +377,7 @@ class Foo {
<rule name="CouplingBetweenObjects" <rule name="CouplingBetweenObjects"
language="java" language="java"
since="1.04" since="1.04"
message="High amount of different objects as members denotes a high coupling" message="A value of {0} may denote a high amount of coupling within the class (threshold: {1})"
class="net.sourceforge.pmd.lang.java.rule.design.CouplingBetweenObjectsRule" class="net.sourceforge.pmd.lang.java.rule.design.CouplingBetweenObjectsRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_design.html#couplingbetweenobjects"> externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_design.html#couplingbetweenobjects">
<description> <description>

View File

@ -97,4 +97,14 @@ public class RecordPatterns {
System.out.println("String " + s); System.out.println("String " + s);
} }
} }
record Empty(){}
void foo(Object o) {
if (o instanceof Empty
|| o instanceof Empty())
System.out.println("Empty " + o);
}
;
} }

View File

@ -1,7 +1,7 @@
+- CompilationUnit[@PackageName = ""] +- CompilationUnit[@PackageName = ""]
+- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns", @CanonicalName = "RecordPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatterns", @Static = false, @TopLevel = true, @UnnamedToplevelClass = false, @Visibility = Visibility.V_PUBLIC] +- ClassDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns", @CanonicalName = "RecordPatterns", @EffectiveVisibility = Visibility.V_PUBLIC, @Enum = false, @Final = false, @Interface = false, @Local = false, @Nested = false, @PackageName = "", @Record = false, @RegularClass = true, @RegularInterface = false, @SimpleName = "RecordPatterns", @Static = false, @TopLevel = true, @UnnamedToplevelClass = false, @Visibility = Visibility.V_PUBLIC]
+- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)] +- ModifierList[@EffectiveModifiers = (JModifier.PUBLIC), @ExplicitModifiers = (JModifier.PUBLIC)]
+- ClassBody[@Empty = false, @Size = 18] +- ClassBody[@Empty = false, @Size = 21]
+- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Point", @CanonicalName = "RecordPatterns.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @UnnamedToplevelClass = false, @Visibility = Visibility.V_PACKAGE] +- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Point", @CanonicalName = "RecordPatterns.Point", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Point", @Static = true, @TopLevel = false, @UnnamedToplevelClass = false, @Visibility = Visibility.V_PACKAGE]
| +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()] | +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()]
| +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false] | +- RecordComponentList[@Empty = false, @Size = 2, @Varargs = false]
@ -512,38 +512,73 @@
| +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
+- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test4", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true] +- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "test4", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
+- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
+- VoidType[] | +- VoidType[]
+- FormalParameters[@Empty = false, @Size = 1] | +- FormalParameters[@Empty = false, @Size = 1]
| +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL] | | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
| +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"]
| | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"]
| | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1] | | | +- TypeArguments[@Diamond = false, @Empty = false, @Size = 1]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"] | | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "String"]
| +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "bo", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL]
+- Block[@Empty = false, @Size = 1, @containsComment = false] | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+- IfStatement[@Else = false] | +- IfStatement[@Else = false]
+- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false] | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "bo", @Name = "bo", @ParenthesisDepth = 0, @Parenthesized = false]
| +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| +- RecordPattern[] | | +- RecordPattern[]
| +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"]
| +- PatternList[@Empty = false, @Size = 1] | | +- PatternList[@Empty = false, @Size = 1]
| +- RecordPattern[] | | +- RecordPattern[]
| +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"] | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Box"]
| +- PatternList[@Empty = false, @Size = 1] | | +- PatternList[@Empty = false, @Size = 1]
| +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE] | | +- TypePattern[@EffectiveVisibility = Visibility.V_PACKAGE, @Visibility = Visibility.V_PACKAGE]
| +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()] | | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_LOCAL] | | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = false, @LambdaParameter = false, @LocalVariable = false, @Name = "s", @PatternBinding = true, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = true, @Unnamed = false, @Visibility = Visibility.V_LOCAL]
+- Block[@Empty = false, @Size = 1, @containsComment = false] | +- Block[@Empty = false, @Size = 1, @containsComment = false]
+- ExpressionStatement[] | +- ExpressionStatement[]
+- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false] | +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
+- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false] | +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
| +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false] | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"] | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"]
+- ArgumentList[@Empty = false, @Size = 1] | +- ArgumentList[@Empty = false, @Size = 1]
+- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false] | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
+- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false] | +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "String ", @Empty = false, @Image = "\"String \"", @Length = 7, @LiteralText = "\"String \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
+- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false] | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "s", @Name = "s", @ParenthesisDepth = 0, @Parenthesized = false]
+- RecordDeclaration[@Abstract = false, @Annotation = false, @Anonymous = false, @BinaryName = "RecordPatterns$Empty", @CanonicalName = "RecordPatterns.Empty", @EffectiveVisibility = Visibility.V_PACKAGE, @Enum = false, @Final = true, @Interface = false, @Local = false, @Nested = true, @PackageName = "", @Record = true, @RegularClass = false, @RegularInterface = false, @SimpleName = "Empty", @Static = true, @TopLevel = false, @UnnamedToplevelClass = false, @Visibility = Visibility.V_PACKAGE]
| +- ModifierList[@EffectiveModifiers = (JModifier.STATIC, JModifier.FINAL), @ExplicitModifiers = ()]
| +- RecordComponentList[@Empty = true, @Size = 0, @Varargs = false]
| +- RecordBody[@Empty = true, @Size = 0]
+- MethodDeclaration[@Abstract = false, @Arity = 1, @EffectiveVisibility = Visibility.V_PACKAGE, @Final = false, @Name = "foo", @Overridden = false, @Static = false, @Varargs = false, @Visibility = Visibility.V_PACKAGE, @Void = true]
| +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| +- VoidType[]
| +- FormalParameters[@Empty = false, @Size = 1]
| | +- FormalParameter[@EffectiveVisibility = Visibility.V_LOCAL, @Final = false, @Varargs = false, @Visibility = Visibility.V_LOCAL]
| | +- ModifierList[@EffectiveModifiers = (), @ExplicitModifiers = ()]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Object"]
| | +- VariableId[@ArrayType = false, @EffectiveVisibility = Visibility.V_LOCAL, @EnumConstant = false, @ExceptionBlockParameter = false, @Field = false, @Final = false, @ForLoopVariable = false, @ForeachVariable = false, @FormalParameter = true, @LambdaParameter = false, @LocalVariable = false, @Name = "o", @PatternBinding = false, @RecordComponent = false, @ResourceDeclaration = false, @Static = false, @TypeInferred = false, @Unnamed = false, @Visibility = Visibility.V_LOCAL]
| +- Block[@Empty = false, @Size = 1, @containsComment = false]
| +- IfStatement[@Else = false]
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.CONDITIONAL_OR, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Empty"]
| | +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.INSTANCEOF, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- PatternExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- RecordPattern[]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "Empty"]
| | +- PatternList[@Empty = true, @Size = 0]
| +- ExpressionStatement[]
| +- MethodCall[@CompileTimeConstant = false, @Image = "println", @MethodName = "println", @ParenthesisDepth = 0, @Parenthesized = false]
| +- FieldAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "out", @Name = "out", @ParenthesisDepth = 0, @Parenthesized = false]
| | +- TypeExpression[@CompileTimeConstant = false, @ParenthesisDepth = 0, @Parenthesized = false]
| | +- ClassType[@FullyQualified = false, @PackageQualifier = null, @SimpleName = "System"]
| +- ArgumentList[@Empty = false, @Size = 1]
| +- InfixExpression[@CompileTimeConstant = false, @Operator = BinaryOp.ADD, @ParenthesisDepth = 0, @Parenthesized = false]
| +- StringLiteral[@CompileTimeConstant = true, @ConstValue = "Empty ", @Empty = false, @Image = "\"Empty \"", @Length = 6, @LiteralText = "\"Empty \"", @ParenthesisDepth = 0, @Parenthesized = false, @TextBlock = false]
| +- VariableAccess[@AccessType = AccessType.READ, @CompileTimeConstant = false, @Image = "o", @Name = "o", @ParenthesisDepth = 0, @Parenthesized = false]
+- EmptyDeclaration[]

View File

@ -34,6 +34,18 @@ public class Foo {
]]></code> ]]></code>
</test-code> </test-code>
<test-code>
<description>Should not match for boxed Boolean on multiple parameters by default (#5253)</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Foo {
public Boolean getEnabled(boolean thisIsNotABean) {
return false;
}
}
]]></code>
</test-code>
<test-code> <test-code>
<description>Should not match on methods annotated with @Override</description> <description>Should not match on methods annotated with @Override</description>
<expected-problems>0</expected-problems> <expected-problems>0</expected-problems>
@ -60,4 +72,93 @@ public class Foo {
} }
]]></code> ]]></code>
</test-code> </test-code>
<test-code>
<description>Bad name with boxed Boolean (#5253)</description>
<expected-problems>1</expected-problems>
<code><![CDATA[
public class Foo {
public Boolean getEnabled() {
return true;
}
}
]]></code>
</test-code>
<test-code>
<description>Good name with boxed Boolean (#5253)</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Foo {
public Boolean isEnabled() {
return false;
}
}
]]></code>
</test-code>
<test-code>
<description>Should not match for boxed Boolean on methods annotated with @Override (#5253)</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Foo implements Toggleable {
@Override
public Boolean getEnabled() {
return true;
}
}
interface Toggleable {
Boolean getEnabled(); // NOPMD
}
]]></code>
</test-code>
<test-code>
<description>Should match for boxed Boolean on multiple parameters when checkParameterizedMethods = true (#5253)</description>
<rule-property name="checkParameterizedMethods">true</rule-property>
<expected-problems>1</expected-problems>
<code><![CDATA[
public class Foo {
public Boolean getEnabled(boolean thisIsNotABean);
}
]]></code>
</test-code>
<test-code>
<description>Should match for boxed Boolean on multiple parameters when checkParameterizedMethods = true (#5253)</description>
<rule-property name="checkParameterizedMethods">true</rule-property>
<expected-problems>1</expected-problems>
<code><![CDATA[
public class Foo {
public Boolean getEnabled(boolean thisIsNotABean) {
return false;
}
}
]]></code>
</test-code>
<test-code>
<description>Custom Boolean type (#5253)</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
class Boolean { }
public class Foo {
public Boolean getEnabled() {
return null;
}
}
]]></code>
</test-code>
<test-code>
<description>Custom Boolean type with returning value (#5253)</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
class Boolean { }
public class Foo {
public Boolean getEnabled() { return false; }
}
]]></code>
</test-code>
</test-data> </test-data>

View File

@ -9,6 +9,9 @@
<rule-property name="threshold">2</rule-property> <rule-property name="threshold">2</rule-property>
<expected-problems>1</expected-problems> <expected-problems>1</expected-problems>
<expected-linenumbers>1</expected-linenumbers> <expected-linenumbers>1</expected-linenumbers>
<expected-messages>
<message>A value of 3 may denote a high amount of coupling within the class (threshold: 2)</message>
</expected-messages>
<code><![CDATA[ <code><![CDATA[
import java.util.*; import java.util.*;
public class Foo { public class Foo {
@ -51,6 +54,9 @@ public interface Foo {
<rule-property name="threshold">2</rule-property> <rule-property name="threshold">2</rule-property>
<expected-problems>1</expected-problems> <expected-problems>1</expected-problems>
<expected-linenumbers>1</expected-linenumbers> <expected-linenumbers>1</expected-linenumbers>
<expected-messages>
<message>A value of 3 may denote a high amount of coupling within the class (threshold: 2)</message>
</expected-messages>
<code><![CDATA[ <code><![CDATA[
import java.util.*; import java.util.*;
public interface Foo { public interface Foo {

View File

@ -47,10 +47,10 @@
<configuration> <configuration>
<target> <target>
<ant antfile="${javacc.ant.wrapper}" target="alljavacc"> <ant antfile="${javacc.ant.wrapper}" target="alljavacc">
<property name="plugin-classpath" refid="maven.plugin.classpath"/>
<property name="no-jjtree" value="true" /> <!-- This is a CPD module --> <property name="no-jjtree" value="true" /> <!-- This is a CPD module -->
<property name="lang-name" value="Ecmascript5" /> <property name="lang-name" value="Ecmascript5" />
<property name="lang-id" value="ecmascript5" /> <property name="lang-id" value="ecmascript5" />
<property name="javacc.jar" value="${javacc.jar}" />
</ant> </ant>
</target> </target>
</configuration> </configuration>

View File

@ -40,7 +40,7 @@
<configuration> <configuration>
<target> <target>
<ant antfile="${javacc.ant.wrapper}" target="alljavacc"> <ant antfile="${javacc.ant.wrapper}" target="alljavacc">
<property name="javacc.jar" value="${javacc.jar}" /> <property name="plugin-classpath" refid="maven.plugin.classpath"/>
<property name="lang-name" value="Jsp" /> <property name="lang-name" value="Jsp" />
<property name="lang-id" value="jsp" /> <property name="lang-id" value="jsp" />
</ant> </ant>

View File

@ -34,10 +34,10 @@
<configuration> <configuration>
<target> <target>
<ant antfile="${javacc.ant.wrapper}" target="alljavacc"> <ant antfile="${javacc.ant.wrapper}" target="alljavacc">
<property name="plugin-classpath" refid="maven.plugin.classpath"/>
<property name="no-jjtree" value="true" /> <!-- This is a CPD module --> <property name="no-jjtree" value="true" /> <!-- This is a CPD module -->
<property name="lang-name" value="Matlab" /> <property name="lang-name" value="Matlab" />
<property name="lang-id" value="matlab" /> <property name="lang-id" value="matlab" />
<property name="javacc.jar" value="${javacc.jar}" />
</ant> </ant>
</target> </target>
</configuration> </configuration>

View File

@ -64,7 +64,7 @@
<configuration> <configuration>
<target> <target>
<ant antfile="${javacc.ant.wrapper}" target="alljavacc"> <ant antfile="${javacc.ant.wrapper}" target="alljavacc">
<property name="javacc.jar" value="${javacc.jar}" /> <property name="plugin-classpath" refid="maven.plugin.classpath"/>
<property name="lang-name" value="Modelica" /> <property name="lang-name" value="Modelica" />
<property name="lang-id" value="modelica" /> <property name="lang-id" value="modelica" />
</ant> </ant>

View File

@ -34,10 +34,10 @@
<configuration> <configuration>
<target> <target>
<ant antfile="${javacc.ant.wrapper}" target="alljavacc"> <ant antfile="${javacc.ant.wrapper}" target="alljavacc">
<property name="plugin-classpath" refid="maven.plugin.classpath"/>
<property name="no-jjtree" value="true" /> <!-- This is a CPD module --> <property name="no-jjtree" value="true" /> <!-- This is a CPD module -->
<property name="lang-name" value="ObjectiveC" /> <property name="lang-name" value="ObjectiveC" />
<property name="lang-id" value="objectivec" /> <property name="lang-id" value="objectivec" />
<property name="javacc.jar" value="${javacc.jar}" />
</ant> </ant>
</target> </target>
</configuration> </configuration>

View File

@ -40,7 +40,7 @@
<configuration> <configuration>
<target> <target>
<ant antfile="${javacc.ant.wrapper}" target="alljavacc"> <ant antfile="${javacc.ant.wrapper}" target="alljavacc">
<property name="javacc.jar" value="${javacc.jar}" /> <property name="plugin-classpath" refid="maven.plugin.classpath"/>
<property name="lang-name" value="PLSQL" /> <property name="lang-name" value="PLSQL" />
<property name="lang-name-camelcase" value="Plsql" /> <property name="lang-name-camelcase" value="Plsql" />
<property name="lang-id" value="plsql" /> <property name="lang-id" value="plsql" />

View File

@ -34,10 +34,10 @@
<configuration> <configuration>
<target> <target>
<ant antfile="${javacc.ant.wrapper}" target="alljavacc"> <ant antfile="${javacc.ant.wrapper}" target="alljavacc">
<property name="plugin-classpath" refid="maven.plugin.classpath"/>
<property name="no-jjtree" value="true" /> <!-- This is a CPD module --> <property name="no-jjtree" value="true" /> <!-- This is a CPD module -->
<property name="lang-name" value="Python" /> <property name="lang-name" value="Python" />
<property name="lang-id" value="python" /> <property name="lang-id" value="python" />
<property name="javacc.jar" value="${javacc.jar}" />
</ant> </ant>
</target> </target>
</configuration> </configuration>

View File

@ -43,7 +43,7 @@
<configuration> <configuration>
<target> <target>
<ant antfile="${javacc.ant.wrapper}" target="alljavacc"> <ant antfile="${javacc.ant.wrapper}" target="alljavacc">
<property name="javacc.jar" value="${javacc.jar}" /> <property name="plugin-classpath" refid="maven.plugin.classpath"/>
<property name="lang-name" value="Vtl" /> <property name="lang-name" value="Vtl" />
<property name="lang-id" value="velocity" /> <property name="lang-id" value="velocity" />
</ant> </ant>

View File

@ -47,7 +47,7 @@
<configuration> <configuration>
<target> <target>
<ant antfile="${javacc.ant.wrapper}" target="alljavacc"> <ant antfile="${javacc.ant.wrapper}" target="alljavacc">
<property name="javacc.jar" value="${javacc.jar}" /> <property name="plugin-classpath" refid="maven.plugin.classpath"/>
<property name="lang-name" value="Vf" /> <property name="lang-name" value="Vf" />
<property name="lang-id" value="visualforce" /> <property name="lang-id" value="visualforce" />
</ant> </ant>

17
pom.xml
View File

@ -94,7 +94,7 @@
<kotlin.compiler.jvmTarget>${maven.compiler.test.target}</kotlin.compiler.jvmTarget> <kotlin.compiler.jvmTarget>${maven.compiler.test.target}</kotlin.compiler.jvmTarget>
<kotlin.version>1.9.24</kotlin.version> <kotlin.version>1.9.24</kotlin.version>
<kotest.version>5.9.1</kotest.version> <kotest.version>5.9.1</kotest.version>
<junit5.version>5.8.2</junit5.version> <!-- needed by kotest --> <junit5.version>5.11.2</junit5.version>
<dokka.version>1.9.20</dokka.version> <dokka.version>1.9.20</dokka.version>
<javacc.version>5.0</javacc.version> <javacc.version>5.0</javacc.version>
@ -118,10 +118,12 @@
<pmd.build-tools.version>27</pmd.build-tools.version> <pmd.build-tools.version>27</pmd.build-tools.version>
<pmd-designer.version>7.2.0</pmd-designer.version> <pmd-designer.version>7.2.0</pmd-designer.version>
<javacc.jar>${settings.localRepository}/net/java/dev/javacc/javacc/${javacc.version}/javacc-${javacc.version}.jar</javacc.jar>
<javacc.outputDirectory>${project.build.directory}/generated-sources/javacc</javacc.outputDirectory> <javacc.outputDirectory>${project.build.directory}/generated-sources/javacc</javacc.outputDirectory>
<javacc.ant.wrapper>${project.basedir}/../javacc-wrapper.xml</javacc.ant.wrapper> <javacc.ant.wrapper>${project.basedir}/../javacc-wrapper.xml</javacc.ant.wrapper>
<ant-contrib.version>1.0b3</ant-contrib.version>
<antlr4.outputDirectory>${project.build.directory}/generated-sources/antlr4</antlr4.outputDirectory> <antlr4.outputDirectory>${project.build.directory}/generated-sources/antlr4</antlr4.outputDirectory>
<antlr4.ant.wrapper>${project.basedir}/../antlr4-wrapper.xml</antlr4.ant.wrapper> <antlr4.ant.wrapper>${project.basedir}/../antlr4-wrapper.xml</antlr4.ant.wrapper>
@ -167,6 +169,11 @@
<artifactId>ant</artifactId> <artifactId>ant</artifactId>
<version>${ant.version}</version> <version>${ant.version}</version>
</dependency> </dependency>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>${ant-contrib.version}</version>
</dependency>
</dependencies> </dependencies>
</plugin> </plugin>
<plugin> <plugin>
@ -963,7 +970,7 @@
<dependency> <dependency>
<groupId>org.junit.platform</groupId> <groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId> <artifactId>junit-platform-suite</artifactId>
<version>1.10.2</version> <version>1.11.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -1092,13 +1099,13 @@
<version>3.25.5</version> <version>3.25.5</version>
</dependency> </dependency>
<!-- Make sure to use the correct version the JUnit5 needs. E.g. 5.8.2 needs 1.8.2 <!-- Make sure to use the correct version the JUnit5 needs. E.g. 5.11.2 needs 1.11.2
Kotest might bring a wrong version. Kotest might bring a wrong version.
see junit5.version --> see junit5.version -->
<dependency> <dependency>
<groupId>org.junit.platform</groupId> <groupId>org.junit.platform</groupId>
<artifactId>junit-platform-commons</artifactId> <artifactId>junit-platform-commons</artifactId>
<version>1.8.2</version> <version>1.11.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>