You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Biestro (Jira)" <ji...@apache.org> on 2023/07/06 17:16:00 UTC
[jira] [Resolved] (JEXL-398) Allow 'trailing commas' or ellipsis while defining array, map and set literals
[ https://issues.apache.org/jira/browse/JEXL-398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Biestro resolved JEXL-398.
--------------------------------
Resolution: Fixed
Commit [ab1a6d9|https://github.com/apache/commons-jexl/commit/ab1a6d9c3c32fd9c5e49def7fe8f1763dce09d7d]
> Allow 'trailing commas' or ellipsis while defining array, map and set literals
> ------------------------------------------------------------------------------
>
> Key: JEXL-398
> URL: https://issues.apache.org/jira/browse/JEXL-398
> Project: Commons JEXL
> Issue Type: New Feature
> Affects Versions: 3.3
> Reporter: Xu Pengcheng
> Assignee: Henri Biestro
> Priority: Minor
> Fix For: 3.3.1
>
>
> Allowing trailing commas in structured literals (array, set, map) as a convenient syntactic leniency. :)
> {code:java}
> let m = { "foo": 1, "bar": 2, };
> let a = [ 1, 2, ];
> let s = (1, 2, );{code}
> Using a trailing ellipsis (...) to alter the concrete class materialized as a convenient semantic shortcut.
> {code:java}
> let m = { "foo": 1, "bar": 2, ... }; // LinkedHashMap
> let a = [ 1, 2, ...]; // ArrayList
> let s = (1, 2, ...); // LinkedHashSet{code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)