git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@121 30ef5769-5b8d-40dd-aea6-55b5d6557bb3tags/rel_3_17_1_ga
@@ -27,11 +27,6 @@ final class CtArray extends CtClass { | |||
pool = cp; | |||
} | |||
protected void extendToString(StringBuffer buffer) { | |||
buffer.append(" pool="); | |||
buffer.append(pool); | |||
} | |||
public ClassPool getClassPool() { | |||
return pool; | |||
} |
@@ -168,9 +168,6 @@ public abstract class CtClass { | |||
buf.append("@"); | |||
buf.append(Integer.toHexString(hashCode())); | |||
buf.append("["); | |||
buf.append(Modifier.toString(getModifiers())); | |||
buf.append(' '); | |||
buf.append(getName()); | |||
extendToString(buf); | |||
buf.append("]"); | |||
return buf.toString(); | |||
@@ -180,7 +177,9 @@ public abstract class CtClass { | |||
* Implemented in subclasses to add to the {@link #toString()} result. | |||
* Subclasses should put a space before each token added to the buffer. | |||
*/ | |||
abstract protected void extendToString(StringBuffer buffer); | |||
protected void extendToString(StringBuffer buffer) { | |||
buffer.append(getName()); | |||
} | |||
/** | |||
* Returns a <code>ClassPool</code> for this class. |
@@ -71,10 +71,40 @@ class CtClassType extends CtClass { | |||
protected void extendToString(StringBuffer buffer) { | |||
if (wasChanged) | |||
buffer.append(" changed"); | |||
buffer.append("changed "); | |||
if (wasFrozen) | |||
buffer.append(" frozen"); | |||
buffer.append("frozen "); | |||
buffer.append(Modifier.toString(getModifiers())); | |||
buffer.append(" class "); | |||
buffer.append(getName()); | |||
try { | |||
CtClass ext = getSuperclass(); | |||
if (ext != null) { | |||
String name =ext.getName(); | |||
if (!name.equals("java.lang.Object")) | |||
buffer.append(" extends " + ext.getName()); | |||
} | |||
} | |||
catch (NotFoundException e) { | |||
buffer.append(" extends ??"); | |||
} | |||
try { | |||
CtClass[] intf = getInterfaces(); | |||
if (intf.length > 0) | |||
buffer.append(" implements "); | |||
for (int i = 0; i < intf.length; ++i) { | |||
buffer.append(intf[i].getName()); | |||
buffer.append(", "); | |||
} | |||
} | |||
catch (NotFoundException e) { | |||
buffer.append(" extends ??"); | |||
} | |||
CtField field = getFieldsCache(); | |||
buffer.append(" fields="); |
@@ -43,7 +43,7 @@ class CtNewClass extends CtClassType { | |||
protected void extendToString(StringBuffer buffer) { | |||
if (hasConstructor) | |||
buffer.append(" hasConstructor"); | |||
buffer.append("hasConstructor "); | |||
super.extendToString(buffer); | |||
} |
@@ -41,8 +41,6 @@ public final class CtPrimitiveType extends CtClass { | |||
dataSize = size; | |||
} | |||
protected void extendToString(StringBuffer buffer) {} | |||
/** | |||
* Returns <code>true</code> if this object represents a primitive | |||
* Java type: boolean, byte, char, short, int, long, float, double, |