[jira] [Comment Edited] (LUCENE-7053) Remove deprecated BytesRef#getUTF8SortedAsUTF16Comparator()

2016-02-28 Thread Uwe Schindler (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-7053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15171075#comment-15171075
 ] 

Uwe Schindler edited comment on LUCENE-7053 at 2/28/16 4:02 PM:


Here is the comparator cleanup. I removed usage of the BytesRef comparator 
completely (where possible). Otherwise I used {{Comparator.naturalOrder()}}.

I also removed the {{ArrayUtil.naturalComparator()}} method, because it is 
obsolete with Java 8.


was (Author: thetaphi):
Here is the comparator cleanup. I removed usage of the BytesRef comparator 
completely (where possible). Otherwise I used {{Comparator.naturalOrder()}}.

I also removed the {ArrayUtil.naturalComparator()}} method, because it is 
obsolete with Java 8.

> Remove deprecated BytesRef#getUTF8SortedAsUTF16Comparator()
> ---
>
> Key: LUCENE-7053
> URL: https://issues.apache.org/jira/browse/LUCENE-7053
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: core/other
>Reporter: Uwe Schindler
>Assignee: Uwe Schindler
> Fix For: master, 6.0
>
> Attachments: LUCENE-7053.patch, LUCENE-7053.patch, LUCENE-7053.patch, 
> LUCENE-7053.patch
>
>
> Followup from LUCENE-7052: This removes the legacy, deprecated 
> getUTF8SortedAsUTF16Comparator() in the BytesRef class. The only left over 
> user was TSTLookup. Moves the code there as private impl detail.
> This also converts the comparators to lambdas for better readability.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Comment Edited] (LUCENE-7053) Remove deprecated BytesRef#getUTF8SortedAsUTF16Comparator()

2016-02-28 Thread Uwe Schindler (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-7053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15171027#comment-15171027
 ] 

Uwe Schindler edited comment on LUCENE-7053 at 2/28/16 12:47 PM:
-

As we implemented {{compareTo}} we could remove the comparator completely. One 
could use {{Comparator.naturalOrder()}}(see 
[[https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#naturalOrder--]])
 instead (naturalOrder is defined to use {{compareTo}}. At places like 
Collections.sort() we could remove the comparator argument completely.

Any comments on this?


was (Author: thetaphi):
As we implemented {{compareTo}} we could remove the comparator completely. One 
could use {{Collections.naturalOrder()}} instead (naturalOrder is defined to 
use {{compareTo}}. At places like Collections.sort() we could remove the 
comparator argument completely.

Any comments on this?

> Remove deprecated BytesRef#getUTF8SortedAsUTF16Comparator()
> ---
>
> Key: LUCENE-7053
> URL: https://issues.apache.org/jira/browse/LUCENE-7053
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: core/other
>Reporter: Uwe Schindler
>Assignee: Uwe Schindler
> Fix For: master, 6.0
>
> Attachments: LUCENE-7053.patch, LUCENE-7053.patch, LUCENE-7053.patch
>
>
> Followup from LUCENE-7052: This removes the legacy, deprecated 
> getUTF8SortedAsUTF16Comparator() in the BytesRef class. The only left over 
> user was TSTLookup. Moves the code there as private impl detail.
> This also converts the comparators to lambdas for better readability.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Comment Edited] (LUCENE-7053) Remove deprecated BytesRef#getUTF8SortedAsUTF16Comparator()

2016-02-28 Thread Uwe Schindler (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-7053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15171027#comment-15171027
 ] 

Uwe Schindler edited comment on LUCENE-7053 at 2/28/16 12:48 PM:
-

As we implemented {{compareTo}} we could remove the comparator completely. One 
could use {{Comparator.naturalOrder()}} (see 
[https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#naturalOrder--])
 instead (naturalOrder is defined to use {{compareTo}}. At places like 
Collections.sort() we could remove the comparator argument completely.

Any comments on this?


was (Author: thetaphi):
As we implemented {{compareTo}} we could remove the comparator completely. One 
could use {{Comparator.naturalOrder()}}(see 
[[https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#naturalOrder--]])
 instead (naturalOrder is defined to use {{compareTo}}. At places like 
Collections.sort() we could remove the comparator argument completely.

Any comments on this?

> Remove deprecated BytesRef#getUTF8SortedAsUTF16Comparator()
> ---
>
> Key: LUCENE-7053
> URL: https://issues.apache.org/jira/browse/LUCENE-7053
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: core/other
>Reporter: Uwe Schindler
>Assignee: Uwe Schindler
> Fix For: master, 6.0
>
> Attachments: LUCENE-7053.patch, LUCENE-7053.patch, LUCENE-7053.patch
>
>
> Followup from LUCENE-7052: This removes the legacy, deprecated 
> getUTF8SortedAsUTF16Comparator() in the BytesRef class. The only left over 
> user was TSTLookup. Moves the code there as private impl detail.
> This also converts the comparators to lambdas for better readability.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Comment Edited] (LUCENE-7053) Remove deprecated BytesRef#getUTF8SortedAsUTF16Comparator()

2016-02-28 Thread Uwe Schindler (JIRA)

[ 
https://issues.apache.org/jira/browse/LUCENE-7053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15171021#comment-15171021
 ] 

Uwe Schindler edited comment on LUCENE-7053 at 2/28/16 12:27 PM:
-

New patch:
- I removed some usage of comparator and replaced by {{compareTo}} at many 
places.
- Moved the code of the comparator to {{compareTo}}.
- The comparator isstelf is now a static final constant {{BytesRef.COMPARATOR}} 
(the name was horrible). It is documented to just order by bytes. In fact its 
just a method reference to the {{compareTo}} method!
- I also removed the chicken-egg statement in FuzzyQuery.


was (Author: thetaphi):
New patch:
- I removed useless usage of comparator at some places and replace by compareTo
- Moved the code of the comparator to compareTo.
- The comparator isstelf is now a static constant BytesRef.COMPARATOR (the name 
was horrible). It is documented to just order by bytes. In fact its just a 
method reference to the compareTo method!
- I also removed the chicken-egg statement in FuzzyQuery

> Remove deprecated BytesRef#getUTF8SortedAsUTF16Comparator()
> ---
>
> Key: LUCENE-7053
> URL: https://issues.apache.org/jira/browse/LUCENE-7053
> Project: Lucene - Core
>  Issue Type: Improvement
>  Components: core/other
>Reporter: Uwe Schindler
>Assignee: Uwe Schindler
> Fix For: master, 6.0
>
> Attachments: LUCENE-7053.patch, LUCENE-7053.patch, LUCENE-7053.patch
>
>
> Followup from LUCENE-7052: This removes the legacy, deprecated 
> getUTF8SortedAsUTF16Comparator() in the BytesRef class. The only left over 
> user was TSTLookup. Moves the code there as private impl detail.
> This also converts the comparators to lambdas for better readability.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org