Reconstruction of Type Information from Java Bytecode for Component Compatibility

Jaroslav Bauml, Premek Brada
2011 Electronical Notes in Theoretical Computer Science  
The Java type system is strictly checked by both the compiler and the runtime bytecode interpreter of the JVM. These mechanisms together guarantee appropriate usage of class instances. Using modern component systems can however circumvent these static checks, because incompatible versions of classes can be bound together during component installation or update. Such problematic bindings result in ClassCastException or NoSuchMethodException runtime errors. In this paper we describe a
more » ... on of Java language types suitable for checking component compatibility. The presented approach applies various bytecode handling techniques to reconstruct a representation of the Java types contained in a component implementation, using different sources of class data. The representation is then used during build-and run-time type system verifications with the aim to prevent these kinds of errors. We have successfully applied this approach to prevent OSGi component incompatibilities.
doi:10.1016/j.entcs.2011.02.002 fatcat:sm5aptbmlzgy5dnjjc55zo7su4