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
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: apireviews
Depends on:
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:

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

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
Comment 4 Quality Engineering 2010-12-05 06:24:40 UTC
Integrated into 'main-golden', will be available in build *201012050001* on (upload may still be in progress)
User: Miloslav Metelka <>
Log: #192289 - IndentUtils.createIndentString is slow - added createIndentString(int indent, boolean expandTabs, int tabSize).