Skip to content

Commit d6731f9

Browse files
committed
update package version
1 parent bee3f70 commit d6731f9

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

packages/code-analyzer-pmd-engine/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@salesforce/code-analyzer-pmd-engine",
33
"description": "Plugin package that adds 'pmd' and 'cpd' as engines into Salesforce Code Analyzer",
4-
"version": "0.35.0",
4+
"version": "0.36.0-SNAPSHOT",
55
"author": "The Salesforce Code Analyzer Team",
66
"license": "BSD-3-Clause",
77
"homepage": "https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/overview",

packages/code-analyzer-pmd-engine/pmd-cpd-wrappers/src/main/java/com/salesforce/sfca/pmdwrapper/PmdRuleDescriber.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,20 @@ public void logEx(Level level, @Nullable String s, Object[] objects, @Nullable T
169169
}
170170
throw new RuntimeException("PMD threw an unexpected exception:\n" + message, throwable);
171171
} else if (level == Level.WARN && s != null){
172+
// PMD sometimes logs deprecation notices as WARN without a Throwable.
173+
// Example: "Discontinue using Rule category/... as it is scheduled for removal..."
174+
// We surface these to stdout with a [Warning] marker so callers can display them,
175+
// but we do not fail the operation.
172176
String message = MessageFormat.format(s, objects);
173177
if (message.contains("Discontinue using Rule ")) {
174178
System.out.println("[Warning] " + message.replaceAll("\n","{NEWLINE}"));
175179
} else {
180+
// Any other WARN without a Throwable is unexpected in our workflows; treat as fatal
181+
// so configuration/environment issues are not silently ignored.
176182
throw new RuntimeException("PMD threw an unexpected exception:\n" + message);
177183
}
178-
}else if (s != null) {
184+
} else if (s != null) {
185+
// Non-WARN messages without a Throwable are unexpected; fail fast to aid diagnosis.
179186
String message = MessageFormat.format(s, objects);
180187
throw new RuntimeException("PMD threw an unexpected exception:\n" + message);
181188
}

0 commit comments

Comments
 (0)