Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #11311
Closed
Open
Issue created Jan 14, 2022 by Administrator@rootContributor

[JAVA] Bug found in RFC3339DateFormat about clone method

Created by: fcanovas1986

Description

We have been noticed by a bug in this class from spotbugs-maven-plugin. When generating the RFC3339DateFormat class:

[ERROR] Medium:xxxxxxxx.rest.client.invoker.RFC3339DateFormat.clone() does not call super.clone() [xxxxxxxxxx.rest.client.invoker.RFC3339DateFormat] At RFC3339DateFormat.java:[line 53] CN_IDIOM_NO_SUPER_CALL

If I check the class template RFC3339DateFormat.mustache I can see how it is true that the override method clone() does not call super.clone(). It only calls return this;, so it is not cloning the object.

@Override
  public Object clone() {
    return this;
  }

Find the reference to this bug here

openapi-generator version

5.3.0

Suggest a fix/enhancement

Calling super.clone method inside clone() method of RFC3339DateFormat would be enough. I would be happy to contribute if you want.

Assignee
Assign to
Time tracking