Now each implementor of the TypeProvider or FileProvider classes has to reimplement matching algorythms for each SearchType. This leads to code duplicatoin and errors.
There should be a utility class that creates a matcher for a given SearchType.
It might look like that:
I've found your activities this month in the area of the org.netbeans.spi.jumpto :
- Bug 182884
Could you please, validate Vladimir's proposal.
the Vladimir's classes looks good. They should belong to friend support SPI in the jump to.
Should I do it? Or are you going to do this?
I think, you more closer to this theme now, and you'll able to provide improvement of code on the fly if such changes will be needed.
Could you please, do it.
OK, I will do it.
The cnd will need to be updated to use it. It will also need an API review. I will add the link to the review when done. Could you or Vladimir do then the review?
Tomas, candidates to migration on support api could be:
OK, thanks Vladimir.
Tomas, yes, I can do the review
I've moved the NameMatcherFactory and NameMatcher into Jump To. It's basically the same. I've only removed the cnd specific method createNameFilter() and changed the createNameMatcher() to throw IAE when it gets wrong type or PatternSyntaxException as it's an exceptional case which should be reported and fixed. The rest is the same.
I've also changed cnd, spring.beans, GoTo File action to use it.
For cnd there is the original NameMatcherFactory having the single method createNameFilter. I would rather rename it but I don't know a suitable name. Can you suggest one? Thanks.
Created attachment 98352 [details]
As it's just a friend API I will integrate it tomorrow.
Sure I agree with your changes :)
OK, thanks Vladimir. I will integrate it tomorrow.
Integrated into jet-main 7c2c70892ef1
jet-main 722eca07970c - removed forgotten NameMatcher.
Integrated into 'main-golden', will be available in build *201005100200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)