You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2023/01/19 13:29:45 UTC

[GitHub] [netbeans] kemperalves opened a new issue, #5323: Netbeans Incorrect Code Format

kemperalves opened a new issue, #5323:
URL: https://github.com/apache/netbeans/issues/5323

   ### Apache NetBeans version
   
   Apache NetBeans 16
   
   ### What happened
   
   Today netbeans formatted my code erroneous, I converted the code to a simple sample with same structure and then the code continue to be wrong formatted.
   
   ### How to reproduce
   
   1 - Create a new java project with a main class.
   
   2 -Make your main function above:
   
   ```
   
       public static void main(String[] args) throws Exception {
   
           List<String> myList = new ArrayList<>();
   
           for (String s : myList) {
               if (!s.isBlank()) {
   
                   switch (s.substring(0, 1)) {
                       case "T":
                           System.out.println("T");
                           break;
                       case "N":                               
                                   try {
                           System.out.println(Long.valueOf(s));
                       } catch (Exception ex) {
                           throw new Exception("FIRST ERROR MESSAGE");
                       }
                       break;
                       case "F":
                                       try {
                           System.out.println(new BigDecimal(s));
                       } catch (Exception ex) {
                           throw new Exception("ANOTHER ERROR MESSAGE");
                       }
                       break;
                       case "M":
                                       try {
                           System.out.println(new BigDecimal(s));
                       } catch (Exception ex) {
                           throw new Exception("OPS, MORE ONE ERROR MESSAGE");
                       }
                       break;
                       case "D":
                           throw new Exception("THIS VALUE CAN NOT BE USED");
                       case "L":
                                   try {
                           System.out.println(Boolean.valueOf(s));
                       } catch (Exception ex) {
                           throw new Exception("THIS VALUE IS NOT A BOOLEAN");
                       }
                       break;
                   }
               }
           }
   
       }
   
   
   ```
   
   3 - Click in Source / Format or type the keyboard shortcut
   
   And then, the code is formatted but, incorrect. the try blocks is not aligned, the breaks statements not aligned too.
   
   
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   macOS 13.1 (22C65), Darwin 22.2.0, MacBookPro18,3, MKGP3LL/A
   
   ### JDK
   
   JDK 18, zulu
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No
   
   ### Code of Conduct
   
   Yes


-- 
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: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] keshavcodex commented on issue #5323: Netbeans Incorrect Code Format for Java Source

Posted by "keshavcodex (via GitHub)" <gi...@apache.org>.
keshavcodex commented on issue #5323:
URL: https://github.com/apache/netbeans/issues/5323#issuecomment-1606258514

   Hey, i am new here can I take this issue?


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] kemperalves commented on issue #5323: Netbeans Incorrect Code Format for Java Source

Posted by GitBox <gi...@apache.org>.
kemperalves commented on issue #5323:
URL: https://github.com/apache/netbeans/issues/5323#issuecomment-1396982793

   The try blocks is not aligned and the blocks with these tyrs the break statement is wrong too.
   
   <img width="549" alt="image" src="https://user-images.githubusercontent.com/27026273/213455648-385443d4-8c1f-49f3-b431-d550465a3b13.png">
   


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] neilcsmith-net commented on issue #5323: Netbeans Incorrect Code Format for Java Source

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on issue #5323:
URL: https://github.com/apache/netbeans/issues/5323#issuecomment-1607279954

   I'd forgotten about this little annoyance.  Putting a milestone on it as something to track for NB19.
   
   @keshavcodex go for it! :+1: Anyone can open a PR for NetBeans - you don't need anyone's permission or to be assigned to work on something, and as Brad said, your efforts would be welcome.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] BradWalker commented on issue #5323: Netbeans Incorrect Code Format for Java Source

Posted by "BradWalker (via GitHub)" <gi...@apache.org>.
BradWalker commented on issue #5323:
URL: https://github.com/apache/netbeans/issues/5323#issuecomment-1607271061

   Hey @keshavcodex , yes you can "take" it.
   
   As we are mostly volunteers here, there are a few people paid to work on Netbeans I believe, your efforts would be welcome. I'm confident we would welcome a fix if you proposed something.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] neilcsmith-net commented on issue #5323: Netbeans Incorrect Code Format for Java Source

Posted by GitBox <gi...@apache.org>.
neilcsmith-net commented on issue #5323:
URL: https://github.com/apache/netbeans/issues/5323#issuecomment-1397287515

   Can replicate.  Only seems to be if the `try` directly follows the `case` statement.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [I] Netbeans Incorrect Code Format for Java Source [netbeans]

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net closed issue #5323: Netbeans Incorrect Code Format for Java Source
URL: https://github.com/apache/netbeans/issues/5323


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists