Skip to content

Commit e6faab7

Browse files
committed
revert unrelated changes
1 parent fd81045 commit e6faab7

35 files changed

Lines changed: 245 additions & 420 deletions

File tree

modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/RFC3339DateFormat.mustache

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,26 @@ public class RFC3339DateFormat extends DateFormat {
1313
private static final long serialVersionUID = 1L;
1414
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
1515
16+
private final StdDateFormat fmt = new StdDateFormat()
17+
.withTimeZone(TIMEZONE_Z)
18+
.withColonInTimeZone(true);
19+
1620
public RFC3339DateFormat() {
1721
this.calendar = new GregorianCalendar();
18-
this.calendar.setTimeZone(TIMEZONE_Z);
1922
}
2023

2124
@Override
2225
public Date parse(String source, ParsePosition pos) {
23-
return createFormatter().parse(source, pos);
26+
return fmt.parse(source, pos);
2427
}
2528

2629
@Override
2730
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
28-
return createFormatter().format(date, toAppendTo, fieldPosition);
29-
}
30-
31-
private StdDateFormat createFormatter() {
32-
return new StdDateFormat()
33-
.withTimeZone(TIMEZONE_Z)
34-
.withColonInTimeZone(true);
31+
return fmt.format(date, toAppendTo, fieldPosition);
3532
}
3633

3734
@Override
3835
public Object clone() {
39-
RFC3339DateFormat clone = (RFC3339DateFormat) super.clone();
40-
clone.calendar = (GregorianCalendar) this.calendar.clone();
41-
return clone;
36+
return this;
4237
}
4338
}

samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/RFC3339DateFormat.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,26 @@ public class RFC3339DateFormat extends DateFormat {
1313
private static final long serialVersionUID = 1L;
1414
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
1515

16+
private final StdDateFormat fmt = new StdDateFormat()
17+
.withTimeZone(TIMEZONE_Z)
18+
.withColonInTimeZone(true);
19+
1620
public RFC3339DateFormat() {
1721
this.calendar = new GregorianCalendar();
18-
this.calendar.setTimeZone(TIMEZONE_Z);
1922
}
2023

2124
@Override
2225
public Date parse(String source, ParsePosition pos) {
23-
return createFormatter().parse(source, pos);
26+
return fmt.parse(source, pos);
2427
}
2528

2629
@Override
2730
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
28-
return createFormatter().format(date, toAppendTo, fieldPosition);
29-
}
30-
31-
private StdDateFormat createFormatter() {
32-
return new StdDateFormat()
33-
.withTimeZone(TIMEZONE_Z)
34-
.withColonInTimeZone(true);
31+
return fmt.format(date, toAppendTo, fieldPosition);
3532
}
3633

3734
@Override
3835
public Object clone() {
39-
RFC3339DateFormat clone = (RFC3339DateFormat) super.clone();
40-
clone.calendar = (GregorianCalendar) this.calendar.clone();
41-
return clone;
36+
return this;
4237
}
4338
}

samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/RFC3339DateFormat.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,26 @@ public class RFC3339DateFormat extends DateFormat {
1313
private static final long serialVersionUID = 1L;
1414
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
1515

16+
private final StdDateFormat fmt = new StdDateFormat()
17+
.withTimeZone(TIMEZONE_Z)
18+
.withColonInTimeZone(true);
19+
1620
public RFC3339DateFormat() {
1721
this.calendar = new GregorianCalendar();
18-
this.calendar.setTimeZone(TIMEZONE_Z);
1922
}
2023

2124
@Override
2225
public Date parse(String source, ParsePosition pos) {
23-
return createFormatter().parse(source, pos);
26+
return fmt.parse(source, pos);
2427
}
2528

2629
@Override
2730
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
28-
return createFormatter().format(date, toAppendTo, fieldPosition);
29-
}
30-
31-
private StdDateFormat createFormatter() {
32-
return new StdDateFormat()
33-
.withTimeZone(TIMEZONE_Z)
34-
.withColonInTimeZone(true);
31+
return fmt.format(date, toAppendTo, fieldPosition);
3532
}
3633

3734
@Override
3835
public Object clone() {
39-
RFC3339DateFormat clone = (RFC3339DateFormat) super.clone();
40-
clone.calendar = (GregorianCalendar) this.calendar.clone();
41-
return clone;
36+
return this;
4237
}
4338
}

samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/RFC3339DateFormat.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,26 @@ public class RFC3339DateFormat extends DateFormat {
1313
private static final long serialVersionUID = 1L;
1414
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
1515

16+
private final StdDateFormat fmt = new StdDateFormat()
17+
.withTimeZone(TIMEZONE_Z)
18+
.withColonInTimeZone(true);
19+
1620
public RFC3339DateFormat() {
1721
this.calendar = new GregorianCalendar();
18-
this.calendar.setTimeZone(TIMEZONE_Z);
1922
}
2023

2124
@Override
2225
public Date parse(String source, ParsePosition pos) {
23-
return createFormatter().parse(source, pos);
26+
return fmt.parse(source, pos);
2427
}
2528

2629
@Override
2730
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
28-
return createFormatter().format(date, toAppendTo, fieldPosition);
29-
}
30-
31-
private StdDateFormat createFormatter() {
32-
return new StdDateFormat()
33-
.withTimeZone(TIMEZONE_Z)
34-
.withColonInTimeZone(true);
31+
return fmt.format(date, toAppendTo, fieldPosition);
3532
}
3633

3734
@Override
3835
public Object clone() {
39-
RFC3339DateFormat clone = (RFC3339DateFormat) super.clone();
40-
clone.calendar = (GregorianCalendar) this.calendar.clone();
41-
return clone;
36+
return this;
4237
}
4338
}

samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/RFC3339DateFormat.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,26 @@ public class RFC3339DateFormat extends DateFormat {
1313
private static final long serialVersionUID = 1L;
1414
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
1515

16+
private final StdDateFormat fmt = new StdDateFormat()
17+
.withTimeZone(TIMEZONE_Z)
18+
.withColonInTimeZone(true);
19+
1620
public RFC3339DateFormat() {
1721
this.calendar = new GregorianCalendar();
18-
this.calendar.setTimeZone(TIMEZONE_Z);
1922
}
2023

2124
@Override
2225
public Date parse(String source, ParsePosition pos) {
23-
return createFormatter().parse(source, pos);
26+
return fmt.parse(source, pos);
2427
}
2528

2629
@Override
2730
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
28-
return createFormatter().format(date, toAppendTo, fieldPosition);
29-
}
30-
31-
private StdDateFormat createFormatter() {
32-
return new StdDateFormat()
33-
.withTimeZone(TIMEZONE_Z)
34-
.withColonInTimeZone(true);
31+
return fmt.format(date, toAppendTo, fieldPosition);
3532
}
3633

3734
@Override
3835
public Object clone() {
39-
RFC3339DateFormat clone = (RFC3339DateFormat) super.clone();
40-
clone.calendar = (GregorianCalendar) this.calendar.clone();
41-
return clone;
36+
return this;
4237
}
4338
}

samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/RFC3339DateFormat.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,26 @@ public class RFC3339DateFormat extends DateFormat {
1313
private static final long serialVersionUID = 1L;
1414
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
1515

16+
private final StdDateFormat fmt = new StdDateFormat()
17+
.withTimeZone(TIMEZONE_Z)
18+
.withColonInTimeZone(true);
19+
1620
public RFC3339DateFormat() {
1721
this.calendar = new GregorianCalendar();
18-
this.calendar.setTimeZone(TIMEZONE_Z);
1922
}
2023

2124
@Override
2225
public Date parse(String source, ParsePosition pos) {
23-
return createFormatter().parse(source, pos);
26+
return fmt.parse(source, pos);
2427
}
2528

2629
@Override
2730
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
28-
return createFormatter().format(date, toAppendTo, fieldPosition);
29-
}
30-
31-
private StdDateFormat createFormatter() {
32-
return new StdDateFormat()
33-
.withTimeZone(TIMEZONE_Z)
34-
.withColonInTimeZone(true);
31+
return fmt.format(date, toAppendTo, fieldPosition);
3532
}
3633

3734
@Override
3835
public Object clone() {
39-
RFC3339DateFormat clone = (RFC3339DateFormat) super.clone();
40-
clone.calendar = (GregorianCalendar) this.calendar.clone();
41-
return clone;
36+
return this;
4237
}
4338
}

samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/RFC3339DateFormat.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,26 @@ public class RFC3339DateFormat extends DateFormat {
1313
private static final long serialVersionUID = 1L;
1414
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
1515

16+
private final StdDateFormat fmt = new StdDateFormat()
17+
.withTimeZone(TIMEZONE_Z)
18+
.withColonInTimeZone(true);
19+
1620
public RFC3339DateFormat() {
1721
this.calendar = new GregorianCalendar();
18-
this.calendar.setTimeZone(TIMEZONE_Z);
1922
}
2023

2124
@Override
2225
public Date parse(String source, ParsePosition pos) {
23-
return createFormatter().parse(source, pos);
26+
return fmt.parse(source, pos);
2427
}
2528

2629
@Override
2730
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
28-
return createFormatter().format(date, toAppendTo, fieldPosition);
29-
}
30-
31-
private StdDateFormat createFormatter() {
32-
return new StdDateFormat()
33-
.withTimeZone(TIMEZONE_Z)
34-
.withColonInTimeZone(true);
31+
return fmt.format(date, toAppendTo, fieldPosition);
3532
}
3633

3734
@Override
3835
public Object clone() {
39-
RFC3339DateFormat clone = (RFC3339DateFormat) super.clone();
40-
clone.calendar = (GregorianCalendar) this.calendar.clone();
41-
return clone;
36+
return this;
4237
}
4338
}

samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/RFC3339DateFormat.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,26 @@ public class RFC3339DateFormat extends DateFormat {
1313
private static final long serialVersionUID = 1L;
1414
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
1515

16+
private final StdDateFormat fmt = new StdDateFormat()
17+
.withTimeZone(TIMEZONE_Z)
18+
.withColonInTimeZone(true);
19+
1620
public RFC3339DateFormat() {
1721
this.calendar = new GregorianCalendar();
18-
this.calendar.setTimeZone(TIMEZONE_Z);
1922
}
2023

2124
@Override
2225
public Date parse(String source, ParsePosition pos) {
23-
return createFormatter().parse(source, pos);
26+
return fmt.parse(source, pos);
2427
}
2528

2629
@Override
2730
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
28-
return createFormatter().format(date, toAppendTo, fieldPosition);
29-
}
30-
31-
private StdDateFormat createFormatter() {
32-
return new StdDateFormat()
33-
.withTimeZone(TIMEZONE_Z)
34-
.withColonInTimeZone(true);
31+
return fmt.format(date, toAppendTo, fieldPosition);
3532
}
3633

3734
@Override
3835
public Object clone() {
39-
RFC3339DateFormat clone = (RFC3339DateFormat) super.clone();
40-
clone.calendar = (GregorianCalendar) this.calendar.clone();
41-
return clone;
36+
return this;
4237
}
4338
}

samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/RFC3339DateFormat.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,26 @@ public class RFC3339DateFormat extends DateFormat {
1313
private static final long serialVersionUID = 1L;
1414
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
1515

16+
private final StdDateFormat fmt = new StdDateFormat()
17+
.withTimeZone(TIMEZONE_Z)
18+
.withColonInTimeZone(true);
19+
1620
public RFC3339DateFormat() {
1721
this.calendar = new GregorianCalendar();
18-
this.calendar.setTimeZone(TIMEZONE_Z);
1922
}
2023

2124
@Override
2225
public Date parse(String source, ParsePosition pos) {
23-
return createFormatter().parse(source, pos);
26+
return fmt.parse(source, pos);
2427
}
2528

2629
@Override
2730
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
28-
return createFormatter().format(date, toAppendTo, fieldPosition);
29-
}
30-
31-
private StdDateFormat createFormatter() {
32-
return new StdDateFormat()
33-
.withTimeZone(TIMEZONE_Z)
34-
.withColonInTimeZone(true);
31+
return fmt.format(date, toAppendTo, fieldPosition);
3532
}
3633

3734
@Override
3835
public Object clone() {
39-
RFC3339DateFormat clone = (RFC3339DateFormat) super.clone();
40-
clone.calendar = (GregorianCalendar) this.calendar.clone();
41-
return clone;
36+
return this;
4237
}
4338
}

samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/RFC3339DateFormat.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,26 @@ public class RFC3339DateFormat extends DateFormat {
1313
private static final long serialVersionUID = 1L;
1414
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
1515

16+
private final StdDateFormat fmt = new StdDateFormat()
17+
.withTimeZone(TIMEZONE_Z)
18+
.withColonInTimeZone(true);
19+
1620
public RFC3339DateFormat() {
1721
this.calendar = new GregorianCalendar();
18-
this.calendar.setTimeZone(TIMEZONE_Z);
1922
}
2023

2124
@Override
2225
public Date parse(String source, ParsePosition pos) {
23-
return createFormatter().parse(source, pos);
26+
return fmt.parse(source, pos);
2427
}
2528

2629
@Override
2730
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
28-
return createFormatter().format(date, toAppendTo, fieldPosition);
29-
}
30-
31-
private StdDateFormat createFormatter() {
32-
return new StdDateFormat()
33-
.withTimeZone(TIMEZONE_Z)
34-
.withColonInTimeZone(true);
31+
return fmt.format(date, toAppendTo, fieldPosition);
3532
}
3633

3734
@Override
3835
public Object clone() {
39-
RFC3339DateFormat clone = (RFC3339DateFormat) super.clone();
40-
clone.calendar = (GregorianCalendar) this.calendar.clone();
41-
return clone;
36+
return this;
4237
}
4338
}

0 commit comments

Comments
 (0)