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

-reflections.xml not loaded #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  I have a multi module web project, one of the jars has a 
META-INF/reflections/*.-reflections.xml
2.  I'm using JRebel so at runitme a resource search on the package prefix 
"META-INF/reflections" returns the path to my maven target directory.
3.  Calling Resources.collect() fails to load any data.

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

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

0.9.5-RC2

Please provide any additional information below.

I was able to narrow it down the filename predicate in the Vfs.java

<snip>
Predicate<File> fileNamePredicate = new Predicate<File>() {
            public boolean apply(File file) {
                String path = file.getRelativePath();
                if (path.startsWith(packagePrefix)) {
                    String filename = path.substring(path.indexOf(packagePrefix) + packagePrefix.length());
                    return !Utils.isEmpty(filename) && nameFilter.apply(filename.substring(1));
                } else {
                    return false;
                }
            }
 </snip>

file is properly initialised and is pointing to 
"/full/path/to/my/target/META-INF/reflections/dao-reflections.xml"
path = file.getRelativePath sets path to
"/dao-reflectiosn.xml"
packagePrefix is set to "META-INF/reflections" by the library so...
path.startsWith(packagePrefix)) returns false and so the path is discarded and 
the metadata is not loaded.

Original issue reported on code.google.com by er...@fmail.co.uk on 28 Oct 2010 at 4:06

GoogleCodeExporter commented 9 years ago
fixed on trunk

Original comment by ronm...@gmail.com on 12 May 2011 at 7:49