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 221993

Summary: Implement replace history api
Product: editor Reporter: Milutin Kristofic <mkristofic>
Component: SearchAssignee: Milutin Kristofic <mkristofic>
Status: RESOLVED FIXED    
Severity: normal CC: jhavlin
Priority: P3 Keywords: API_REVIEW_FAST
Version: 7.3   
Hardware: PC   
OS: Linux   
Issue Type: TASK Exception Reporter:
Bug Depends on:    
Bug Blocks: 220909    
Attachments: ReplaceHistory API Diff
ReplaceHistory API Diff
Fix ReplaceHistory API Diff
ReplaceHistory API Diff
ReplaceHistory API Diff

Description Milutin Kristofic 2012-11-12 18:22:55 UTC
Created attachment 127656 [details]
ReplaceHistory API Diff

There is need for replace history api same as search history is.

I am submitting my first draft. It needs new module versions, describing api changes.
Comment 1 Milutin Kristofic 2012-11-13 13:32:22 UTC
Created attachment 127720 [details]
ReplaceHistory API Diff

New API in Search API for ReplaceHistory. I have identical implementation as in SearchHistory. There is one example use - remembering replace expressions after netbeans restart. 

Please evaluate.
Comment 2 Jaroslav Havlin 2012-11-13 13:56:18 UTC
JH01: Please add @since tags to JavaDoc for new classes and methods.
JH02: Dependency version in editor.search was not increased to 1.8.

Otherwise the patch seems fine to me. Thank you!
Comment 3 Milutin Kristofic 2012-11-13 14:50:27 UTC
Created attachment 127729 [details]
Fix ReplaceHistory API Diff

@JH01: Fixed
@JH02: Thanks, for catching this one. Fixed.
Comment 4 Milutin Kristofic 2012-11-13 14:56:27 UTC
Created attachment 127731 [details]
ReplaceHistory API Diff

Fixed editor.search dependency from 1.7 to 1.8
Comment 5 Jaroslav Tulach 2012-11-16 09:23:58 UTC
Y01 The description of the use cases should be in arch.xml or javadoc, but apichanges.xml should rather be just a small pointer to the new functionality.

Y02 A usecase description for the whole new API would be good, imho.

Y03 ReplacePattern javadoc is a bit minimalistic, imho. Some methods are missing javadoc altogether.

Y04 Some weird synchronization pattern. Why getReplacePatterns() is synchronized? It only wraps another collection with Collections.unmodifiableList(replacePatternsList). For that you either don't need to synchronize at all, or if replacePatternsList is modifiable, then the current synchronization is broken anyway.

...and then I got lost in the patch, sorry...
Comment 6 Milutin Kristofic 2012-11-20 15:50:46 UTC
Created attachment 128146 [details]
ReplaceHistory API Diff
Comment 7 Milutin Kristofic 2012-11-20 15:55:52 UTC
@Y01 removed details in apichanges.xml

@Y02 added usecase to arch.xml

@Y03 extended some javadoc - still minimalistic as is in search history. There is not too much done by api, so the name of methods and some javadoc seems enough.

@Y04 removed keyword synchronized - it was there from old implementation. I didn't notice its uselessness

Thank you for reviewing. The API is intended for use only for search in projects and search in netbeans.
Comment 8 Milutin Kristofic 2012-11-21 13:42:43 UTC
http://hg.netbeans.org/jet-main/rev/a450f0a3680f
Comment 9 Quality Engineering 2012-11-22 02:44:48 UTC
Integrated into 'main-golden', will be available in build *201211220002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a450f0a3680f
User: Milutin Kristofic <mkristofic@netbeans.org>
Log: #221993 - Implement replace history api