Skip to content

Commit 43ea8ce

Browse files
authored
Merge pull request dsldevkit#1212 from rubenporras/pmd
build: upgrade to PMD 7.18.0
2 parents 03eb331 + 8f9f0f9 commit 43ea8ce

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

.github/workflows/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: pmd/pmd-github-action@v2.0.0
1717
id: pmd
1818
with:
19-
version: '7.17.0'
19+
version: '7.18.0'
2020
rulesets: 'ddk-configuration/pmd/ruleset.xml'
2121
analyzeModifiedFilesOnly: false
2222
- name: Fail build if there are violations

com.avaloq.tools.ddk.check.core/src/com/avaloq/tools/ddk/check/validation/CheckValidator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.eclipse.xtext.validation.CheckType;
3131
import org.eclipse.xtext.validation.ComposedChecks;
3232
import org.eclipse.xtext.validation.ValidationMessageAcceptor;
33-
import org.eclipse.xtext.xbase.XBlockExpression;
3433
import org.eclipse.xtext.xbase.XExpression;
3534
import org.eclipse.xtext.xbase.XReturnExpression;
3635
import org.eclipse.xtext.xbase.XbasePackage;
@@ -530,7 +529,7 @@ public void checkGuardsFirst(final Context context) {
530529
return; // no guards makes check irrelevant
531530
}
532531

533-
EList<XExpression> topLevelExpressions = (EList<XExpression>) ((XBlockExpression) context.getConstraint()).eGet(XbasePackage.Literals.XBLOCK_EXPRESSION__EXPRESSIONS);
532+
EList<XExpression> topLevelExpressions = (EList<XExpression>) context.getConstraint().eGet(XbasePackage.Literals.XBLOCK_EXPRESSION__EXPRESSIONS);
534533

535534
for (final XGuardExpression guard : guards) {
536535
final EStructuralFeature eContainingFeature = guard.eContainingFeature();

com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/formatting/ExtendedFormattingConfigBasedStream.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,8 @@ public boolean containsOpposite(final List<ElementLocator> locators, final Eleme
517517
boolean isSameIndentColumnLocator = candidateLocator instanceof FixedLocator
518518
&& ((FixedLocator) candidateLocator).getColumn() == ((FixedLocator) locator).getColumn();
519519
if (isSameIndentColumnLocator) {
520-
boolean isOppositeToAfter = ((FixedLocator) candidateLocator).getRight() != null && ((FixedLocator) locator).getRight() == null;
521-
boolean isOppositeToBefore = ((FixedLocator) candidateLocator).getLeft() != null && ((FixedLocator) locator).getLeft() == null;
520+
boolean isOppositeToAfter = candidateLocator.getRight() != null && locator.getRight() == null;
521+
boolean isOppositeToBefore = candidateLocator.getLeft() != null && locator.getLeft() == null;
522522
if (isOppositeToAfter || isOppositeToBefore) {
523523
return true;
524524
}

ddk-configuration/pmd/ruleset.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<exclude name="AssignmentToNonFinalStatic"/>
1818
<exclude name="AvoidAccessibilityAlteration"/>
1919
<exclude name="AvoidBranchingStatementAsLastInLoop"/>
20+
<exclude name="AvoidCatchingGenericException"/><!--Checkstyle-->
2021
<exclude name="AvoidCatchingThrowable"/><!--Checkstyle-->
2122
<exclude name="AvoidDuplicateLiterals"/><!--Checkstyle-->
2223
<exclude name="AvoidLiteralsInIfCondition"/><!--Checkstyle-->
@@ -44,7 +45,6 @@
4445
<exclude name="AvoidSynchronizedStatement"/><!-- Only applies to virtual threads on Java 21, which we do not use, the problem might be solved in a later vm -->
4546
</rule>
4647
<rule ref="category/java/design.xml">
47-
<exclude name="AvoidCatchingGenericException"/><!--Checkstyle-->
4848
<exclude name="AvoidDeeplyNestedIfStmts"/>
4949
<exclude name="AvoidRethrowingException"/>
5050
<exclude name="AvoidUncheckedExceptionsInSignatures"/>

ddk-parent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<spotbugs.plugin.version>4.9.8.1</spotbugs.plugin.version>
5454
<spotbugs.version>4.9.8</spotbugs.version>
5555
<pmd.plugin.version>3.28.0</pmd.plugin.version>
56-
<pmd.version>7.17.0</pmd.version>
56+
<pmd.version>7.18.0</pmd.version>
5757
<tycho.version>5.0.0</tycho.version>
5858
<xtend.version>2.40.0</xtend.version>
5959
</properties>

0 commit comments

Comments
 (0)