This is an automated email from the ASF dual-hosted git repository.

mbien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 01b9edfb71 updated col.toArray() java editor template ("2ar").
     new 42824e13c9 Merge pull request #4201 from mbien/toarray-template-fix
01b9edfb71 is described below

commit 01b9edfb7198eb124be6235f0d3c2fd9d7d335e5
Author: Michael Bien <[email protected]>
AuthorDate: Mon Jun 6 02:48:37 2022 +0200

    updated col.toArray() java editor template ("2ar").
    
    old: .toArray(new ${clazz}[${coll}.size()]);
    new: .toArray(new ${clazz}[0]);
    
    see #3166 for details
---
 .../src/org/netbeans/modules/java/editor/resources/DefaultAbbrevs.xml   | 2 +-
 .../java/editor/codetemplates/CodeTemplatesTest/testDumpTemplates.pass  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/java/java.editor/src/org/netbeans/modules/java/editor/resources/DefaultAbbrevs.xml
 
b/java/java.editor/src/org/netbeans/modules/java/editor/resources/DefaultAbbrevs.xml
index 0f65c962c5..199d0a0e30 100644
--- 
a/java/java.editor/src/org/netbeans/modules/java/editor/resources/DefaultAbbrevs.xml
+++ 
b/java/java.editor/src/org/netbeans/modules/java/editor/resources/DefaultAbbrevs.xml
@@ -334,7 +334,7 @@ ${selection}${cursor}
     <!-- Arrays and List conversion and sorting -->
     <codetemplate abbreviation="2ar">
          <code>
- <![CDATA[${clazz}[] ${var newVarName default="arr"} = ${typeCast cast 
default="" editable=false} ${coll 
instanceof="java.util.Collection"}.toArray(new ${clazz}[${coll}.size()]);
+ <![CDATA[${clazz}[] ${var newVarName default="arr"} = ${typeCast cast 
default="" editable=false} ${coll 
instanceof="java.util.Collection"}.toArray(new ${clazz}[0]);
  ]]>
          </code>
      </codetemplate>
diff --git 
a/java/java.editor/test/qa-functional/data/goldenfiles/org/netbeans/test/java/editor/codetemplates/CodeTemplatesTest/testDumpTemplates.pass
 
b/java/java.editor/test/qa-functional/data/goldenfiles/org/netbeans/test/java/editor/codetemplates/CodeTemplatesTest/testDumpTemplates.pass
index 6d227ee6eb..eaadd1b131 100644
--- 
a/java/java.editor/test/qa-functional/data/goldenfiles/org/netbeans/test/java/editor/codetemplates/CodeTemplatesTest/testDumpTemplates.pass
+++ 
b/java/java.editor/test/qa-functional/data/goldenfiles/org/netbeans/test/java/editor/codetemplates/CodeTemplatesTest/testDumpTemplates.pass
@@ -7,7 +7,7 @@ ${baseType type="java.util.List" default="List" 
editable="false"} <${type defaul
 null
 -----------------------
 2ar
-${clazz}[] ${var newVarName default="arr"} = ${typeCast cast default="" 
editable=false} ${coll instanceof="java.util.Collection"}.toArray(new 
${clazz}[${coll}.size()]);
+${clazz}[] ${var newVarName default="arr"} = ${typeCast cast default="" 
editable=false} ${coll instanceof="java.util.Collection"}.toArray(new 
${clazz}[0]);
  
 null
 -----------------------


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