Can't find class from rt.jar

46 views
Skip to first unread message

den....@gmail.com

unread,
Jun 26, 2013, 5:56:17 AM6/26/13
to google-code...@googlegroups.com
I am trying to preload (force load) of classes from predefined package set. And got situation when classes from rt.jar aren't loaded by reflections. 

For test purposes I cut my reflections configuration to attempt to load only one JDK class:

        ConfigurationBuilder cb = new ConfigurationBuilder()
                .setScanners(new SubTypesScanner(false))
                .useParallelExecutor();

        cb.addUrls(ClasspathHelper.forClass(DoubleSignature.class));

        Reflections reflections = new Reflections(cb);

        Set<Class<? extends DoubleSignature>> classesToLoad = reflections.getSubTypesOf(DoubleSignature.class);

        Assert.assertTrue(classesToLoad.contains(DoubleSignature.class)); // -> throw java.lang.AssertionError here

And it doesn't load DoubleSignature. Is it reflections bug? Or am I doing something wrong?

mamo

unread,
Jun 27, 2013, 3:30:15 AM6/27/13
to google-code...@googlegroups.com
why DoubleSignature?! 
anyways, should work like a glove, for example reflections.getSubTypes(Number.class) -> [class java.lang.Float, class java.lang.Integer, ...]
Reply all
Reply to author
Forward
0 new messages