Community
Participate
Working Groups
The tests for the FQNPrefixMatcher (FQNPrefixMatcherTest) use a different LastSegmentFinder than the default implementation. The former (in the tests) returns the complete string after the last delimieter (baz from foo.bar.baz). Hence "b" is a matching candidate for "foo.bar.baz". The latter (default implementation) returns null as "baz" does not contain a upper case letter. That is, in a setting that is not customised "b" is not a matching candidate. For simple names starting with an upper case letter this is no problem, as both LastSegmentFinders yield the same result. However for lower case names the default implementation might be unsatisfactory.
Scheduled for SR1. A patch is very welcome ;-)
Well, I can't decide what's actually wrong. Is it the tests using the wrong LastSegmentFinder. Is it the wrong default implementation of the LastSegmentFinder. Or is it my requirement that b should be a matching candidate for foo.bar.baz... One option would be to rename DefaultLastSegmentFinder to something else (from some tests, I see what it is doing, but I can't quite understand why that should be the default behaviour) and use a different implementation instead. How about public String getLastSegment(String fqn, char delimiter) { try{ int index = fqn.lastIndexOf(delimiter)+1; return fqn.substring(index); }catch(Exception e){ } return fqn; } or the implementation used in FQNPrefixMatcherTest
Pushed to master.
Closing all bugs that were set to RESOLVED before Neon.0