java - Reflections returning 0 even though class clearly exists -


I have a problem with reflection. I have a class that extends another class called Classmodel:

package net.gd.globalwars.commands; CommandModel {}

in public class command and as you can see that this package is in "net.gd.globalwars.commands" I am now using a new reflection object Which extends all sections, print commandmodel and count, but the count is 0.

  Reflection command = new reflections ("net.gd.globalwars.commands"); System.err.println (commands.getSubTypesOf (CommandModel.class) .size ());  

Thanks advance!

Using this maven dependency, the code works and returns 1 :

  & lt; Dependency & gt; & Lt; Group & gt; Org.reflections & lt; / Group & gt; & Lt; ArtifactId & gt; Reflections & lt; / ArtifactId> & Lt; Version & gt; 0.9.9-RC1 & lt; / Edition & gt; & Lt; / Dependencies & gt; Assume that  

It makes a difference


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -