Reconstruction of Type Information from Java Bytecode for Component Compatibility

  • Authors:
  • Jaroslav Bauml;Premek Brada

  • Affiliations:
  • Department of Computer Science and Engineering, University of West Bohemia, Univerzitni 8, 30614, Pilsen, Czech Republic;Department of Computer Science and Engineering, University of West Bohemia, Univerzitni 8, 30614, Pilsen, Czech Republic

  • Venue:
  • Electronic Notes in Theoretical Computer Science (ENTCS)
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

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 representation 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.