-
Bug
-
Resolution: Done
-
Major
-
3.0.14, 4.0.6
-
None
When the type checker encounters a type name during type checking of some given rule it creates an internal Type object which holds a name String and Class<?> instance as fields. The name may already be associated with a Class<?> or it may need to be resolved by a class loader lookup. Types are stored in a TypeGroup which allows previous lookups to be reused. In some cases the name may not resolve and the type checker normally detects this and throws a type error.
Type instances are, on occasions, created using a name obtained from a Class<?> accessed through reflection. In such cases a loader lookup may still be performed even though the originating class was known. The type checker does notexpect these lookups to fail.
Inner classes modelled via this latter route are being modelled up using their canonical name, e.g. in the format org.my.Foo.Bar, instead of the format required for a successful lookup, which e.g. would be org.my.Foo$Bar. As a result the classloader lookup silently fails and the resulting Type instance has a null reference its class. The subsequent check to see if the class for that Type is publicly accessible blows up with NPE.