neilcsmith-net commented on code in PR #6678:
URL: https://github.com/apache/netbeans/pull/6678#discussion_r1389084508


##########
java/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java:
##########
@@ -2205,6 +2205,93 @@ public void run(WorkingCopy workingCopy) throws 
java.io.IOException {
         preferences.putBoolean("indentCasesFromSwitch", true);
 
     }
+
+    public void testSwitchWithTryExpr() throws Exception {
+        testFile = new File(getWorkDir(), "Test.java");
+        TestUtilities.copyStringToFile(testFile, "");
+        FileObject testSourceFO = FileUtil.toFileObject(testFile);
+        DataObject testSourceDO = DataObject.find(testSourceFO);
+        EditorCookie ec = (EditorCookie) 
testSourceDO.getCookie(EditorCookie.class);
+        final Document doc = ec.openDocument();
+        doc.putProperty(Language.class, JavaTokenId.language());
+
+        String content
+                = "package hierbas.del.litoral;\n\n"
+                + "public class Test {\n\n"
+                + "    public void taragui(int i) {\n"
+                + "        switch (i) {\n"
+                + "        case 0:\n"
+                + "        try {\n"
+                + "        System.out.println(i);\n"
+                + "        } catch (Exception ex) {\n"
+                + "        System.out.println(ex);\n"
+                + "        }\n"
+                + "        break;\n"
+                + "        default:\n"
+                + "        System.out.println(\"DEFAULT\");\n"
+                + "        }\n"
+                + "    }\n"
+                + "}\n";
+
+        String golden
+                = "package hierbas.del.litoral;\n\n"
+                + "public class Test {\n\n"
+                + "    public void taragui(int i) {\n"
+                + "        switch (i) {\n"
+                + "            case 0:\n"
+                + "                try {\n"
+                + "                    System.out.println(i);\n"
+                + "                } catch (Exception ex) {\n"
+                + "                    System.out.println(ex);\n"
+                + "                }\n"
+                + "                break;\n"

Review Comment:
   I had all these in the file I was debugging with, and can look into adding 
them.  This file will be so much nicer when we can finally use text blocks!



-- 
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

Reply via email to