javaclass

Change of bytecode.py

105:0a42c2118b55
bytecode.py
     1.1 --- a/bytecode.py	Mon Jan 10 01:06:17 2005 +0100
     1.2 +++ b/bytecode.py	Mon Jan 10 23:39:28 2005 +0100
     1.3 @@ -2245,27 +2245,24 @@
     1.4          """
     1.5  
     1.6          original_name = str(self.class_file.super_class.get_name())
     1.7 -        if original_name in ("java/lang/Object", "java/lang/Exception"):
     1.8 -            return (object,)
     1.9 +        full_this_class_name = str(self.class_file.this_class.get_python_name())
    1.10 +        this_class_name_parts = full_this_class_name.split(".")
    1.11 +        this_class_module_name = ".".join(this_class_name_parts[:-1])
    1.12 +        full_super_class_name = str(self.class_file.super_class.get_python_name())
    1.13 +        super_class_name_parts = full_super_class_name.split(".")
    1.14 +        super_class_name = super_class_name_parts[-1]
    1.15 +        super_class_module_name = ".".join(super_class_name_parts[:-1])
    1.16 +        if super_class_module_name == "":
    1.17 +            obj = global_names[super_class_name]
    1.18 +        elif super_class_module_name == this_class_module_name:
    1.19 +            obj = global_names[super_class_name]
    1.20          else:
    1.21 -            full_this_class_name = str(self.class_file.this_class.get_python_name())
    1.22 -            this_class_name_parts = full_this_class_name.split(".")
    1.23 -            this_class_module_name = ".".join(this_class_name_parts[:-1])
    1.24 -            full_super_class_name = str(self.class_file.super_class.get_python_name())
    1.25 -            super_class_name_parts = full_super_class_name.split(".")
    1.26 -            super_class_name = super_class_name_parts[-1]
    1.27 -            super_class_module_name = ".".join(super_class_name_parts[:-1])
    1.28 -            if super_class_module_name == "":
    1.29 -                obj = global_names[super_class_name]
    1.30 -            elif super_class_module_name == this_class_module_name:
    1.31 -                obj = global_names[super_class_name]
    1.32 -            else:
    1.33 -                print "Importing", super_class_module_name, super_class_name
    1.34 -                obj = __import__(super_class_module_name, global_names, {}, [])
    1.35 -                for super_class_name_part in super_class_name_parts[1:] or [super_class_name]:
    1.36 -                    print "*", obj, super_class_name_part
    1.37 -                    obj = getattr(obj, super_class_name_part)
    1.38 -            return (obj,)
    1.39 +            print "Importing", super_class_module_name, super_class_name
    1.40 +            obj = __import__(super_class_module_name, global_names, {}, [])
    1.41 +            for super_class_name_part in super_class_name_parts[1:] or [super_class_name]:
    1.42 +                print "*", obj, super_class_name_part
    1.43 +                obj = getattr(obj, super_class_name_part)
    1.44 +        return (obj,)
    1.45  
    1.46      def make_varnames(self, nlocals, method_is_static=0):
    1.47