 
 # Represents a single Class in the JVM.
 class ClassData
-  constructor: (@loader=null) -> # NOP
+  # Responsible for setting up all of the fields that are guaranteed to be
+  # present on any ClassData object.
+  constructor: (@loader=null) ->
+    @ml_cache = {}
+    @fl_cache = {}
+    @access_flags = {}
+    @interfaces = []
+    @fields = []
+    @methods = {}
+    @attrs = []
+    @initialized = false
+    @static_fields = []
 
   # Resets any ClassData state that may have been built up
   load: () ->

# Represents a "reference" Class -- that is, a class that neither represents a
# primitive nor an array.
class root.ReferenceClassData extends ClassData
  constructor: (bytes_array, @loader=null) ->
    # XXX: Circular dependency hack.
    unless methods?
      methods = require './methods'

    bytes_array = new util.BytesArray bytes_array
    throw "Magic number invalid" if (bytes_array.get_uint 4) != 0xCAFEBABE

    @super_class = @constant_pool.get(super_ref).deref() unless super_ref is 0
    # direct interfaces of this class
    isize = bytes_array.get_uint 2
    @interfaces = (@constant_pool.get(bytes_array.get_uint 2).deref() for i in [0...isize] by 1)
    # fields of this class
    num_fields = bytes_array.get_uint 2
    @fields = (new methods.Field(@) for i in [0...num_fields] by 1)
