This is an automated email from the ASF dual-hosted git repository.
lkishalmi 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 94555c4f55a Java Code Templates for List.of(), Map.of(), and Set.of()
94555c4f55a is described below
commit 94555c4f55a1089167ee9208f73ffe7abb6ae689
Author: Laszlo Kishalmi <[email protected]>
AuthorDate: Fri Feb 23 19:23:26 2024 -0800
Java Code Templates for List.of(), Map.of(), and Set.of()
---
.../org/netbeans/modules/java/editor/resources/DefaultAbbrevs.xml | 8 ++++++++
1 file changed, 8 insertions(+)
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 b9b61d01396..6ba5bf8ea96 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
@@ -375,6 +375,14 @@ ${cursor}]]></code></codetemplate>
<codetemplate abbreviation="sb"><code><![CDATA[${stype
type="java.util.StringBuilder" default="StringBuilder" editable="false"} ${var
newVarName default="sb"} = new ${stype}(${str instanceof="java.lang.String"
default=""});
${cursor}]]></code></codetemplate>
+ <!-- Instantiating common collections -->
+ <codetemplate abbreviation="lof"><code><![CDATA[${no-indent}${stype
type="java.util.List" default="List" editable="false"}.of(${args
default=""})${cursor}]]></code></codetemplate>
+ <codetemplate abbreviation="mof"><code><![CDATA[${no-indent}${stype
type="java.util.Map" default="Map" editable="false"}.of(${args
default=""})${cursor}]]></code></codetemplate>
+ <codetemplate abbreviation="sof"><code><![CDATA[${no-indent}${stype
type="java.util.Set" default="Set" editable="false"}.of(${args
default=""})${cursor}]]></code></codetemplate>
+ <codetemplate abbreviation="vlof"><code><![CDATA[var ${list list} =
${stype type="java.util.List" default="List" editable="false"}.of(${args
default=""});${cursor}]]></code></codetemplate>
+ <codetemplate abbreviation="vmof"><code><![CDATA[var ${map map} = ${stype
type="java.util.Map" default="Map" editable="false"}.of(${args
default=""});${cursor}]]></code></codetemplate>
+ <codetemplate abbreviation="vsof"><code><![CDATA[var ${set set} = ${stype
type="java.util.Set" default="Set" editable="false"}.of(${args
default=""});${cursor}]]></code></codetemplate>
+
<!-- #167824 -->
<codetemplate abbreviation="in"><code><![CDATA[${no-indent}interface
]]></code></codetemplate>
---------------------------------------------------------------------
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