File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed
packages/prettier-plugin-java Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -394,9 +394,9 @@ export default {
394394 return join ( " " , blocks ) ;
395395 } ,
396396
397- resourceSpecification ( path , print , options ) {
397+ resourceSpecification ( path , print ) {
398398 const resources = [ call ( path , print , "resourceList" ) ] ;
399- if ( options . trailingComma !== "none" ) {
399+ if ( path . node . children . Semicolon ) {
400400 resources . push ( ifBreak ( ";" ) ) ;
401401 }
402402 return indentInParentheses ( resources ) ;
Original file line number Diff line number Diff line change @@ -62,4 +62,14 @@ void multiResourceTry() {
6262 }
6363 }
6464
65+ void multiResourceTryWithTrailingSemi () {
66+ try (
67+ FirstResource firstResource = new FirstResource ();
68+ SecondResource secondResource = new SecondResource ();
69+ ) {
70+ return br .readLine ();
71+ } catch (ArithmeticException | ArrayIndexOutOfBoundsException e ) {
72+ System .out .println ("Warning: Not breaking multi exceptions" );
73+ }
74+ }
6575}
Original file line number Diff line number Diff line change @@ -59,6 +59,17 @@ void resourceTry() {
5959 }
6060
6161 void multiResourceTry () {
62+ try (
63+ FirstResource firstResource = new FirstResource ();
64+ SecondResource secondResource = new SecondResource ()
65+ ) {
66+ return br .readLine ();
67+ } catch (ArithmeticException | ArrayIndexOutOfBoundsException e ) {
68+ System .out .println ("Warning: Not breaking multi exceptions" );
69+ }
70+ }
71+
72+ void multiResourceTryWithTrailingSemi () {
6273 try (
6374 FirstResource firstResource = new FirstResource ();
6475 SecondResource secondResource = new SecondResource ();
You can’t perform that action at this time.
0 commit comments