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 40595 - panes[i].getText().length() done in CloneableEditorSupport
Summary: panes[i].getText().length() done in CloneableEditorSupport
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords: PERFORMANCE, SIMPLEFIX
Depends on:
Blocks:
 
Reported: 2004-02-27 19:34 UTC by Miloslav Metelka
Modified: 2008-12-22 20:35 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 Miloslav Metelka 2004-02-27 19:34:54 UTC
When evaluating issue 40558 I've noticed the
following line 1102 in CloneableEditorSupport:

int textLength = panes[i].getText().length();

This is highly inefficient as it writes the whole
content of the document into a Writer and then to
the String. The change was introduced by Peter Z.
in 1.72 when fixing issue 26407.
 The simplest fix could be "getText" ->
"getDocument()".
 Assigning P2 as this is IMHO an easily fixable
perf issue.
Comment 1 Petr Nejedly 2004-03-01 17:14:36 UTC
Highly inefficient but called only from reload -> low impact.
Anyway, going to fix this.
Comment 2 Petr Nejedly 2004-03-01 17:19:25 UTC
Fixed.
openide/src/org/openide/text/CloneableEditorSupport.java,v1.117
Comment 3 Lukas Hasik 2004-03-05 14:13:27 UTC
Mila, could you please verify ? thanks.
Comment 4 Miloslav Metelka 2004-03-05 15:04:08 UTC
Verified.