mbien commented on PR #8740:
URL: https://github.com/apache/netbeans/pull/8740#issuecomment-3218465009
@jherkel thanks! Could you add this test and squash it to one commit?
```diff
diff --git
a/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java
b/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java
index d5962a9..6081f97 100644
---
a/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java
+++
b/java/java.source.base/test/unit/src/org/netbeans/modules/java/source/save/FormatingTest.java
@@ -6753,6 +6753,35 @@
+ "}\n";
reformat(doc, content, golden);
}
+
+ // #6573
+ public void testRecordConstructorReformat() throws Exception {
+ sourceLevel="16";
+ JavacParser.DISABLE_SOURCE_LEVEL_DOWNGRADE = true;
+ testFile = new File(getWorkDir(), "Test.java");
+ TestUtilities.copyStringToFile(testFile, "");
+ FileObject testSourceFO = FileUtil.toFileObject(testFile);
+ DataObject testSourceDO = DataObject.find(testSourceFO);
+ EditorCookie ec =
testSourceDO.getLookup().lookup(EditorCookie.class);
+ final Document doc = ec.openDocument();
+ doc.putProperty(Language.class, JavaTokenId.language());
+ String content =
+ """
+ package hierbas.del.litoral;
+
+ public class Test {
+
+ public record Rec(int a, int b) {
+
+ public Rec { // add no space for synthetic params
+ }
+ }
+ }
+ """;
+ String golden = content;
+
+ reformat(doc, content, golden);
+ }
// verify closing '}' position during record formatting
public void testRecordClosingBrace7043() throws Exception {
```
--
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