mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-79836 Java formatter: Correct processing of incomplete method call expression with anonymous class arguments
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -150,7 +150,7 @@ public class JavaFormatterBracesTest extends AbstractJavaFormatterTest {
|
||||
"class Test \n" +
|
||||
"{\n" +
|
||||
" void foo() {\n" +
|
||||
" bind(new TypeLiteral<MyType>(){}).toProvider(MyProvider.class);\n" +
|
||||
" bind(new TypeLiteral<MyType>() {}).toProvider(MyProvider.class);\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
doTextTest(text, text);
|
||||
|
||||
+22
@@ -467,4 +467,26 @@ public class JavaFormatterIndentationTest extends AbstractJavaFormatterTest {
|
||||
"}";
|
||||
doTextTest(text, text);
|
||||
}
|
||||
|
||||
public void testIncompleteMethodCall() throws Exception {
|
||||
// Inspired by IDEA-79836.
|
||||
|
||||
doMethodTest(
|
||||
"test(new Runnable() {\n" +
|
||||
" public void run() {\n" +
|
||||
" }\n" +
|
||||
" }, new Runnable() {\n" +
|
||||
" public void run() {\n" +
|
||||
" }\n" +
|
||||
" }, )",
|
||||
"test(new Runnable() {\n" +
|
||||
" public void run() {\n" +
|
||||
" }\n" +
|
||||
" }, new Runnable() {\n" +
|
||||
" public void run() {\n" +
|
||||
" }\n" +
|
||||
" },\n" +
|
||||
")"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user