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

Uwe Schindler edited comment on LUCENE-5372 at 12/19/13 8:13 AM:
-----------------------------------------------------------------

This already fails in lucene-core's test! So we should replace them everywhere 
(although tests is not an issue).

{noformat}
ant check-forbidden-apis

[...]

-check-forbidden-base:
[forbidden-apis] Reading bundled API signatures: jdk-unsafe-1.7
[forbidden-apis] Reading bundled API signatures: jdk-deprecated-1.7
[forbidden-apis] Reading API signatures: C:\Users\Uwe 
Schindler\Projects\lucene\trunk-lusolr3\lucene\tools\forbiddenApis\base.txt
[forbidden-apis] Loading classes to check...
[forbidden-apis] Scanning for API signatures and dependencies...
[forbidden-apis] Forbidden class/interface use: java.lang.StringBuffer [Use 
StringBuilder instead, which has no synchronization]
[forbidden-apis]   in org.apache.lucene.TestSearchForDuplicates 
(TestSearchForDuplicates.java:56)
[forbidden-apis] Forbidden class/interface use: java.lang.StringBuffer [Use 
StringBuilder instead, which has no synchronization]
[forbidden-apis]   in org.apache.lucene.TestSearchForDuplicates 
(TestSearchForDuplicates.java:64)
[forbidden-apis] Forbidden class/interface use: java.lang.StringBuffer [Use 
StringBuilder instead, which has no synchronization]
[forbidden-apis]   in 
org.apache.lucene.analysis.tokenattributes.CharTermAttributeImpl 
(CharTermAttributeImpl.java:148)
[forbidden-apis] Forbidden class/interface use: java.lang.StringBuffer [Use 
StringBuilder instead, which has no synchronization]
[forbidden-apis]   in org.apache.lucene.TestSearch (TestSearch.java:95)
[forbidden-apis] Forbidden class/interface use: java.lang.StringBuffer [Use 
StringBuilder instead, which has no synchronization]
[forbidden-apis]   in org.apache.lucene.TestSearch (TestSearch.java:103)
[forbidden-apis] Forbidden class/interface use: java.lang.StringBuffer [Use 
StringBuilder instead, which has no synchronization]
[forbidden-apis]   in org.apache.lucene.index.TestDoc (TestDoc.java:152)
[forbidden-apis] Forbidden class/interface use: java.lang.StringBuffer [Use 
StringBuilder instead, which has no synchronization]
[forbidden-apis]   in org.apache.lucene.index.TestDoc (TestDoc.java:193)
[forbidden-apis] Forbidden class/interface use: java.lang.StringBuffer [Use 
StringBuilder instead, which has no synchronization]
[forbidden-apis]   in 
org.apache.lucene.analysis.tokenattributes.TestCharTermAttributeImpl 
(TestCharTermAttributeImpl.java:179)
[forbidden-apis] Forbidden class/interface use: java.lang.StringBuffer [Use 
StringBuilder instead, which has no synchronization]
[forbidden-apis]   in 
org.apache.lucene.analysis.tokenattributes.TestCharTermAttributeImpl 
(TestCharTermAttributeImpl.java:216)
[forbidden-apis] Scanned 2369 (and 462 related) class file(s) for forbidden API 
invocations (in 1.19s), 9 error(s).
{noformat}


was (Author: thetaphi):
This already fails in lucene-core's test! So we should replace them everywhere 
(although tests is not an issue).

> IntArray toString has O(n^2) performance
> ----------------------------------------
>
>                 Key: LUCENE-5372
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5372
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>            Reporter: Joshua Hartman
>            Assignee: Dawid Weiss
>            Priority: Minor
>             Fix For: 5.0, 4.7
>
>         Attachments: 5372.patch, LUCENE-5372-forbidden.patch
>
>
> This is pretty minor, but I found a few issues with the toString 
> implementations while looking through the facet data structures.
> The most egregious is the use of string concatenation in the IntArray class. 
> I have fixed that using StringBuilders. I also noticed that other classes 
> were using StringBuffer instead of StringBuilder. According to the javadoc,
> "This class is designed for use as a drop-in replacement for StringBuffer in 
> places where the string buffer was being used by a single thread (as is 
> generally the case). Where possible, it is recommended that this class be 
> used in preference to StringBuffer as it will be faster under most 
> implementations."



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to