diff --git a/src/JavaCodeGenerator.cs b/src/JavaCodeGenerator.cs index c6277d3c27..fed4abfba3 100644 --- a/src/JavaCodeGenerator.cs +++ b/src/JavaCodeGenerator.cs @@ -333,8 +333,7 @@ private static Service ParseService(AutoRestCodeModel codeModel, JavaSettings se "protected","public", "return", "short", "static", "strictfp", "super", "switch", "synchronized","this", "throw", "throws", "transient","true", "try", - "void", "volatile", "while", "date", "datetime", - "period", "stream", "string", "object", "header" + "void", "volatile", "while" }); if (!settings.IsAzureOrFluent) diff --git a/test/vanilla/src/main/java/fixtures/bodyarray/models/Product.java b/test/vanilla/src/main/java/fixtures/bodyarray/models/Product.java index 3af1b96207..305dd876d7 100644 --- a/test/vanilla/src/main/java/fixtures/bodyarray/models/Product.java +++ b/test/vanilla/src/main/java/fixtures/bodyarray/models/Product.java @@ -23,10 +23,10 @@ public final class Product { private Integer integer; /** - * The stringProperty property. + * The string property. */ @JsonProperty(value = "string") - private String stringProperty; + private String string; /** * Get the integer value. @@ -49,22 +49,22 @@ public Product withInteger(Integer integer) { } /** - * Get the stringProperty value. + * Get the string value. * - * @return the stringProperty value. + * @return the string value. */ - public String stringProperty() { - return this.stringProperty; + public String string() { + return this.string; } /** - * Set the stringProperty value. + * Set the string value. * - * @param stringProperty the stringProperty value to set. + * @param string the string value to set. * @return the Product object itself. */ - public Product withStringProperty(String stringProperty) { - this.stringProperty = stringProperty; + public Product withString(String string) { + this.string = string; return this; } } diff --git a/test/vanilla/src/main/java/fixtures/bodydictionary/models/Widget.java b/test/vanilla/src/main/java/fixtures/bodydictionary/models/Widget.java index 8f9f1681d9..b4f255ead3 100644 --- a/test/vanilla/src/main/java/fixtures/bodydictionary/models/Widget.java +++ b/test/vanilla/src/main/java/fixtures/bodydictionary/models/Widget.java @@ -23,10 +23,10 @@ public final class Widget { private Integer integer; /** - * The stringProperty property. + * The string property. */ @JsonProperty(value = "string") - private String stringProperty; + private String string; /** * Get the integer value. @@ -49,22 +49,22 @@ public Widget withInteger(Integer integer) { } /** - * Get the stringProperty value. + * Get the string value. * - * @return the stringProperty value. + * @return the string value. */ - public String stringProperty() { - return this.stringProperty; + public String string() { + return this.string; } /** - * Set the stringProperty value. + * Set the string value. * - * @param stringProperty the stringProperty value to set. + * @param string the string value to set. * @return the Widget object itself. */ - public Widget withStringProperty(String stringProperty) { - this.stringProperty = stringProperty; + public Widget withString(String string) { + this.string = string; return this; } } diff --git a/test/vanilla/src/test/java/fixtures/bodyarray/ArrayTests.java b/test/vanilla/src/test/java/fixtures/bodyarray/ArrayTests.java index 6fd49e3ba1..58649c63e5 100644 --- a/test/vanilla/src/test/java/fixtures/bodyarray/ArrayTests.java +++ b/test/vanilla/src/test/java/fixtures/bodyarray/ArrayTests.java @@ -439,7 +439,7 @@ public void getComplexItemNull() { public void getComplexItemEmpty() { List result = client.arrays().getComplexItemEmpty(); assertEquals(3, result.size()); - assertNull(result.get(1).stringProperty()); + assertNull(result.get(1).string()); } @Test @@ -447,7 +447,7 @@ public void getComplexValid() { List result = client.arrays().getComplexValid(); assertEquals(3, result.size()); assertEquals(5, result.get(2).integer().intValue()); - assertEquals("6", result.get(2).stringProperty()); + assertEquals("6", result.get(2).string()); } @Test @@ -455,15 +455,15 @@ public void putComplexValid() { List body = new ArrayList<>(); Product p1 = new Product(); p1.withInteger(1); - p1.withStringProperty("2"); + p1.withString("2"); body.add(p1); Product p2 = new Product(); p2.withInteger(3); - p2.withStringProperty("4"); + p2.withString("4"); body.add(p2); Product p3 = new Product(); p3.withInteger(5); - p3.withStringProperty("6"); + p3.withString("6"); body.add(p3); client.arrays().putComplexValid(body); } diff --git a/test/vanilla/src/test/java/fixtures/bodydictionary/DictionaryTests.java b/test/vanilla/src/test/java/fixtures/bodydictionary/DictionaryTests.java index 77f0603f10..bd165bfc81 100644 --- a/test/vanilla/src/test/java/fixtures/bodydictionary/DictionaryTests.java +++ b/test/vanilla/src/test/java/fixtures/bodydictionary/DictionaryTests.java @@ -452,7 +452,7 @@ public void getComplexItemEmpty() { Map result = client.dictionarys().getComplexItemEmpty(); assertEquals(3, result.size()); assertNull(result.get("1").integer()); - assertNull(result.get("1").stringProperty()); + assertNull(result.get("1").string()); } @Test @@ -460,7 +460,7 @@ public void getComplexValid() { Map result = client.dictionarys().getComplexValid(); assertEquals(3, result.size()); assertEquals(1, result.get("0").integer().intValue()); - assertEquals("4", result.get("1").stringProperty()); + assertEquals("4", result.get("1").string()); } @Test @@ -468,15 +468,15 @@ public void putComplexValid() { Map body = new HashMap<>(); Widget w1 = new Widget(); w1.withInteger(1); - w1.withStringProperty("2"); + w1.withString("2"); body.put("0", w1); Widget w2 = new Widget(); w2.withInteger(3); - w2.withStringProperty("4"); + w2.withString("4"); body.put("1", w2); Widget w3 = new Widget(); w3.withInteger(5); - w3.withStringProperty("6"); + w3.withString("6"); body.put("2", w3); client.dictionarys().putComplexValid(body); } diff --git a/test/xml/src/main/java/fixtures/xml/models/Slideshow.java b/test/xml/src/main/java/fixtures/xml/models/Slideshow.java index b347d7f342..1c244a6a35 100644 --- a/test/xml/src/main/java/fixtures/xml/models/Slideshow.java +++ b/test/xml/src/main/java/fixtures/xml/models/Slideshow.java @@ -28,10 +28,10 @@ public final class Slideshow { private String title; /** - * The dateProperty property. + * The date property. */ @JacksonXmlProperty(localName = "date", isAttribute = true) - private String dateProperty; + private String date; /** * The author property. @@ -66,22 +66,22 @@ public Slideshow withTitle(String title) { } /** - * Get the dateProperty value. + * Get the date value. * - * @return the dateProperty value. + * @return the date value. */ - public String dateProperty() { - return this.dateProperty; + public String date() { + return this.date; } /** - * Set the dateProperty value. + * Set the date value. * - * @param dateProperty the dateProperty value to set. + * @param date the date value to set. * @return the Slideshow object itself. */ - public Slideshow withDateProperty(String dateProperty) { - this.dateProperty = dateProperty; + public Slideshow withDate(String date) { + this.date = date; return this; } diff --git a/test/xml/src/test/java/fixtures/xml/XmlsTests.java b/test/xml/src/test/java/fixtures/xml/XmlsTests.java index 82d33ee373..a1b2208dbc 100644 --- a/test/xml/src/test/java/fixtures/xml/XmlsTests.java +++ b/test/xml/src/test/java/fixtures/xml/XmlsTests.java @@ -31,7 +31,7 @@ public void getSimpleDocument() { Slideshow slideshow = client.xmls().getSimple(); assertNotNull(slideshow); assertEquals("Yours Truly", slideshow.author()); - assertEquals("Date of publication", slideshow.dateProperty()); + assertEquals("Date of publication", slideshow.date()); assertEquals("Sample Slide Show", slideshow.title()); assertNotNull(slideshow.slides()); @@ -56,7 +56,7 @@ public void getEmptyList() { assertNotNull(slideshow.slides()); assertEquals(null, slideshow.title()); assertEquals(null, slideshow.author()); - assertEquals(null, slideshow.dateProperty()); + assertEquals(null, slideshow.date()); assertEquals(0, slideshow.slides().size()); }