       if field.name is field_spec.name
         return field
 
-    ifaces = (c2t(@constant_pool.get(i).deref()) for i in @interfaces)
-    for ifc in ifaces
-      ifc_cls = rs.class_lookup ifc
+    for i in @interfaces
+      ifc_cls = rs.class_lookup c2t @constant_pool.get(i).deref()
       field = ifc_cls.field_lookup(rs, field_spec)
       return field if field?
 

      method = parent.method_lookup(rs, method_spec)
      return method if method?

    ifaces = (c2t(@constant_pool.get(i).deref()) for i in @interfaces)
    while ifaces.length > 0
      iface_name = ifaces.shift()
      ifc = rs.class_lookup iface_name
      method = ifc.methods[method_spec.sig]
      return method if method?
      Array::push.apply ifaces,
        (c2t(ifc.constant_pool.get(i).deref()) for i in ifc.interfaces)
    return null

if module?

  @for_array_type: (type) ->
    class_file = Object.create ClassFile.prototype # avoid calling the constructor
    class_file.constant_pool = new ConstantPool
    class_file.ml_cache = {}
    class_file.fl_cache = {}
    class_file.access_flags = {}
    class_file.this_class = type
    class_file.super_class = c2t('java/lang/Object')
    class_file.interfaces = []
    class_file.fields = []
    class_file.methods = {}
    class_file.attrs = []
    class_file

