A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/1334 below:

[java] LinguisticNaming should support AtomicBooleans · Issue #1334 · pmd/pmd · GitHub

Affects PMD Version:
6.7.0

Rule:
LinguisticNaming

Description:
Fields of type AtomicBoolean are prohibited from following the naming patterns isX, shouldX, hasX, etc., e.g. isFlagSet. In my view, AtomicBooleans are simply threadsafe wrappers around boolean values and are therefore perfectly valid to have a boolean-style name prefix.

Code Sample demonstrating the issue:

All of the following fields will trigger the rule:

private final AtomicBoolean isX = new AtomicBoolean(true);
private final AtomicBoolean hasX = new AtomicBoolean(true);
private final AtomicBoolean canX = new AtomicBoolean(true);
private final AtomicBoolean haveX = new AtomicBoolean(true);
private final AtomicBoolean willX = new AtomicBoolean(true);
private final AtomicBoolean shouldX = new AtomicBoolean(true);

Running PMD through: Gradle


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4