swagger-api / swagger-api/swagger-codegen

[JAVA] Improvement pmd warning

Open
#10,320 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

PMD reports several

  Unnecessary use of fully qualified name 'java.lang.Object' due to existing implicit import 'java.lang.*'
https://pmd.github.io/pmd-6.21.0/pmd_rules_java_codestyle.html#unnecessaryfullyqualifiedname

Swagger-codegen version

I use the online version https://editor.swagger.io/
OpenAPI spec version: 2.0.0 says my code generated header.

Suggest a fix/enhancement

I don’t know wich is the best way to "fix"/improve that. The bad way is to make pmd ignore it (N projects manager have to do it vs 1 dev). Maybe the CI for openapi can run pmd on test generate sources.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the warning using the generated Java output from the Swagger Editor and the PMD rule linked in the report. Determine whether the generated sources or the proposed CI check should change; done means the unnecessary fully qualified names no longer produce warnings without requiring users to suppress the rule.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.