A RetroSearch Logo

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

Search Query:

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

no violation on 'new Boolean(val)' · Issue #3595 · pmd/pmd · GitHub

Affects PMD Version: 6.40.0

Rule: PrimitiveWrapperInstantiation

Description: No violation on Boolean object instantiation.
The same code has violation for the BooleanInstantiation rule (PMD ver. 6.36.0).

Code Sample demonstrating the issue:

public class SomeClass {
      private Boolean bar;

      public void method(String s) {
            this.bar = new Boolean(s);       //violation for the BooleanInstantiation
            this.bar = Boolean.valueOf(s);  //use it instead of Boolean#new
      }
}

Expected outcome:

PMD should report a violation at line 5, but doesn't. This is a false-negative.

Running PMD through: Maven


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