A RetroSearch Logo

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

Search Query:

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

[java] UseProperClassLoader can not detect the case with method call on intermediate variable · Issue #2544 · pmd/pmd · GitHub

Affects PMD Version:
6.22.0

Rule:
UseProperClassLoader

Description:
UseProperClassLoader can not detect the case which is written in two lines:Foo foo = new Foo() and then ClassLoader classLoader = foo.getClassLoader();
This rule is implemented through xpath search:

//PrimarySuffix[@Image='getClassLoader']

This rule can only detect the case new Foo().getClassLoader()

Code Sample demonstrating the issue:

Foo foo = new Foo()
ClassLoader classLoader = foo.getClassLoader();

Expected outcome:
false-negative

Running PMD through:
CLI


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