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 185168 - Need for matcher factory - a factory that creates matchers for the given SearchTypes
Summary: Need for matcher factory - a factory that creates matchers for the given Sear...
Alias: None
Product: utilities
Classification: Unclassified
Component: Jump To (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Zezula
Depends on:
Reported: 2010-04-28 10:37 UTC by Vladimir Kvashin
Modified: 2010-07-12 11:07 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

Patch (33.13 KB, patch)
2010-05-03 09:30 UTC, Tomas Zezula
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2010-04-28 10:37:49 UTC
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:
Comment 1 Victor Vasilyev 2010-04-28 11:53:25 UTC

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.
Comment 2 Tomas Zezula 2010-04-28 16:26:15 UTC
Hi Victor,
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?
Comment 3 Victor Vasilyev 2010-04-28 17:39:14 UTC
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.
Comment 4 Tomas Zezula 2010-04-28 18:30:32 UTC
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?
Comment 5 Vladimir Voskresensky 2010-04-28 20:14:37 UTC
Tomas, candidates to migration on support api could be:
Comment 6 Tomas Zezula 2010-04-29 08:35:44 UTC
OK, thanks Vladimir.
Comment 7 Vladimir Kvashin 2010-04-29 17:15:52 UTC
Tomas, yes, I can do the review
Comment 8 Tomas Zezula 2010-05-03 09:19:18 UTC
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.
Comment 9 Tomas Zezula 2010-05-03 09:30:29 UTC
Created attachment 98352 [details]
Comment 10 Tomas Zezula 2010-05-03 09:31:56 UTC
As it's just a friend API I will integrate it tomorrow.
Comment 11 Vladimir Kvashin 2010-05-05 10:35:32 UTC
Sure I agree with your changes :)
Comment 12 Tomas Zezula 2010-05-05 20:47:34 UTC
OK, thanks Vladimir. I will integrate it tomorrow.
Comment 13 Tomas Zezula 2010-05-06 09:39:12 UTC
Integrated into jet-main 7c2c70892ef1
Comment 14 Tomas Zezula 2010-05-06 09:48:20 UTC
jet-main 722eca07970c - removed forgotten NameMatcher.
Comment 15 Quality Engineering 2010-05-10 09:18:54 UTC
Integrated into 'main-golden', will be available in build *201005100200* on (upload may still be in progress)