This is an automated email from the ASF dual-hosted git repository. jlahoda pushed a commit to branch release90 in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git
commit 684ecdf3cbcd19dfa8a34db8e06e49f2ccc8c33f Author: Vikas Prabhakar <[email protected]> AuthorDate: Fri Jun 1 13:45:21 2018 +0530 [NetBeans-778] Apply source format --- .../modules/java/source/save/Reformatter.java | 8 ++++---- .../modules/java/source/save/FormatingTest.java | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java b/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java index ce1140e..b531003 100644 --- a/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java +++ b/java.source.base/src/org/netbeans/modules/java/source/save/Reformatter.java @@ -1200,10 +1200,10 @@ public class Reformatter implements ReformatTask { if (node.getType() != null) { spaces(1, fieldGroup); }else { - if(tokens.token().id() == JavaTokenId.VAR){ - //Add space after 'var' token - addDiff(new Diff(tokens.offset() + 3, tokens.offset() + 3, " ")); - tokens.moveNext(); + if (tokens.token().id() == JavaTokenId.VAR) { + //Add space after 'var' token + addDiff(new Diff(tokens.offset() + 3, tokens.offset() + 3, " ")); + tokens.moveNext(); } } if (!ERROR.contentEquals(node.getName())) diff --git a/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java b/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java index c360721..20edd01 100644 --- a/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java +++ b/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java @@ -4462,19 +4462,19 @@ public class FormatingTest extends NbTestCase { TestUtilities.copyStringToFile(testFile, ""); FileObject testSourceFO = FileUtil.toFileObject(testFile); DataObject testSourceDO = DataObject.find(testSourceFO); - EditorCookie ec = (EditorCookie)testSourceDO.getCookie(EditorCookie.class); + 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" + String content + = "package hierbas.del.litoral;\n\n" + "public class Test {\n\n" + " public static void main(String[] args) {\n" + " var v = 10; \n" + " }\n" + "}\n"; - String golden = - "package hierbas.del.litoral;\n\n" + String golden + = "package hierbas.del.litoral;\n\n" + "public class Test {\n\n" + " public static void main(String[] args) {\n" + " var v = 10;\n" @@ -4488,19 +4488,19 @@ public class FormatingTest extends NbTestCase { TestUtilities.copyStringToFile(testFile, ""); FileObject testSourceFO = FileUtil.toFileObject(testFile); DataObject testSourceDO = DataObject.find(testSourceFO); - EditorCookie ec = (EditorCookie)testSourceDO.getCookie(EditorCookie.class); + 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" + String content + = "package hierbas.del.litoral;\n\n" + "public class Test {\n\n" + " public static void main(String[] args) {\n" + " final var v = 10; \n" + " }\n" + "}\n"; - String golden = - "package hierbas.del.litoral;\n\n" + String golden + = "package hierbas.del.litoral;\n\n" + "public class Test {\n\n" + " public static void main(String[] args) {\n" + " final var v = 10;\n" -- To stop receiving notification emails like this one, please contact [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
