From 74da89c6ac2517ea086d22a4d1d957f1f82aff12 Mon Sep 17 00:00:00 2001 From: Clem Date: Mon, 13 Feb 2017 11:07:00 +0100 Subject: [PATCH] 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. --- .../src/main/resources/JavaInflector/pojo.mustache | 4 ++-- .../src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache | 4 ++-- .../src/main/resources/JavaJaxRS/cxf/pojo.mustache | 2 +- .../src/main/resources/JavaJaxRS/resteasy/pojo.mustache | 4 ++-- .../src/main/resources/JavaJaxRS/spec/pojo.mustache | 4 ++-- .../swagger-codegen/src/main/resources/undertow/pojo.mustache | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaInflector/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaInflector/pojo.mustache index 56869755b79..d5d57bc6910 100644 --- a/modules/swagger-codegen/src/main/resources/JavaInflector/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaInflector/pojo.mustache @@ -47,7 +47,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -79,7 +79,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache index 93f920d4d12..04a5b76ea45 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache @@ -37,7 +37,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -69,7 +69,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache index 09c8fc1fecc..c071a0d9c80 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pojo.mustache @@ -94,7 +94,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private static String toIndentedString(Object o) { + private static String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pojo.mustache index 4c84bc6e6a0..612767afd14 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pojo.mustache @@ -29,7 +29,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -61,7 +61,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pojo.mustache index 51090c995e1..4d43b69319c 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pojo.mustache @@ -33,7 +33,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -65,7 +65,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } diff --git a/modules/swagger-codegen/src/main/resources/undertow/pojo.mustache b/modules/swagger-codegen/src/main/resources/undertow/pojo.mustache index e63ecfe2f47..69dce348fe3 100644 --- a/modules/swagger-codegen/src/main/resources/undertow/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/undertow/pojo.mustache @@ -32,7 +32,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} @Override - public boolean equals(Object o) { + public boolean equals(java.lang.Object o) { if (this == o) { return true; } @@ -64,7 +64,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(Object o) { + private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; }