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] DoubleCheckedLocking: False negative when the outer null check is written as !(x != null) · Issue #6900 · pmd/pmd Closed Labels a:false-negativePMD doesn't flag a problematic piece of code Milestone DescriptionAffects PMD Version: 7.26.0 Rule: DoubleCheckedLocking Description:
Code Sample demonstrating the issue: public class DclSeed { // reported: DclSeed.java:4 DoubleCheckedLocking Object baz; Object bar() { if (baz == null) { synchronized (this) { if (baz == null) { baz = new Object(); } } } return baz; } } public class DclVariant { // NOT reported (only LogicInversion fires) Object baz; Object bar() { if (!(baz != null)) { // <- equivalent rewrite of `baz == null` synchronized (this) { if (baz == null) { baz = new Object(); } } } return baz; } } Expected outcome: PMD should report a Running PMD through: CLI Activity
MetadataMetadataAssigneesLabelsa:false-negativePMD doesn't flag a problematic piece of code 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. |