cailin186 / reflections

Automatically exported from code.google.com/p/reflections
Do What The F*ck You Want To Public License
0 stars 0 forks source link

Scanner not registered with (String, Scanner...) constructor #115

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Instantiate Reflections with the (String, Scanner...) constructor, with a 
MethodAnnotationsScanner
2. Execute reflections.getMethodsAnnotatedWith()

What is the expected output? What do you see instead?

I expect to see a set of methods containing my annotation
I instead see an empty set

What version of the product are you using? On what operating system?

0.9.8, on Windows XP

Please provide any additional information below.

The issue looks to be in ConfigurationBuilder.build(). An instanceof check is 
made to determine if an argument is an instance of Scanner, however 
java.util.Scanner is imported and checked against - not 
org.reflections.scanners.Scanner. Therefore, the list of custom scanners is 
empty and the defaults are used instead.

Original issue reported on code.google.com by m...@deity.co.nz on 30 May 2012 at 8:52

GoogleCodeExporter commented 9 years ago
Additional information above should be disregarded - it was a red herring 
courtesy of Eclipse.

Please close this defect as invalid. The issue was that I was incorrectly using:

Reflections reflections = new Reflections("my.package", 
MethodAnnotationsScanner.class);

instead of:
Reflections reflections = new Reflections("my.package", new 
MethodAnnotationsScanner());

Original comment by m...@deity.co.nz on 30 May 2012 at 8:59

GoogleCodeExporter commented 9 years ago

Original comment by ronm...@gmail.com on 5 Jun 2012 at 5:23