GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [java] UnusedAssignment: False positive for an assignment in a condition operand that may be skipped · Issue #7018 · pmd/pmd Closed Labels a:false-positivePMD flags a piece of code that is not problematic Milestone DescriptionAI disclosure: this issue was prepared with AI coding agents, reviewed and revised line by line by me. Affects PMD Version: Rule: Description: Code Sample demonstrating the issue: public class Foo { static boolean flag() { return Math.random() < 0.5; } public void process() { boolean ok = true; if (flag() && (ok = false)) { return; } System.out.println(ok); // prints true when flag() is false } } Expected outcome: PMD reports a violation at line 10 ( Nearby shapes that behave correctly (checked on 7.27.0 and main):
Running PMD through: CLI Root cause (from reading Fix direction: the no-else fall-through state should account for the paths on which the right operand was not evaluated, e.g. by evaluating the shortcut operands in a fork of Activity
MetadataMetadataAssigneesLabelsa:false-positivePMD flags a piece of code that is not problematic TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |