Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][JAVA] RFC3339DateFormat.clone raises NullPointerException #11704

Closed
chriswhite199 opened this issue Feb 23, 2022 · 0 comments
Closed

[BUG][JAVA] RFC3339DateFormat.clone raises NullPointerException #11704

chriswhite199 opened this issue Feb 23, 2022 · 0 comments

Comments

@chriswhite199
Copy link
Contributor

Description

The generated RFC3339DateFormat.clone() method defers to super.clone(), but the numberFormat field has not been initialized in the RFC3339DateFormat constructor, and so DateFormat.clone() raises a NullPointerException.

Full comment on #11311 (comment)

openapi-generator version

5.4.0

Suggest a fix

Amend modules/openapi-generator/src/main/resources/Java/RFC3339DateFormat.mustache constructor to:

  public RFC3339DateFormat() {
    this.calendar = new GregorianCalendar();
    this.numberFormat = new DecimalFormat();
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants