[ https://issues.apache.org/jira/browse/TAP5-2764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17772981#comment-17772981 ]
ASF subversion and git services commented on TAP5-2764: ------------------------------------------------------- Commit 0da3aaa27e404c7d3dc85898cfaa79180241b9aa in tapestry-5's branch refs/heads/TAP5-2764 from Ben Weidig [ https://gitbox.apache.org/repos/asf?p=tapestry-5.git;h=0da3aaa27 ] TAP5-2764: static JSONArray#empty() added > JSONArray improvements > ---------------------- > > Key: TAP5-2764 > URL: https://issues.apache.org/jira/browse/TAP5-2764 > Project: Tapestry 5 > Issue Type: Improvement > Components: tapestry-json > Reporter: Ben Weidig > Assignee: Ben Weidig > Priority: Minor > > The following improvements should be added to JSONArray: > *Implement {{List<Object>}}* > Right now, the type implements {{Collection<Object>}} but it could bei a > {{List<Object>}} instead. > As it's a thin wrapper arround {{ArrayList<Object>}} anyway, using a more > feature-packed interface makes sense, as there's almost no additional cost to > it. > *Fix {{Object remove(int)}} contract* > Index-based removal is a {{{}List{}}}-related method with a certain contract, > like throwing an Exception on invalid index arguments. > Event hough it _should be_ expected behavior on any {{{}List{}}}-like data > structures, it's going to be a breaking change here. > *Add {{static JSONArray empty()}}* > Similar to {{{}Collections.emptyList(){}}}, a convenience method for creating > an empty and immutable instance should be added to reduce object creation / > memory requirements, as an {{ArrayList}} will always needs some memory, even > if empty. > Implementation-wise, it would require a new (private) constructor that allows > setting the underlying data structure. > Then, {{empty()}} could simply use {{{}Collections.emptyList(){}}}. > {color:#FF0000}As the changes contain a breaking change, it should be > released in a minor-release, not patch.{color} > Related mailing list thread: > [https://lists.apache.org/thread/pf7hwy2tp5x7ktbzq9w2btwdd1xkyod2] -- This message was sent by Atlassian Jira (v8.20.10#820010)