From e5c8e18a43d3eba51eb9f9cd73f43a9bfe7eb159 Mon Sep 17 00:00:00 2001 From: hoenicke Date: Mon, 6 May 2013 19:36:33 +0000 Subject: [PATCH] Updated String type to Java 6/7. One should find a better way than to hardcode all the interfaces String implements and make them a system type too. git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1418 379699f6-c40d-0410-875b-85095c16579e --- jode/src/net/sf/jode/type/ReferenceType.java | 2 +- jode/src/net/sf/jode/type/Type.java | 26 ++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/jode/src/net/sf/jode/type/ReferenceType.java b/jode/src/net/sf/jode/type/ReferenceType.java index d459a24..716a43f 100644 --- a/jode/src/net/sf/jode/type/ReferenceType.java +++ b/jode/src/net/sf/jode/type/ReferenceType.java @@ -26,7 +26,7 @@ import java.util.Vector; import java.util.Enumeration; /** - * This is an abstrace super class of all reference types. Reference + * This is an abstract super class of all reference types. Reference * types are NullType, MultiClassType, and ClassType with its sub types * ClassInfoType, SystemClassType, and ArrayType.

* diff --git a/jode/src/net/sf/jode/type/Type.java b/jode/src/net/sf/jode/type/Type.java index a4c9dc4..7c6da75 100644 --- a/jode/src/net/sf/jode/type/Type.java +++ b/jode/src/net/sf/jode/type/Type.java @@ -175,6 +175,22 @@ public class Type { tSystemClass("java.lang.Comparable", null, EMPTY_IFACES, false, true); + /** + * This type represents the singleton set containing + * java.lang.Appendable. + */ + public static final SystemClassType tAppendable = + tSystemClass("java.lang.Appendable", + null, EMPTY_IFACES, false, true); + + /** + * This type represents the singleton set containing + * java.lang.CharSequence. + */ + public static final SystemClassType tCharSequence = + tSystemClass("java.lang.CharSequence", + null, EMPTY_IFACES, false, true); + /** * This type represents the singleton set containing * java.lang.String. @@ -182,7 +198,7 @@ public class Type { public static final SystemClassType tString = tSystemClass("java.lang.String", tObject, - new ClassType[] { tSerializable, tComparable }, + new ClassType[] { tSerializable, tComparable, tCharSequence }, true, false); /** * This type represents the singleton set containing @@ -190,15 +206,15 @@ public class Type { */ public static final SystemClassType tStringBuffer = tSystemClass("java.lang.StringBuffer", - tObject, new ClassType[] { tSerializable }, + tObject, new ClassType[] { tSerializable, tAppendable, tCharSequence }, true, false); /** * This type represents the singleton set containing - * java.lang.StringBuffer. + * java.lang.StringBuilder. */ public static final SystemClassType tStringBuilder = tSystemClass("java.lang.StringBuilder", - tObject, new ClassType[] { tSerializable }, + tObject, new ClassType[] { tSerializable, tAppendable, tCharSequence }, true, false); /** * This type represents the singleton set containing @@ -270,7 +286,7 @@ public class Type { * Generate the singleton set of the type represented by the given * class name. * @param clazzname the interned full qualified name of the class. - * The packages mus be separated by `.'. + * The packages must be separated by `.'. * @return a singleton set containing the given type. */ public static final SystemClassType tSystemClass