Closed renovate[bot] closed 2 years ago
This PR contains the following updates:
1.0.2
1.6.1
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.
This PR contains the following updates:
1.0.2
->1.6.1
Release Notes
jhipster/prettier-java
### [`v1.6.1`](https://togithub.com/jhipster/prettier-java/blob/HEAD/CHANGELOG.md#Latest-v161) [Compare Source](https://togithub.com/jhipster/prettier-java/compare/prettier-plugin-java@1.6.0...prettier-plugin-java@1.6.1) #### Fixes - Fix parsing of nested sealed and non-sealed classes (Issue [#522](https://togithub.com/jhipster/prettier-java/issues/522) closed with [#523](https://togithub.com/jhipster/prettier-java/pull/523)) ```java // Input public class SealedClasses { public static sealed abstract class SealedParent permits SealedChild {} final static class SealedChild extends SealedParent {} } // Output public class NestedSealedClasses { public abstract static sealed class SealedParent permits SealedChild {} static final class SealedChild extends SealedParent {} } ``` ### [`v1.6.0`](https://togithub.com/jhipster/prettier-java/blob/HEAD/CHANGELOG.md#v160) [Compare Source](https://togithub.com/jhipster/prettier-java/compare/prettier-plugin-java@1.5.0...prettier-plugin-java@1.6.0) #### Enhancements - Improve formatting of records parameters with annotations ```java // Input public record Record( @JsonSerialize(using = StatusSerializer.class, nullsUsing = NullSerializer.class) @Schema(type = "integer", description = "Some fancy description") Status status, @NotNull Integer number ) {} public record Record( @JsonSerialize(using = StatusSerializer.class, nullsUsing = NullSerializer.class) @Schema(type = "integer", description = "Some fancy description") // comment Status status, // another comment @NotNull Integer number ) {} // Prettier v1.5.0 public record Record( @JsonSerialize( using = StatusSerializer.class, nullsUsing = NullSerializer.class ) @Schema( type = "integer", description = "Some fancy description" ) Status status, @NotNull Integer number ) {} public record Record( @JsonSerialize( using = StatusSerializer.class, nullsUsing = NullSerializer.class ) @Schema(type = "integer", description = "Some fancy description") // comment Status status, // another comment @NotNull Integer number ) {} // Prettier v1.6.0 public record Record( @JsonSerialize( using = StatusSerializer.class, nullsUsing = NullSerializer.class ) @Schema(type = "integer", description = "Some fancy description") Status status, @NotNull Integer number ) {} public record Record( @JsonSerialize( using = StatusSerializer.class, nullsUsing = NullSerializer.class ) @Schema(type = "integer", description = "Some fancy description") // comment Status status, // another comment @NotNull Integer number ) {} ``` #### Fixes - Fix casting with additional bounds ```java // Input class Example { void should_cast_with_single_element() { var myElem = (int) othrElement; var myElem = (A) othrElement; var myElem = (A) (othrElement, value) -> othrElement + value; var myElem = (Aaeaozeaonzeoazneaozenazonelkadndpndpazdpazdpazdpazdpazeazpeaazdpazdpazpdazdpa) othrElement; } void should_cast_with_additional_bounds() { foo((A & B) obj); foo((A & B & C) obj); foo((Aaeaozeaonzeoazneaozenazone & Bazoieoainzeonaozenoazne & Cjneazeanezoanezoanzeoaneonazeono) obj); foo((Aaeaozeaonzeoazneaozenazone & Bazoieoainzeonaozenoazne & Cjneazeanezoanezoanzeoaneonazeono) (othrElement, value) -> othrElement + value); } } // Prettier v1.5.0 class Example { void should_cast_with_single_element() { var myElem = (int) othrElement; var myElem = (A) othrElement; var myElem = (A) (othrElement, value) -> othrElement + value; var myElem = (Aaeaozeaonzeoazneaozenazonelkadndpndpazdpazdpazdpazdpazeazpeaazdpazdpazpdazdpa) othrElement; } void should_cast_with_additional_bounds() { foo((A) & B obj); foo((A) & B& C obj); foo( (Aaeaozeaonzeoazneaozenazone) & Bazoieoainzeonaozenoazne& Cjneazeanezoanezoanzeoaneonazeono obj ); foo( (Aaeaozeaonzeoazneaozenazone) & Bazoieoainzeonaozenoazne& Cjneazeanezoanezoanzeoaneonazeono ( othrElement, value ) -> othrElement + value ); } } // Prettier v1.6.0 class Example { void should_cast_with_single_element() { var myElem = (int) othrElement; var myElem = (A) othrElement; var myElem = (A) (othrElement, value) -> othrElement + value; var myElem = (Aaeaozeaonzeoazneaozenazonelkadndpndpazdpazdpazdpazdpazeazpeaazdpazdpazpdazdpa) othrElement; } void should_cast_with_additional_bounds() { foo((A & B) obj); foo((A & B & C) obj); foo( ( Aaeaozeaonzeoazneaozenazone & Bazoieoainzeonaozenoazne & Cjneazeanezoanezoanzeoaneonazeono ) obj ); foo( ( Aaeaozeaonzeoazneaozenazone & Bazoieoainzeonaozenoazne & Cjneazeanezoanezoanzeoaneonazeono ) (othrElement, value) -> othrElement + value ); } } ``` ### [`v1.5.0`](https://togithub.com/jhipster/prettier-java/blob/HEAD/CHANGELOG.md#v150) [Compare Source](https://togithub.com/jhipster/prettier-java/compare/v1.4.0...prettier-plugin-java@1.5.0) #### Enhancements - Split record parameters on several lines if they do not fit on a single line ([#509](https://togithub.com/jhipster/prettier-java/pull/509)) ```java // Input public record Person( String firstName, String lastName, String email, String phoneNumber, String streetAddress, String city, String state, String zipCode ) {} // Prettier 1.4.0 public record Person( String firstName, String lastName, String email, String phoneNumber, String streetAddress, String city, String state, String zipCode ) {} // Prettier 1.5.0 public record Person( String firstName, String lastName, String email, String phoneNumber, String streetAddress, String city, String state, String zipCode ) {} ``` - Support pattern matching in switch statements preview feature ([#511](https://togithub.com/jhipster/prettier-java/pull/511)) ```java // Input class T { static String formatterPatternSwitch(Object o) { return switch (o) { case Integer i -> String.format("int %d", i); case Long l -> String.format("long %d", l); case Double d -> String.format("double %f", d); case String s -> String.format("String %s", s); case TOTO -> String.format("TOTO %s", o); case null -> String.format("Null !"); case default -> String.format("Default !"); default -> o.toString(); }; } } // Output class T { static String formatterPatternSwitch(Object o) { return switch (o) { case Integer i -> String.format("int %d", i); case Long l -> String.format("long %d", l); case Double d -> String.format("double %f", d); case String s -> String.format("String %s", s); case TOTO -> String.format("TOTO %s", o); case null -> String.format("Null !"); case default -> String.format("Default !"); default -> o.toString(); }; } } ``` - Improve printing of class with long typeParameterList ([#512](https://togithub.com/jhipster/prettier-java/pull/512)) ```java // Input public class ComplexGenericClassConfiguration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.