Types moved to jode.type

useType removed
bug fix in createRangeType


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@607 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent bf41a3ccea
commit deb5ea736b
  1. 23
      jode/jode/type/ClassInterfacesType.java

@ -17,7 +17,7 @@
* $Id$ * $Id$
*/ */
package jode; package jode.type;
import jode.bytecode.ClassInfo; import jode.bytecode.ClassInfo;
import java.util.Vector; import java.util.Vector;
import java.util.Stack; import java.util.Stack;
@ -112,8 +112,7 @@ public class ClassInterfacesType extends ReferenceType {
if (bottom.clazz != null) { if (bottom.clazz != null) {
/* The searched type must be a class type. /* The searched type must be a class type.
*/ */
if (this.ifaces.length != 0 if (!bottom.clazz.superClassOf(this.clazz))
|| !bottom.clazz.superClassOf(this.clazz))
return tError; return tError;
/* All interfaces must be implemented by this.clazz /* All interfaces must be implemented by this.clazz
@ -127,6 +126,8 @@ public class ClassInterfacesType extends ReferenceType {
&& bottom.ifaces.length == 0) && bottom.ifaces.length == 0)
return bottom; return bottom;
if (this.ifaces.length != 0)
return tRange(bottom, create(this.clazz, new ClassInfo[0]));
return tRange(bottom, this); return tRange(bottom, this);
} else { } else {
@ -378,16 +379,6 @@ public class ClassInterfacesType extends ReferenceType {
return create(clazz, ifaceArray); return create(clazz, ifaceArray);
} }
/**
* Marks this type as used, so that the class is imported.
*/
public void useType() {
if (clazz != null)
env.useClass(clazz.getName());
else if (ifaces.length > 0)
env.useClass(ifaces[0].getName());
}
public String getTypeSignature() { public String getTypeSignature() {
if (clazz != null) if (clazz != null)
return "L" + clazz.getName().replace('.','/') + ";"; return "L" + clazz.getName().replace('.','/') + ";";
@ -418,12 +409,12 @@ public class ClassInterfacesType extends ReferenceType {
public String toString() public String toString()
{ {
if (this == tObject) if (this == tObject)
return env.classString("java.lang.Object"); return "java.lang.Object";
if (ifaces.length == 0) if (ifaces.length == 0)
return env.classString(clazz.getName()); return clazz.getName();
if (clazz == null && ifaces.length == 1) if (clazz == null && ifaces.length == 1)
return env.classString(ifaces[0].getName()); return ifaces[0].getName();
StringBuffer sb = new StringBuffer("{"); StringBuffer sb = new StringBuffer("{");
String comma = ""; String comma = "";

Loading…
Cancel
Save