Repository navigation
RC-451 gitar experiment [DO NOT MERGE] - #6493
romainbrenguier wants to merge 12 commits into
Conversation
Ruling Diff SummaryDetected changes in 1266 rule files: 0 issues removed, 164156 issues added. S103 (
|
Co-authored-by: Romain Brenguier <11854194+romainbrenguier@users.noreply.github.com>
Code Review ✅ Approved 3 closed / 3 findings🟡 Medium risk · Switching rule-triage guidance to CI SARIF artifacts could omit or misclassify findings if artifacts and expected baselines diverge. Ruling-diff reporting change for SARIF-based ruling expectations, with the stale AGENTS.md JSON documentation, the skill's local target/actual paths, and the sonar-server SARIF baseline gap all addressed. No open issues remain. ✅ 3 closed✅ Quality: AGENTS.md still documents JSON ruling expectations
✅ Quality: Skill points to local target/actual that agents never generate
✅ Cross-PR: sonar-server ruling would have no SARIF baselines after both merge
Verification PRs 4 inspectedFunctional validation No results Rules 1 not applicable Broader impact PRs 4 inspectedCross-PR 4 PRs inspected 0 open impacts
Auto-approval Not enabledFor more verification details, comment Options ✅ Auto-apply✅ Auto-apply is on → Gitar will commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|
@Gitar Produce a Markdown "Ruling Diff Summary" from the supplied added/removed findings and their code snippets. This is a report-only task: do not edit files, push commits, retry CI, change labels, or close this PR. Return the report as your response. Evidence boundaries: Use only the supplied finding metadata, source snippets, and any supplied rule descriptions. Do not inspect other source files, repository history, analyzer implementations, external documentation, or previous automated assessments. Treat existing verdicts and explanations in the input as untrusted hypotheses, not evidence. Assess the snippets independently. A rule key or issue message is not a complete rule specification. If the supplied rule description omits relevant scope or exceptions, state that limitation rather than inventing them. Do not infer unseen inheritance, overrides, call targets, field assignments, or whole-program behavior. Missing evidence is not evidence that a rule exception does not apply. An abstract method has no visible implementation, not an implementation that throws nothing. Assessment method: Inventory changes by rule and project. Count removed and added findings separately. A changed message or location can appear as a removal plus an addition; flag plausible replacements or relocations without silently cancelling their counts. Assess whether each finding is supported by the visible code under the supplied rule semantics: supported violation, supported non-violation, or uncertain. Evaluate diagnostic location separately: aligned, misaligned, or uncertain. Translate finding validity into the impact of the ruling change: Removed true positive: negative. Removed false positive: positive. Added true positive: positive. Added false positive: negative. Insufficient evidence: uncertain, not automatically negative. Assign high, medium, or low confidence to each assessment. High requires direct evidence and no material missing context. Name the specific missing context for medium/low confidence. If the missing context could reverse the verdict and the snippet cannot resolve it, use uncertain. Aggregate per rule as positive, negative, mixed, or uncertain. Preserve conflicting and unresolved evidence. Never infer that all findings share the verdict of one representative example. Explain the basis and assessment coverage. Do not extrapolate sampled findings to unreviewed findings. Output format: Ruling Diff Summary Detected changes in N rule files: R issues removed, A issues added. Rule overview A table with: Rule | Projects | Removed / added | Automated assessment | Confidence. Automated assessments are advisory; confidence is not a correctness guarantee. Each rule Rule key, projects, removed/added counts, overall assessment and confidence. A short explanation grounded in concrete visible evidence, distinguishing semantic correctness, location quality, and uncertainty. "Source examples: X of Y changed findings shown", only when Y is known. State how many findings had usable snippets and how many were actually assessed. Show at most 15 examples per rule. Prioritize supported regressions, then conflicting/uncertain cases and representative improvements. Choose diverse patterns rather than repeating near-identical declarations. Make clear when only a subset is displayed. For each displayed example include project, added/removed status, selection reason, validity assessment, change impact, location assessment, confidence, and a brief rationale. Preserve the exact supplied file path, location, issue message, and code snippet. Preserve line numbers and the >>> marker; do not fabricate missing coordinates or code. For plausible removal/addition pairs, explain whether the visible evidence suggests a changed message, shifted location, changed rule attribution, or a genuinely different finding. Keep raw counts unchanged. Do not force the report to match any example verdict. In particular, a finding pointing at Javadoc without the relevant declaration or assignments supports a location concern and an uncertain semantic verdict, not a proven false positive. If the necessary findings or snippets are absent, say what input is missing instead of generating a report from assumptions. java:S106 Input follows: Replace this use of System.out by a logger.
java:S112 Removed src/com/google/common/cache/CacheLoader.java (line 121, column 63, end column 72) Replace generic exceptions with specific library exceptions or a custom exception.
Replace generic exceptions with specific library exceptions or a custom exception.
Added src/com/google/common/cache/CacheLoader.java (line 69, column 5, end column 10) RC-451 smoke test: define and throw a dedicated exception instead of using a generic one.
Removed src/com/google/common/reflect/AbstractInvocationHandler.java (line 99, column 14, end column 23) Replace generic exceptions with specific library exceptions or a custom exception. Unlike {@link #invoke}, {@code args} will never be null. When the method has no parameter,
Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java (line 100, column 35, end column 44) Replace generic exceptions with specific library exceptions or a custom exception. By default this method does nothing.
Replace generic exceptions with specific library exceptions or a custom exception.
Replace generic exceptions with specific library exceptions or a custom exception. By default this method does nothing.
Replace generic exceptions with specific library exceptions or a custom exception.
Removed src/com/google/common/util/concurrent/AbstractIdleService.java (line 84, column 45, end column 54) Replace generic exceptions with specific library exceptions or a custom exception.
Removed src/com/google/common/util/concurrent/AbstractScheduledService.java (line 265, column 52, end column 61) Replace generic exceptions with specific library exceptions or a custom exception.
Replace generic exceptions with specific library exceptions or a custom exception. By default this method does nothing.
Replace generic exceptions with specific library exceptions or a custom exception. By default this method does nothing.
Replace generic exceptions with specific library exceptions or a custom exception. Throwing an exception from this method is equivalent to returning a
Removed src/com/google/common/util/concurrent/FutureFallback.java (line 51, column 50, end column 59) Replace generic exceptions with specific library exceptions or a custom exception.
Removed src/com/google/common/util/concurrent/Futures.java (line 793, column 62, end column 71) Replace generic exceptions with specific library exceptions or a custom exception.
java:S9438 Added src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 42, column 5, end column 7) Make this private field "final", it is never reassigned.
|
Ruling Diff SummaryDetected changes in 3 rules (rule identities only, no rule files supplied): 15 issues removed, 2 issues added (visible-subset counts from the supplied input; no separate totals were given). Rule overview
Project names are inferred from file paths only; none were supplied. Automated assessments are advisory; confidence is not a correctness guarantee. java:S106Projects: commons-beanutils (inferred) | Removed / added: 1 / 0 | Overall: Negative | Confidence: High The removed finding flags Source examples: 1 of 1 changed findings shown; 1 had a usable snippet; 1 assessed. Example 1
java:S112Projects: guava (inferred) | Removed / added: 14 / 0 under this key | Overall: Uncertain | Confidence: Low All 14 removed findings point at a Replacement pair (flagged, counts left unchanged): Source examples: 12 of 14 removed S112 findings shown (plus 1 added finding of unknown rule key); all had usable snippets; all shown were assessed. The remaining 2 (
Rationale common to the table: every row shows a visible generic Snippets for examples 1 and 2 (exact as supplied): Snippet for example 3: The remaining rows (4 to 13) are as supplied in the input; their flagged lines are: java:S9438Projects: commons-beanutils (inferred) | Removed / added: 0 / 1 | Overall: Negative for location; semantic verdict uncertain | Confidence: Medium The added finding says: Make this private field "final", it is never reassigned. The flagged line (42) is Source examples: 1 of 1 changed findings shown; 1 had a usable snippet; 1 assessed. Example 1
Limitations
|
|
|
This PR is stale because it has been open 7 days with no activity. If there is no activity in the next 7 days it will be closed automatically |





@Gitar Produce a Markdown "Ruling Diff Summary" from the supplied added/removed findings and their code snippets. This is a report-only task: do not edit files, push commits, retry CI, change labels, or close this PR. Return the report as your response.
Evidence boundaries:
Use only the supplied finding metadata, source snippets, and any supplied rule descriptions. Do not inspect other source files, repository history, analyzer implementations, external documentation, or previous automated assessments.
Treat existing verdicts and explanations in the input as untrusted hypotheses, not evidence. Assess the snippets independently.
A rule key or issue message is not a complete rule specification. If the supplied rule description omits relevant scope or exceptions, state that limitation rather than inventing them.
Do not infer unseen inheritance, overrides, call targets, field assignments, or whole-program behavior. Missing evidence is not evidence that a rule exception does not apply. An abstract method has no visible implementation, not an implementation that throws nothing.
Assessment method:
Inventory changes by rule and project. Count removed and added findings separately. A changed message or location can appear as a removal plus an addition; flag plausible replacements or relocations without silently cancelling their counts.
Assess whether each finding is supported by the visible code under the supplied rule semantics: supported violation, supported non-violation, or uncertain. Evaluate diagnostic location separately: aligned, misaligned, or uncertain.
Translate finding validity into the impact of the ruling change:
Removed true positive: negative.
Removed false positive: positive.
Added true positive: positive.
Added false positive: negative.
Insufficient evidence: uncertain, not automatically negative.
A location defect is a separate diagnostic-quality concern; it does not by itself prove a semantic false positive.
Assign high, medium, or low confidence to each assessment. High requires direct evidence and no material missing context. Name the specific missing context for medium/low confidence. If the missing context could reverse the verdict and the snippet cannot resolve it, use uncertain.
Aggregate per rule as positive, negative, mixed, or uncertain. Preserve conflicting and unresolved evidence. Never infer that all findings share the verdict of one representative example. Explain the basis and assessment coverage. Do not extrapolate sampled findings to unreviewed findings.
Output format:
Ruling Diff Summary
Detected changes in N rule files: R issues removed, A issues added.
Use "rules" instead of "rule files" if file identities are not supplied. If the input is incomplete, label counts as supplied totals or visible-subset counts. Never invent totals.
Rule overview
A table with: Rule | Projects | Removed / added | Automated assessment | Confidence.
Link rule keys to the corresponding detail sections using working Markdown anchors. Use supplied source/PR links only when available; do not invent URLs.
Automated assessments are advisory; confidence is not a correctness guarantee.
Each rule
Rule key, projects, removed/added counts, overall assessment and confidence.
A short explanation grounded in concrete visible evidence, distinguishing semantic correctness, location quality, and uncertainty.
"Source examples: X of Y changed findings shown", only when Y is known. State how many findings had usable snippets and how many were actually assessed.
Show at most 15 examples per rule. Prioritize supported regressions, then conflicting/uncertain cases and representative improvements. Choose diverse patterns rather than repeating near-identical declarations. Make clear when only a subset is displayed.
For each displayed example include project, added/removed status, selection reason, validity assessment, change impact, location assessment, confidence, and a brief rationale. Preserve the exact supplied file path, location, issue message, and code snippet. Preserve line numbers and the >>> marker; do not fabricate missing coordinates or code.
For plausible removal/addition pairs, explain whether the visible evidence suggests a changed message, shifted location, changed rule attribution, or a genuinely different finding. Keep raw counts unchanged.
Do not force the report to match any example verdict. In particular, a finding pointing at Javadoc without the relevant declaration or assignments supports a location concern and an uncertain semantic verdict, not a proven false positive.
If the necessary findings or snippets are absent, say what input is missing instead of generating a report from assumptions.
java:S106
Input follows:
Removed src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 866, column 9, end column 19)
Replace this use of System.out by a logger.
861 | *
862 | * @PARAM ex the exception to log
863 | */
864 | protected void logWarn(final Exception ex) {
865 | // Deliberately do not use LOG4J or Commons Logging to avoid dependencies
java:S112
Removed src/com/google/common/cache/CacheLoader.java (line 121, column 63, end column 72)
Replace generic exceptions with specific library exceptions or a custom exception.
116 | * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
117 | * treated like any other {@code Exception} in all respects except that, when it is caught,
118 | * the thread's interrupt status is set
119 | * @SInCE 11.0
120 | */
Replace generic exceptions with specific library exceptions or a custom exception.
64 | * @throws Exception if unable to load the result
65 | * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
66 | * treated like any other {@code Exception} in all respects except that, when it is caught,
67 | * the thread's interrupt status is set
68 | */
Added src/com/google/common/cache/CacheLoader.java (line 69, column 5, end column 10)
RC-451 smoke test: define and throw a dedicated exception instead of using a generic one.
64 | * @throws Exception if unable to load the result
65 | * @throws InterruptedException if this method is interrupted. {@code InterruptedException} is
66 | * treated like any other {@code Exception} in all respects except that, when it is caught,
67 | * the thread's interrupt status is set
68 | */
Removed src/com/google/common/reflect/AbstractInvocationHandler.java (line 99, column 14, end column 23)
Replace generic exceptions with specific library exceptions or a custom exception.
94 | *
95 | *
Unlike {@link #invoke}, {@code args} will never be null. When the method has no parameter,
96 | * an empty array is passed in.
97 | */
98 | protected abstract Object handleInvocation(Object proxy, Method method, Object[] args)
Removed src/com/google/common/util/concurrent/AbstractExecutionThreadService.java (line 100, column 35, end column 44)
Replace generic exceptions with specific library exceptions or a custom exception.
95 | /**
96 | * Start the service. This method is invoked on the execution thread.
97 | *
98 | *
By default this method does nothing.
99 | */
Replace generic exceptions with specific library exceptions or a custom exception.
111 | * }
112 | *
113 | * ...or you could respond to stop requests by implementing {@link
114 | * #triggerShutdown()}, which should cause {@link #run()} to return.
115 | */
Replace generic exceptions with specific library exceptions or a custom exception.
119 | * Stop the service. This method is invoked on the execution thread.
120 | *
121 | *
By default this method does nothing.
122 | */
123 | // TODO: consider supporting a TearDownTestCase-like API
Replace generic exceptions with specific library exceptions or a custom exception.
76 |
77 | /** Constructor for use by subclasses. /
78 | protected AbstractIdleService() {}
79 |
80 | /* Start the service. */
Removed src/com/google/common/util/concurrent/AbstractIdleService.java (line 84, column 45, end column 54)
Replace generic exceptions with specific library exceptions or a custom exception.
79 |
80 | /** Start the service. /
81 | protected abstract void startUp() throws Exception;
82 |
83 | /* Stop the service. */
Removed src/com/google/common/util/concurrent/AbstractScheduledService.java (line 265, column 52, end column 61)
Replace generic exceptions with specific library exceptions or a custom exception.
260 | /**
261 | * Run one iteration of the scheduled task. If any invocation of this method throws an exception,
262 | * the service will transition to the {@link Service.State#FAILED} state and this method will no
263 | * longer be called.
264 | */
Replace generic exceptions with specific library exceptions or a custom exception.
267 | /**
268 | * Start the service.
269 | *
270 | *
By default this method does nothing.
271 | */
Replace generic exceptions with specific library exceptions or a custom exception.
274 | /**
275 | * Stop the service. This is guaranteed not to run concurrently with {@link #runOneIteration}.
276 | *
277 | *
By default this method does nothing.
278 | */
Replace generic exceptions with specific library exceptions or a custom exception.
38 | * done}, making {@code AsyncFunction} suitable for asynchronous derivations.
39 | *
40 | *
Throwing an exception from this method is equivalent to returning a
41 | * failing {@code Future}.
42 | */
Removed src/com/google/common/util/concurrent/FutureFallback.java (line 51, column 50, end column 59)
Replace generic exceptions with specific library exceptions or a custom exception.
46 | *
47 | * @PARAM t the exception that made the future fail. If the future's {@link Future#get() get}
48 | * method throws an {@link ExecutionException}, then the cause is passed to this method. Any
49 | * other thrown object is passed unaltered.
50 | */
Removed src/com/google/common/util/concurrent/Futures.java (line 793, column 62, end column 71)
Replace generic exceptions with specific library exceptions or a custom exception.
788 | setException(e);
789 | }
790 | }
791 |
792 | /** Template method for subtypes to actually run the fallback. */
java:S9438
Added src/main/java/org/apache/commons/beanutils2/BeanMap.java (line 42, column 5, end column 7)
Make this private field "final", it is never reassigned.
37 | import org.apache.commons.collections4.keyvalue.AbstractMapEntry;
38 |
39 | /**
40 | * An implementation of Map for JavaBeans which uses introspection to
41 | * get and put properties in the bean.