A RetroSearch Logo

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

Search Query:

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

[java] UnnecessaryFullyQualifiedName fails to recognize illegal self reference in enums · Issue #4631 · pmd/pmd · GitHub

Affects PMD Version: 6.44.0

Rule: UnnecessaryFullyQualifiedName

Description:

UnnecessaryFullyQualifiedName fails to recognize illegal self reference with enum constructors

Code Sample demonstrating the issue:

https://github.com/runelite/runelite/blob/36979d67f7a0ba420ec3ed3189ac27ff3c1a1abb/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/Tree.java#L53

import api.ObjectID;
import static api.ObjectID.*;

public enum {
  TEAK_TREE(Duration.of(15, GAME_TICKS), ObjectID.TEAK_TREE, TEAK_TREE_36686, TEAK_TREE_40758),

This errors because there is a wildcard import above import static net.runelite.api.ObjectID.*;, however removing ObjectID. causes an illegal self-reference to the enum.

Expected outcome:

PMD doesn't report this as an error.

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