Skip to content

prettier breaks try-with-resource with multiple assignment #71

@victornoel

Description

@victornoel

Applying prettier-java to https://github.com/yegor256/cactoos/blob/master/src/main/java/org/cactoos/io/BytesOf.java gives me the following diff which doesn't compile anymore:

@@ -297,17 +299,19 @@ public final class BytesOf implements Bytes {
      * @param charset Charset
      * @since 0.29
      */
-    public BytesOf(final StackTraceElement[] strace,
-        final CharSequence charset) {
+    public BytesOf(
+        final StackTraceElement[] strace,
+        final CharSequence charset
+    ) {
         this(
             () -> {
-                try (
-                    final ByteArrayOutputStream baos =
-                        new ByteArrayOutputStream();
-                    final PrintStream stream = new PrintStream(
-                        baos, true, charset.toString()
-                    )
-                ) {
+                try (final ByteArrayOutputStream baos = new ByteArrayOutputStream(
+
+                )final PrintStream stream = new PrintStream(
+                    baos,
+                    true,
+                    charset.toString()
+                )){
                     for (final StackTraceElement element : strace) {
                         stream.append(element.toString());
                         stream.append("\n");

It seems that a ; is lost in the process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions