jindrapetrik opened a new issue, #6666:
URL: https://github.com/apache/netbeans/issues/6666
### Apache NetBeans version
Apache NetBeans 19
### What happened
I am trying to format following code with menu Source->Format command:
```java
int k = 5;
switch (k) {
case 1:
try {
System.out.println("hello from try");
} catch (Exception ex) {
System.out.println("in catch");
}
break;
case 2:
System.out.println("in 2");
break;
}
```
The result:
```java
int k = 5;
switch (k) {
case 1:
try {
System.out.println("hello from try");
} catch (Exception ex) {
System.out.println("in catch");
}
break;
case 2:
System.out.println("in 2");
break;
}
```
The catch clause till break is one level lower than it should be.
### How to reproduce
Write try..catch statement inside switch case and hit Source->Format.
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Windows 11
### JDK
19, 64bit
### Apache NetBeans packaging
Apache NetBeans provided installer
### Anything else
_No response_
### Are you willing to submit a pull request?
No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists