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.
Summary: | API review of adding ConstrainedBinaryIndexer.Registration.namePattern | ||
---|---|---|---|
Product: | editor | Reporter: | Tomas Zezula <tzezula> |
Component: | Parsing & Indexing | Assignee: | Tomas Zezula <tzezula> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | apireviews, epdv, jglick, jtulach |
Priority: | P2 | Keywords: | API, API_REVIEW_FAST, PERFORMANCE, PLAN |
Version: | 7.1 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | TASK | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 205574 | ||
Attachments: | Patch file with logging |
Y01 I see no test. Given the magic with "content/unknown", it might tighten the semantics a bit. + final String[] parts = s.split(","); //NOI18N + final StringBuilder sb = new StringBuilder(); + for (String part : parts) { + sb.append(part); + sb.append('|'); //NOI18N + } Y02 The above code basically does s.replace(',','|') - possibly you could change the annotation processor to use '|' as separator, then you could directly read the regexp in runtime without processing it. >Given the magic with "content/unknown", it might tighten the semantics a bit.
Yes and no. The API was never part of any release so it's no change. It's documented.
Also NB API does not declare semantic compatibility.
Y02: OK
I suppose this is now for 7.2. JG01 after Y02 - or simply make namePattern be of type String (default ""). There is no purpose in writing e.g. namePattern={".+[.]java", ".+[.]jsp"} when you could just write e.g. namePattern=".+[.]java|.+[.]jsp)" and simplify it to namePattern=".+[.](java|jsp)" JG01: No problem. I want to do the change into NB 7.1 if possible, it seems that the JSFBinaryIndexer becomes very slow when J2EE cluster is active. In the Java cluster the overhead of fo.getMimeType(String...) on XML file is small but it's 10 times slower when J2EE cluster is activated. Fixed jet-main 955842fb95d4 Not approved to NB 7.1 by QA, scheduled for patch release. Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/955842fb95d4 User: Tomas Zezula <tzezula@netbeans.org> Log: #205575:API review of adding ConstrainedBinaryIndexer.Registration.namePattern |
Created attachment 113544 [details] Patch file with logging Some indexers which are using the ConstrainedBinaryIndexer register very expensive predicates. They register no required resource with combination with expensive mime type (the XML mime recognizer needs to read the content of file). For example the JSFBinaryIndexer only needs to test that resource.getNameExt().endsWith(".taglib.xml") so adding the cheap namePattern predicate improves performance.