Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManoj Palat2015-04-07 12:04:55 +0000
committerManoj Palat2015-04-07 12:04:55 +0000
commit959aac6fcb83b61039c3ddae468ad5563b6ccb62 (patch)
treeb4d390e2dfec5a7b3b6564e88004d0b9664779f7
parent290693fab6c14fd3b3082c184001228213a11167 (diff)
downloadeclipse.jdt.core-959aac6fcb83b61039c3ddae468ad5563b6ccb62.tar.gz
eclipse.jdt.core-959aac6fcb83b61039c3ddae468ad5563b6ccb62.tar.xz
eclipse.jdt.core-959aac6fcb83b61039c3ddae468ad5563b6ccb62.zip
Test case for Bug 434821 [formatter] Comment at end of line messes withI20150408-1100
indentation
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugs18Tests.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugs18Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugs18Tests.java
index 42e10d52aa..f9dcb0ac74 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugs18Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugs18Tests.java
@@ -204,5 +204,37 @@ public void testBug433177() throws Exception {
formatSource(source,expected);
}
+public void testBug434821() throws Exception {
+ String source ="public class FormatterTest {\n"+
+ " public void doNothing() {\n"+
+ " new Thread(() -> {\n"+
+ " synchronized (this) {\n"+
+ " try {\n"+
+ " Thread.sleep(0); // blah\n"+
+ " } catch (final InterruptedException e2) {\n"+
+ " e2.printStackTrace();\n"+
+ " }\n"+
+ " }\n"+
+ "\n"+
+ " } ).start();\n"+
+ " }\n"+
+ "}\n";
+ String expected = "public class FormatterTest {\n"+
+ " public void doNothing() {\n"+
+ " new Thread(() -> {\n"+
+ " synchronized (this) {\n"+
+ " try {\n"+
+ " Thread.sleep(0); // blah\n"+
+ " } catch (final InterruptedException e2) {\n"+
+ " e2.printStackTrace();\n"+
+ " }\n"+
+ " }\n"+
+ "\n"+
+ " } ).start();\n"+
+ " }\n"+
+ "}\n";
+
+ formatSource(source,expected);
+}
} \ No newline at end of file

Back to the top