Skip to content

Commit 74da89c

Browse files
Clemwing328
authored andcommitted
Fix issue when the swagger model contains an 'Object' class (#4695)
If the swagger model contains a class named 'Object' some mustache templates will generate non compiling **Java** code.
1 parent a956966 commit 74da89c

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

modules/swagger-codegen/src/main/resources/JavaInflector/pojo.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
4747
{{/vars}}
4848

4949
@Override
50-
public boolean equals(Object o) {
50+
public boolean equals(java.lang.Object o) {
5151
if (this == o) {
5252
return true;
5353
}
@@ -79,7 +79,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
7979
* Convert the given object to string with each line indented by 4 spaces
8080
* (except the first line).
8181
*/
82-
private String toIndentedString(Object o) {
82+
private String toIndentedString(java.lang.Object o) {
8383
if (o == null) {
8484
return "null";
8585
}

modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
3737
{{/vars}}
3838

3939
@Override
40-
public boolean equals(Object o) {
40+
public boolean equals(java.lang.Object o) {
4141
if (this == o) {
4242
return true;
4343
}
@@ -69,7 +69,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
6969
* Convert the given object to string with each line indented by 4 spaces
7070
* (except the first line).
7171
*/
72-
private String toIndentedString(Object o) {
72+
private String toIndentedString(java.lang.Object o) {
7373
if (o == null) {
7474
return "null";
7575
}

modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
9494
* Convert the given object to string with each line indented by 4 spaces
9595
* (except the first line).
9696
*/
97-
private static String toIndentedString(Object o) {
97+
private static String toIndentedString(java.lang.Object o) {
9898
if (o == null) {
9999
return "null";
100100
}

modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pojo.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
2929
{{/vars}}
3030

3131
@Override
32-
public boolean equals(Object o) {
32+
public boolean equals(java.lang.Object o) {
3333
if (this == o) {
3434
return true;
3535
}
@@ -61,7 +61,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
6161
* Convert the given object to string with each line indented by 4 spaces
6262
* (except the first line).
6363
*/
64-
private String toIndentedString(Object o) {
64+
private String toIndentedString(java.lang.Object o) {
6565
if (o == null) {
6666
return "null";
6767
}

modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pojo.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
3333
{{/vars}}
3434

3535
@Override
36-
public boolean equals(Object o) {
36+
public boolean equals(java.lang.Object o) {
3737
if (this == o) {
3838
return true;
3939
}
@@ -65,7 +65,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
6565
* Convert the given object to string with each line indented by 4 spaces
6666
* (except the first line).
6767
*/
68-
private String toIndentedString(Object o) {
68+
private String toIndentedString(java.lang.Object o) {
6969
if (o == null) {
7070
return "null";
7171
}

modules/swagger-codegen/src/main/resources/undertow/pojo.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
3232
{{/vars}}
3333

3434
@Override
35-
public boolean equals(Object o) {
35+
public boolean equals(java.lang.Object o) {
3636
if (this == o) {
3737
return true;
3838
}
@@ -64,7 +64,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
6464
* Convert the given object to string with each line indented by 4 spaces
6565
* (except the first line).
6666
*/
67-
private String toIndentedString(Object o) {
67+
private String toIndentedString(java.lang.Object o) {
6868
if (o == null) {
6969
return "null";
7070
}

0 commit comments

Comments
 (0)