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:||Need for matcher factory - a factory that creates matchers for the given SearchTypes|
|Product:||utilities||Reporter:||Vladimir Kvashin <vkvashin>|
|Component:||Jump To||Assignee:||Tomas Zezula <tzezula>|
|Severity:||normal||CC:||dstrupl, issues, vvg|
|Issue Type:||DEFECT||Exception Reporter:|
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 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.