You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Steven Rowe (Created) (JIRA)" <ji...@apache.org> on 2011/12/13 22:51:31 UTC
[jira] [Created] (LUCENE-3645) Remove unnecessary array wrapping
when calling varargs methods
Remove unnecessary array wrapping when calling varargs methods
--------------------------------------------------------------
Key: LUCENE-3645
URL: https://issues.apache.org/jira/browse/LUCENE-3645
Project: Lucene - Java
Issue Type: Improvement
Affects Versions: 3.5, 4.0
Reporter: Steven Rowe
Assignee: Steven Rowe
Priority: Minor
varargs method callers don't have to wrap args in arrays
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Updated] (LUCENE-3645) Remove unnecessary array wrapping
when calling varargs methods
Posted by "Steven Rowe (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-3645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steven Rowe updated LUCENE-3645:
--------------------------------
Attachment: LUCENE-3645-trunk.patch
{quote}
bq. So in this version of the branch_3x patch I've reverted that change and added a comment pointing to LUCENE-2989.
This also affects trunk, the trunk patch still contains emptyList().
{quote}
Thanks, I forgot that.
This version of the trunk patch puts back emptyList() and adds the LUCENE-2989 comment.
I plan on committing later today.
> Remove unnecessary array wrapping when calling varargs methods
> --------------------------------------------------------------
>
> Key: LUCENE-3645
> URL: https://issues.apache.org/jira/browse/LUCENE-3645
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 3.5, 4.0
> Reporter: Steven Rowe
> Assignee: Steven Rowe
> Priority: Minor
> Attachments: LUCENE-3645-branch_3x.patch, LUCENE-3645-branch_3x.patch, LUCENE-3645-trunk.patch, LUCENE-3645-trunk.patch
>
>
> varargs method callers don't have to wrap args in arrays
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-3645) Remove unnecessary array wrapping
when calling varargs methods
Posted by "Steven Rowe (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-3645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169612#comment-13169612 ]
Steven Rowe commented on LUCENE-3645:
-------------------------------------
Thanks Uwe and Robert for your reviews.
> Remove unnecessary array wrapping when calling varargs methods
> --------------------------------------------------------------
>
> Key: LUCENE-3645
> URL: https://issues.apache.org/jira/browse/LUCENE-3645
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 3.5, 4.0
> Reporter: Steven Rowe
> Assignee: Steven Rowe
> Priority: Minor
> Fix For: 3.6, 4.0
>
> Attachments: LUCENE-3645-branch_3x.patch, LUCENE-3645-branch_3x.patch, LUCENE-3645-trunk.patch, LUCENE-3645-trunk.patch
>
>
> varargs method callers don't have to wrap args in arrays
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-3645) Remove unnecessary array wrapping
when calling varargs methods
Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-3645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13168865#comment-13168865 ]
Robert Muir commented on LUCENE-3645:
-------------------------------------
{quote}
Also converted one Arrays.asList(new Integer[0]) to Collections.emptyList()
{quote}
But these are different right? specifically the first is mutable but the latter is immutable?
> Remove unnecessary array wrapping when calling varargs methods
> --------------------------------------------------------------
>
> Key: LUCENE-3645
> URL: https://issues.apache.org/jira/browse/LUCENE-3645
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 3.5, 4.0
> Reporter: Steven Rowe
> Assignee: Steven Rowe
> Priority: Minor
> Attachments: LUCENE-3645-branch_3x.patch, LUCENE-3645-trunk.patch
>
>
> varargs method callers don't have to wrap args in arrays
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Updated] (LUCENE-3645) Remove unnecessary array wrapping
when calling varargs methods
Posted by "Steven Rowe (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-3645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steven Rowe updated LUCENE-3645:
--------------------------------
Attachment: LUCENE-3645-branch_3x.patch
{quote}
bq. Also converted one Arrays.asList(new Integer[0]) to Collections.emptyList()
But these are different right? specifically the first is mutable but the latter is immutable?
{quote}
Hmm, I hadn't considered that. Ordinarily I might argue that for a test of sorting an empty list, immutability is not a problem.
However, LUCENE-2989 switched this exact line *away* from {{Collections.emptyList()}} to what it is now.
So in this version of the branch_3x patch I've reverted that change and added a comment pointing to LUCENE-2989.
> Remove unnecessary array wrapping when calling varargs methods
> --------------------------------------------------------------
>
> Key: LUCENE-3645
> URL: https://issues.apache.org/jira/browse/LUCENE-3645
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 3.5, 4.0
> Reporter: Steven Rowe
> Assignee: Steven Rowe
> Priority: Minor
> Attachments: LUCENE-3645-branch_3x.patch, LUCENE-3645-branch_3x.patch, LUCENE-3645-trunk.patch
>
>
> varargs method callers don't have to wrap args in arrays
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-3645) Remove unnecessary array wrapping
when calling varargs methods
Posted by "Uwe Schindler (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-3645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169219#comment-13169219 ]
Uwe Schindler commented on LUCENE-3645:
---------------------------------------
And thats not the only bug in IBM JDK. Several version don't even run trunk tests, because ServiceLoader is mixing up the classpath :( [it uses broken Harmony code] and the RW codec comes after the core codecs.
> Remove unnecessary array wrapping when calling varargs methods
> --------------------------------------------------------------
>
> Key: LUCENE-3645
> URL: https://issues.apache.org/jira/browse/LUCENE-3645
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 3.5, 4.0
> Reporter: Steven Rowe
> Assignee: Steven Rowe
> Priority: Minor
> Attachments: LUCENE-3645-branch_3x.patch, LUCENE-3645-branch_3x.patch, LUCENE-3645-trunk.patch
>
>
> varargs method callers don't have to wrap args in arrays
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Updated] (LUCENE-3645) Remove unnecessary array wrapping
when calling varargs methods
Posted by "Steven Rowe (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-3645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steven Rowe updated LUCENE-3645:
--------------------------------
Attachment: LUCENE-3645-branch_3x.patch
LUCENE-3645-trunk.patch
Patches implementing the idea (thanks to IntelliJ's "Redundant array creation" inspection that found all these).
In branch_3x, I didn't change anything under {{lucene/backwards/}}.
Also converted one {{Arrays.asList(new Integer\[0\])}} to {{Collections.emptyList()}}, and several {{Arrays.asList(new CLASS\[\] \{ ... \})}} to {{Arrays.<CLASS>asList(...)}}.
> Remove unnecessary array wrapping when calling varargs methods
> --------------------------------------------------------------
>
> Key: LUCENE-3645
> URL: https://issues.apache.org/jira/browse/LUCENE-3645
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 3.5, 4.0
> Reporter: Steven Rowe
> Assignee: Steven Rowe
> Priority: Minor
> Attachments: LUCENE-3645-branch_3x.patch, LUCENE-3645-trunk.patch
>
>
> varargs method callers don't have to wrap args in arrays
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-3645) Remove unnecessary array wrapping
when calling varargs methods
Posted by "Uwe Schindler (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-3645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169227#comment-13169227 ]
Uwe Schindler commented on LUCENE-3645:
---------------------------------------
bq. So in this version of the branch_3x patch I've reverted that change and added a comment pointing to LUCENE-2989.
This also affects trunk, the trunk patch still contains emptyList().
> Remove unnecessary array wrapping when calling varargs methods
> --------------------------------------------------------------
>
> Key: LUCENE-3645
> URL: https://issues.apache.org/jira/browse/LUCENE-3645
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 3.5, 4.0
> Reporter: Steven Rowe
> Assignee: Steven Rowe
> Priority: Minor
> Attachments: LUCENE-3645-branch_3x.patch, LUCENE-3645-branch_3x.patch, LUCENE-3645-trunk.patch
>
>
> varargs method callers don't have to wrap args in arrays
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-3645) Remove unnecessary array wrapping
when calling varargs methods
Posted by "Uwe Schindler (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-3645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169217#comment-13169217 ]
Uwe Schindler commented on LUCENE-3645:
---------------------------------------
{quote}
bq. Also converted one Arrays.asList(new Integer[0]) to Collections.emptyList()
But these are different right? specifically the first is mutable but the latter is immutable?
{quote}
Immutability is not a problem, an empty array cannot change.
The answer is correct, the IBM JDK has a bug, making the Collection's.emptyList() not implement RandomAccess. Can you add a comment, if not already there?
> Remove unnecessary array wrapping when calling varargs methods
> --------------------------------------------------------------
>
> Key: LUCENE-3645
> URL: https://issues.apache.org/jira/browse/LUCENE-3645
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 3.5, 4.0
> Reporter: Steven Rowe
> Assignee: Steven Rowe
> Priority: Minor
> Attachments: LUCENE-3645-branch_3x.patch, LUCENE-3645-branch_3x.patch, LUCENE-3645-trunk.patch
>
>
> varargs method callers don't have to wrap args in arrays
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Resolved] (LUCENE-3645) Remove unnecessary array wrapping
when calling varargs methods
Posted by "Steven Rowe (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-3645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steven Rowe resolved LUCENE-3645.
---------------------------------
Resolution: Fixed
Fix Version/s: 4.0
3.6
Lucene Fields: Patch Available (was: New)
Committed to branch_3x and trunk.
> Remove unnecessary array wrapping when calling varargs methods
> --------------------------------------------------------------
>
> Key: LUCENE-3645
> URL: https://issues.apache.org/jira/browse/LUCENE-3645
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 3.5, 4.0
> Reporter: Steven Rowe
> Assignee: Steven Rowe
> Priority: Minor
> Fix For: 3.6, 4.0
>
> Attachments: LUCENE-3645-branch_3x.patch, LUCENE-3645-branch_3x.patch, LUCENE-3645-trunk.patch, LUCENE-3645-trunk.patch
>
>
> varargs method callers don't have to wrap args in arrays
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org