This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 262555 - Inefficient code in HighlightingNameFormatter.java
Summary: Inefficient code in HighlightingNameFormatter.java
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 8.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-23 22:01 UTC by matthies
Modified: 2016-06-26 01:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description matthies 2016-06-23 22:01:23 UTC
When looking at the code linked in https://netbeans.org/bugzilla/show_bug.cgi?id=256848#c3, I noticed a probable performance bug: In line 149 (http://hg.netbeans.org/jet-main/file/ec258c2b135a/jumpto/src/org/netbeans/modules/jumpto/common/HighlightingNameFormatter.java#l149),

    while (i < name.toCharArray().length)

should likely be replaced with

    while (i < name.length())

The current code is perhaps a relict from when this was a for loop over the characters in 'name'.
Comment 1 Tomas Zezula 2016-06-24 12:06:06 UTC
Fixed jet-main c90dbfae362f

Thanks!
Comment 2 Quality Engineering 2016-06-26 01:45:33 UTC
Integrated into 'main-silver', will be available in build *201606260002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c90dbfae362f
User: Tomas Zezula <tzezula@netbeans.org>
Log: #262555:Inefficient code in HighlightingNameFormatter.java