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 192289 - IndentUtils.createIndentString is slow
Summary: IndentUtils.createIndentString is slow
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: apireviews
URL:
Keywords: API, API_REVIEW_FAST, PERFORMANCE
Depends on:
Blocks:
 
Reported: 2010-11-22 15:55 UTC by Petr Pisl
Modified: 2010-12-05 06:24 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Diff of the proposed change (5.05 KB, text/plain)
2010-11-24 14:47 UTC, Miloslav Metelka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2010-11-22 15:55:02 UTC
When we format a php file, we call very often org.netbeans.modules.editor.indent.api.IndentUtils.createIndentString () method. But this method for every call finds out two property settings of the document and this is too expensive. We need to have accessible method cachedOrCreatedIndentString() or similar, because we know values of the properties and they don't have to be obtained for every call.
Comment 1 Miloslav Metelka 2010-11-24 14:46:10 UTC
Yes, I agree there should be (and already is) a method that you request, it's just not public. I've added a method with suitable name and appropriate parameters and javadoc. I've changed existing tests that used (to test the delegated method) to use the new API method.
Comment 2 Miloslav Metelka 2010-11-24 14:47:31 UTC
Created attachment 103290 [details]
Diff of the proposed change
Comment 3 Miloslav Metelka 2010-12-03 10:57:59 UTC
http://hg.netbeans.org/jet-main/rev/8ceaeed8b2c2
Comment 4 Quality Engineering 2010-12-05 06:24:40 UTC
Integrated into 'main-golden', will be available in build *201012050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8ceaeed8b2c2
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #192289 - IndentUtils.createIndentString is slow - added createIndentString(int indent, boolean expandTabs, int tabSize).