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...
Status: VERIFIED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Jump To (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
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:


Attachments
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:
http://hg.netbeans.org/cnd-main/file/c4a5ccbea34e/cnd.gotodeclaration/src/org/netbeans/modules/cnd/gotodeclaration/matcher/NameMatcher.java
http://hg.netbeans.org/cnd-main/file/c4a5ccbea34e/cnd.gotodeclaration/src/org/netbeans/modules/cnd/gotodeclaration/matcher/NameMatcherFactory.java
Comment 1 Victor Vasilyev 2010-04-28 11:53:25 UTC
Tomas,

I've found your activities this month in the area of the org.netbeans.spi.jumpto :
- Bug 182884
- http://hg.netbeans.org/main/rev/9a59d1812167

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
Tomas,
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?
Thanks.
Comment 5 Vladimir Voskresensky 2010-04-28 20:14:37 UTC
Tomas, candidates to migration on support api could be:
spring.beans/src/org/netbeans/modules/spring/beans/jumpto/SpringBeansTypeProvider.java
java.sourceui/src/org/netbeans/modules/java/source/ui/JavaSymbolProvider.java
gsf/src/org/netbeans/modules/gsf/GsfTypeProvider.java
cnd.gotodeclaration/src/org/netbeans/modules/cnd/gotodeclaration/matcher/NameMatcherFactory.java
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]
Patch
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 http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/
User: 
Log: