# HG changeset patch # User Frank Benoit # Date 1240132209 -7200 # Node ID 9e0ab372d5d8def45b49ebb5b99bdeb85dbf8de8 # Parent 8594250b1d1cc7ff39764d2b4c010aac7ba8635b Revert from TypeInfo/ClassInfo to java.lang.Class diff -r 8594250b1d1c -r 9e0ab372d5d8 base/src/java/lang/Boolean.d --- a/base/src/java/lang/Boolean.d Sat Apr 18 14:20:15 2009 +0200 +++ b/base/src/java/lang/Boolean.d Sun Apr 19 11:10:09 2009 +0200 @@ -2,6 +2,7 @@ import java.lang.util; import java.lang.System; +import java.lang.Class; version(Tango){ static import tango.text.Ascii; @@ -50,10 +51,10 @@ } } - private static TypeInfo TYPE_; - public static TypeInfo TYPE(){ + private static Class TYPE_; + public static Class TYPE(){ if( TYPE_ is null ){ - TYPE_ = typeid(bool); + TYPE_ = Class.fromType!(bool); } return TYPE_; } diff -r 8594250b1d1c -r 9e0ab372d5d8 base/src/java/lang/Byte.d --- a/base/src/java/lang/Byte.d Sat Apr 18 14:20:15 2009 +0200 +++ b/base/src/java/lang/Byte.d Sun Apr 19 11:10:09 2009 +0200 @@ -3,6 +3,7 @@ import java.lang.util; import java.lang.exceptions; import java.lang.Number; +import java.lang.Class; version(Tango){ static import tango.text.convert.Integer; @@ -39,10 +40,10 @@ return String_valueOf(i); } - private static TypeInfo TYPE_; - public static TypeInfo TYPE(){ + private static Class TYPE_; + public static Class TYPE(){ if( TYPE_ is null ){ - TYPE_ = typeid(byte); + TYPE_ = Class.fromType!(byte); } return TYPE_; } diff -r 8594250b1d1c -r 9e0ab372d5d8 base/src/java/lang/Character.d --- a/base/src/java/lang/Character.d Sat Apr 18 14:20:15 2009 +0200 +++ b/base/src/java/lang/Character.d Sun Apr 19 11:10:09 2009 +0200 @@ -2,6 +2,7 @@ import java.lang.exceptions; import java.lang.util; +import java.lang.Class; version(Tango){ static import tango.text.Unicode; @@ -125,10 +126,10 @@ implMissing( __FILE__, __LINE__); } - private static TypeInfo TYPE_; - public static TypeInfo TYPE(){ + private static Class TYPE_; + public static Class TYPE(){ if( TYPE_ is null ){ - TYPE_ = typeid(char); + TYPE_ = Class.fromType!(char); } return TYPE_; } diff -r 8594250b1d1c -r 9e0ab372d5d8 base/src/java/lang/Class.d --- a/base/src/java/lang/Class.d Sat Apr 18 14:20:15 2009 +0200 +++ b/base/src/java/lang/Class.d Sun Apr 19 11:10:09 2009 +0200 @@ -1,6 +1,7 @@ module java.lang.Class; import java.lang.util; +import java.lang.String; import java.lang.reflect.Method; import java.lang.reflect.Field; import java.lang.reflect.Package; diff -r 8594250b1d1c -r 9e0ab372d5d8 base/src/java/lang/Double.d --- a/base/src/java/lang/Double.d Sat Apr 18 14:20:15 2009 +0200 +++ b/base/src/java/lang/Double.d Sun Apr 19 11:10:09 2009 +0200 @@ -2,6 +2,7 @@ import java.lang.util; import java.lang.Number; +import java.lang.Class; class Double : Number { public static double POSITIVE_INFINITY = double.infinity; @@ -26,10 +27,10 @@ return 0.0; } - private static TypeInfo TYPE_; - public static TypeInfo TYPE(){ + private static Class TYPE_; + public static Class TYPE(){ if( TYPE_ is null ){ - TYPE_ = typeid(double); + TYPE_ = Class.fromType!(double); } return TYPE_; } diff -r 8594250b1d1c -r 9e0ab372d5d8 base/src/java/lang/Float.d --- a/base/src/java/lang/Float.d Sat Apr 18 14:20:15 2009 +0200 +++ b/base/src/java/lang/Float.d Sun Apr 19 11:10:09 2009 +0200 @@ -3,6 +3,7 @@ import java.lang.util; import java.lang.exceptions; import java.lang.Number; +import java.lang.Class; class Float : Number { @@ -40,10 +41,10 @@ } } - private static TypeInfo TYPE_; - public static TypeInfo TYPE(){ + private static Class TYPE_; + public static Class TYPE(){ if( TYPE_ is null ){ - TYPE_ = typeid(float); + TYPE_ = Class.fromType!(float); } return TYPE_; } diff -r 8594250b1d1c -r 9e0ab372d5d8 base/src/java/lang/Integer.d --- a/base/src/java/lang/Integer.d Sat Apr 18 14:20:15 2009 +0200 +++ b/base/src/java/lang/Integer.d Sun Apr 19 11:10:09 2009 +0200 @@ -3,6 +3,7 @@ import java.lang.util; import java.lang.exceptions; import java.lang.Number; +import java.lang.Class; version(Tango){ } else { // Phobos @@ -148,10 +149,10 @@ } } - private static TypeInfo TYPE_; - public static TypeInfo TYPE(){ + private static Class TYPE_; + public static Class TYPE(){ if( TYPE_ is null ){ - TYPE_ = typeid(int); + TYPE_ = Class.fromType!(int); } return TYPE_; } diff -r 8594250b1d1c -r 9e0ab372d5d8 base/src/java/lang/Long.d --- a/base/src/java/lang/Long.d Sat Apr 18 14:20:15 2009 +0200 +++ b/base/src/java/lang/Long.d Sun Apr 19 11:10:09 2009 +0200 @@ -2,6 +2,7 @@ import java.lang.util; import java.lang.Number; +import java.lang.Class; class Long : Number { public static const long MIN_VALUE = long.min; @@ -46,10 +47,10 @@ implMissing( __FILE__, __LINE__ ); return null; } - private static TypeInfo TYPE_; - public static TypeInfo TYPE(){ + private static Class TYPE_; + public static Class TYPE(){ if( TYPE_ is null ){ - TYPE_ = typeid(long); + TYPE_ = Class.fromType!(long); } return TYPE_; } diff -r 8594250b1d1c -r 9e0ab372d5d8 base/src/java/lang/Short.d --- a/base/src/java/lang/Short.d Sat Apr 18 14:20:15 2009 +0200 +++ b/base/src/java/lang/Short.d Sun Apr 19 11:10:09 2009 +0200 @@ -3,6 +3,7 @@ import java.lang.util; import java.lang.exceptions; import java.lang.Number; +import java.lang.Class; version(Tango){ static import tango.text.convert.Integer; @@ -38,10 +39,10 @@ return String_valueOf(i); } - private static TypeInfo TYPE_; - public static TypeInfo TYPE(){ + private static Class TYPE_; + public static Class TYPE(){ if( TYPE_ is null ){ - TYPE_ = typeid(short); + TYPE_ = Class.fromType!(short); } return TYPE_; } diff -r 8594250b1d1c -r 9e0ab372d5d8 base/src/java/lang/String.d --- a/base/src/java/lang/String.d Sat Apr 18 14:20:15 2009 +0200 +++ b/base/src/java/lang/String.d Sun Apr 19 11:10:09 2009 +0200 @@ -3,6 +3,7 @@ import java.lang.util; import java.lang.interfaces; import java.lang.exceptions; +import java.lang.Class; version(Tango){ static import tango.stdc.stringz; @@ -788,10 +789,10 @@ } class StringCls { - private static TypeInfo TYPE_; - public static TypeInfo TYPE(){ + private static Class TYPE_; + public static Class TYPE(){ if( TYPE_ is null ){ - TYPE_ = typeid(char[]); + TYPE_ = Class.fromType!(char[]); } return TYPE_; } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/AggregateValidationStatus.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/AggregateValidationStatus.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/AggregateValidationStatus.d Sun Apr 19 11:10:09 2009 +0200 @@ -113,9 +113,9 @@ public this(Realm realm, IObservableCollection validationStatusProviders, int strategy) { if (strategy is MERGED) { - implementation = new class(realm, typeid(IStatus), validationStatusProviders) ComputedValue { + implementation = new class(realm, Class.fromType!(IStatus), validationStatusProviders) ComputedValue { IObservableCollection validationStatusProviders_; - this(Realm r, TypeInfo c, IObservableCollection v){ + this(Realm r, Class c, IObservableCollection v){ super(r, c); validationStatusProviders_=v; } @@ -124,9 +124,9 @@ } }; } else { - implementation = new class(realm, typeid(IStatus), validationStatusProviders) ComputedValue { + implementation = new class(realm, Class.fromType!(IStatus), validationStatusProviders) ComputedValue { IObservableCollection validationStatusProviders_; - this(Realm r, TypeInfo c, IObservableCollection v){ + this(Realm r, Class c, IObservableCollection v){ super(r, c); validationStatusProviders_=v; } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/ListBinding.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ListBinding.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ListBinding.d Sun Apr 19 11:10:09 2009 +0200 @@ -96,7 +96,7 @@ protected void preInit() { validationStatusObservable = new WritableValue(context - .getValidationRealm(), cast(Object)Status.OK_STATUS, typeid(IStatus)); + .getValidationRealm(), cast(Object)Status.OK_STATUS, Class.fromType!(IStatus)); } protected void postInit() { diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/SetBinding.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/SetBinding.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/SetBinding.d Sun Apr 19 11:10:09 2009 +0200 @@ -97,7 +97,7 @@ protected void preInit() { validationStatusObservable = new WritableValue(context - .getValidationRealm(), cast(Object)Status.OK_STATUS, typeid(IStatus)); + .getValidationRealm(), cast(Object)Status.OK_STATUS, Class.fromType!(IStatus)); } protected void postInit() { diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateStrategy.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateStrategy.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateStrategy.d Sun Apr 19 11:10:09 2009 +0200 @@ -15,7 +15,6 @@ import org.eclipse.core.databinding.BindingException; import java.lang.all; -import java.nonstandard.RuntimeTraits; import java.math.BigDecimal; import java.math.BigInteger; @@ -72,23 +71,23 @@ private static Map converterMap; - private static TypeInfo autoboxed(TypeInfo clazz) { + private static Class autoboxed(Class clazz) { if (clazz is Float.TYPE) - return typeid(Float); + return Class.fromType!(Float); else if (clazz is Double.TYPE) - return typeid(Double); + return Class.fromType!(Double); else if (clazz is Short.TYPE) - return typeid(Short); + return Class.fromType!(Short); else if (clazz is Integer.TYPE) - return typeid(Integer); + return Class.fromType!(Integer); else if (clazz is Long.TYPE) - return typeid(Long); + return Class.fromType!(Long); else if (clazz is Byte.TYPE) - return typeid(Byte); + return Class.fromType!(Byte); else if (clazz is Boolean.TYPE) - return typeid(Boolean); + return Class.fromType!(Boolean); else if (clazz is Character.TYPE) - return typeid(Character); + return Class.fromType!(Character); return clazz; } @@ -114,32 +113,32 @@ * @return an IConverter, or null if unsuccessful */ protected IConverter createConverter(Object fromType, Object toType) { - if (!( null !is cast(TypeInfo)fromType ) || !( null !is cast(TypeInfo)toType )) { + if (!( null !is cast(Class)fromType ) || !( null !is cast(Class)toType )) { return new DefaultConverter(fromType, toType); } - TypeInfo toClass = cast(TypeInfo) toType; - TypeInfo originalToClass = toClass; - if (isJavaPrimitive(toClass)) { + Class toClass = cast(Class) toType; + Class originalToClass = toClass; + if (toClass.isPrimitive()) { toClass = autoboxed(toClass); } - TypeInfo fromClass = cast(TypeInfo) fromType; - TypeInfo originalFromClass = fromClass; - if (isJavaPrimitive(fromClass)) { + Class fromClass = cast(Class) fromType; + Class originalFromClass = fromClass; + if (fromClass.isPrimitive()) { fromClass = autoboxed(fromClass); } - if (!isJavaPrimitive(cast(TypeInfo) toType) - && isImplicitly(fromClass, toClass)) { + if (!(cast(Class) toType).isPrimitive() + && toClass.isAssignableFrom(fromClass)) { return new IdentityConverter(originalFromClass, originalToClass); } - if (isJavaPrimitive(cast(TypeInfo) fromType) && isJavaPrimitive(cast(TypeInfo) toType) + if ((cast(Class) fromType).isPrimitive() && (cast(Class) toType).isPrimitive() && fromType.opEquals(toType)) { return new IdentityConverter(originalFromClass, originalToClass); } Map converterMap = getConverterMap(); - TypeInfo[] supertypeHierarchyFlattened = ClassLookupSupport + Class[] supertypeHierarchyFlattened = ClassLookupSupport .getTypeHierarchyFlattened(fromClass); for (int i = 0; i < supertypeHierarchyFlattened.length; i++) { - TypeInfo currentFromClass = supertypeHierarchyFlattened[i]; + Class currentFromClass = supertypeHierarchyFlattened[i]; if (currentFromClass is toType) { // converting to toType is just a widening return new IdentityConverter(fromClass, toClass); @@ -151,11 +150,11 @@ return cast(IConverter) converterOrClassname; } else if ( null !is cast(ArrayWrapperString)converterOrClassname ) { String classname = stringcast( converterOrClassname); - ClassInfo converterClass; + Class converterClass; try { - converterClass = ClassInfo.find(classname); + converterClass = Class.forName(classname); IConverter result = cast(IConverter) converterClass - .create(); + .newInstance(); converterMap.put(stringcast(key), cast(Object)result); return result; } catch (Exception e) { @@ -173,7 +172,7 @@ // Since we found no converter yet, try a "downcast" converter; // the IdentityConverter will automatically check the actual types at // runtime. - if (isImplicitly(toClass, fromClass)) { + if (fromClass.isAssignableFrom(toClass)) { return new IdentityConverter(originalFromClass, originalToClass); } return new DefaultConverter(fromType, toType); @@ -259,10 +258,10 @@ new Pair("java.lang.String", INTEGER_TYPE), StringToNumberConverter.toInteger(integerFormat, true)); //$NON-NLS-1$ converterMap .put( - new Pair(INTEGER_TYPE, "java.lang.Integer"), new IdentityConverter(Integer.TYPE, typeid(Integer))); //$NON-NLS-1$ + new Pair(INTEGER_TYPE, "java.lang.Integer"), new IdentityConverter(Integer.TYPE, Class.fromType!(Integer))); //$NON-NLS-1$ converterMap .put( - new Pair(INTEGER_TYPE, "java.lang.Object"), new IdentityConverter(Integer.TYPE, typeid(Object))); //$NON-NLS-1$ + new Pair(INTEGER_TYPE, "java.lang.Object"), new IdentityConverter(Integer.TYPE, Class.fromType!(Object))); //$NON-NLS-1$ converterMap .put( new Pair(INTEGER_TYPE, "java.lang.String"), NumberToStringConverter.fromInteger(integerFormat, true)); //$NON-NLS-1$ @@ -273,13 +272,13 @@ new Pair("java.lang.String", BYTE_TYPE), StringToByteConverter.toByte(integerFormat, true)); //$NON-NLS-1$ converterMap .put( - new Pair(BYTE_TYPE, "java.lang.Byte"), new IdentityConverter(Byte.TYPE, typeid(Byte))); //$NON-NLS-1$ + new Pair(BYTE_TYPE, "java.lang.Byte"), new IdentityConverter(Byte.TYPE, Class.fromType!(Byte))); //$NON-NLS-1$ converterMap .put( new Pair(BYTE_TYPE, "java.lang.String"), IntegerToStringConverter.fromByte(integerFormat, true)); //$NON-NLS-1$ converterMap .put( - new Pair(BYTE_TYPE, "java.lang.Object"), new IdentityConverter(Byte.TYPE, typeid(Object))); //$NON-NLS-1$ + new Pair(BYTE_TYPE, "java.lang.Object"), new IdentityConverter(Byte.TYPE, Class.fromType!(Object))); //$NON-NLS-1$ // Double.TYPE converterMap @@ -291,10 +290,10 @@ converterMap .put( - new Pair(DOUBLE_TYPE, "java.lang.Double"), new IdentityConverter(Double.TYPE, typeid(Double))); //$NON-NLS-1$ + new Pair(DOUBLE_TYPE, "java.lang.Double"), new IdentityConverter(Double.TYPE, Class.fromType!(Double))); //$NON-NLS-1$ converterMap .put( - new Pair(DOUBLE_TYPE, "java.lang.Object"), new IdentityConverter(Double.TYPE, typeid(Object))); //$NON-NLS-1$ + new Pair(DOUBLE_TYPE, "java.lang.Object"), new IdentityConverter(Double.TYPE, Class.fromType!(Object))); //$NON-NLS-1$ // Boolean.TYPE converterMap @@ -302,13 +301,13 @@ new Pair("java.lang.String", BOOLEAN_TYPE), "org.eclipse.core.internal.databinding.conversion.StringToBooleanPrimitiveConverter"); //$NON-NLS-1$ //$NON-NLS-2$ converterMap .put( - new Pair(BOOLEAN_TYPE, "java.lang.Boolean"), new IdentityConverter(Boolean.TYPE, typeid(Boolean))); //$NON-NLS-1$ + new Pair(BOOLEAN_TYPE, "java.lang.Boolean"), new IdentityConverter(Boolean.TYPE, Class.fromType!(Boolean))); //$NON-NLS-1$ converterMap .put( new Pair(BOOLEAN_TYPE, "java.lang.String"), new ObjectToStringConverter(Boolean.TYPE)); //$NON-NLS-1$ converterMap .put( - new Pair(BOOLEAN_TYPE, "java.lang.Object"), new IdentityConverter(Boolean.TYPE, typeid(Object))); //$NON-NLS-1$ + new Pair(BOOLEAN_TYPE, "java.lang.Object"), new IdentityConverter(Boolean.TYPE, Class.fromType!(Object))); //$NON-NLS-1$ // Float.TYPE converterMap @@ -319,10 +318,10 @@ new Pair(FLOAT_TYPE, "java.lang.String"), NumberToStringConverter.fromFloat(numberFormat, true)); //$NON-NLS-1$ converterMap .put( - new Pair(FLOAT_TYPE, "java.lang.Float"), new IdentityConverter(Float.TYPE, typeid(Float))); //$NON-NLS-1$ + new Pair(FLOAT_TYPE, "java.lang.Float"), new IdentityConverter(Float.TYPE, Class.fromType!(Float))); //$NON-NLS-1$ converterMap .put( - new Pair(FLOAT_TYPE, "java.lang.Object"), new IdentityConverter(Float.TYPE, typeid(Object))); //$NON-NLS-1$ + new Pair(FLOAT_TYPE, "java.lang.Object"), new IdentityConverter(Float.TYPE, Class.fromType!(Object))); //$NON-NLS-1$ // Short.TYPE converterMap @@ -330,13 +329,13 @@ new Pair("java.lang.String", SHORT_TYPE), StringToShortConverter.toShort(integerFormat, true)); //$NON-NLS-1$ converterMap .put( - new Pair(SHORT_TYPE, "java.lang.Short"), new IdentityConverter(Short.TYPE, typeid(Short))); //$NON-NLS-1$ + new Pair(SHORT_TYPE, "java.lang.Short"), new IdentityConverter(Short.TYPE, Class.fromType!(Short))); //$NON-NLS-1$ converterMap .put( new Pair(SHORT_TYPE, "java.lang.String"), IntegerToStringConverter.fromShort(integerFormat, true)); //$NON-NLS-1$ converterMap .put( - new Pair(SHORT_TYPE, "java.lang.Object"), new IdentityConverter(Short.TYPE, typeid(Object))); //$NON-NLS-1$ + new Pair(SHORT_TYPE, "java.lang.Object"), new IdentityConverter(Short.TYPE, Class.fromType!(Object))); //$NON-NLS-1$ // Long.TYPE converterMap @@ -347,10 +346,10 @@ new Pair(LONG_TYPE, "java.lang.String"), NumberToStringConverter.fromLong(integerFormat, true)); //$NON-NLS-1$ converterMap .put( - new Pair(LONG_TYPE, "java.lang.Long"), new IdentityConverter(Long.TYPE, typeid(Long))); //$NON-NLS-1$ + new Pair(LONG_TYPE, "java.lang.Long"), new IdentityConverter(Long.TYPE, Class.fromType!(Long))); //$NON-NLS-1$ converterMap .put( - new Pair(LONG_TYPE, "java.lang.Object"), new IdentityConverter(Long.TYPE, typeid(Object))); //$NON-NLS-1$ + new Pair(LONG_TYPE, "java.lang.Object"), new IdentityConverter(Long.TYPE, Class.fromType!(Object))); //$NON-NLS-1$ // Character.TYPE converterMap @@ -358,13 +357,13 @@ new Pair("java.lang.String", CHARACTER_TYPE), StringToCharacterConverter.toCharacter(true)); //$NON-NLS-1$ converterMap .put( - new Pair(CHARACTER_TYPE, "java.lang.Character"), new IdentityConverter(Character.TYPE, typeid(Character))); //$NON-NLS-1$ + new Pair(CHARACTER_TYPE, "java.lang.Character"), new IdentityConverter(Character.TYPE, Class.fromType!(Character))); //$NON-NLS-1$ converterMap .put( new Pair(CHARACTER_TYPE, "java.lang.String"), CharacterToStringConverter.fromCharacter(true)); //$NON-NLS-1$ converterMap .put( - new Pair(CHARACTER_TYPE, "java.lang.Object"), new IdentityConverter(Character.TYPE, typeid(Object))); //$NON-NLS-1$ + new Pair(CHARACTER_TYPE, "java.lang.Object"), new IdentityConverter(Character.TYPE, Class.fromType!(Object))); //$NON-NLS-1$ // Miscellaneous converterMap @@ -412,14 +411,14 @@ return converterMap; } - private static TypeInfo[] integerClasses; - private static TypeInfo[] floatClasses; + private static Class[] integerClasses; + private static Class[] floatClasses; static this(){ integerClasses = [ Byte.TYPE, - typeid(Byte), Short.TYPE, typeid(Short), Integer.TYPE, typeid(Integer), - Long.TYPE, typeid(Long), typeid(BigInteger) ]; + Class.fromType!(Byte), Short.TYPE, Class.fromType!(Short), Integer.TYPE, Class.fromType!(Integer), + Long.TYPE, Class.fromType!(Long), Class.fromType!(BigInteger) ]; floatClasses = [ Float.TYPE, - typeid(Float), Double.TYPE, typeid(Double), typeid(BigDecimal) ]; + Class.fromType!(Float), Double.TYPE, Class.fromType!(Double), Class.fromType!(BigDecimal) ]; } @@ -432,20 +431,20 @@ * @param fromTypes */ private static void addNumberToByteConverters(Map map, - NumberFormat numberFormat, TypeInfo[] fromTypes) { + NumberFormat numberFormat, Class[] fromTypes) { for (int i = 0; i < fromTypes.length; i++) { - TypeInfo fromType = fromTypes[i]; - if (fromType != typeid(Byte) && fromType != Byte.TYPE) { - String fromName = isJavaPrimitive(fromType) ? getKeyForClass( - fromType, null) : .getName(fromType); + Class fromType = fromTypes[i]; + if (fromType != Class.fromType!(Byte) && fromType != Byte.TYPE) { + String fromName = fromType.isPrimitive() ? getKeyForClass( + fromType, null) : fromType.getName(); map .put(new Pair(fromName, BYTE_TYPE), new NumberToByteConverter(numberFormat, fromType, true)); map - .put(new Pair(fromName, .getName(Byte.classinfo)), + .put(new Pair(fromName, Class.fromType!(Byte).getName()), new NumberToByteConverter(numberFormat, fromType, false)); } @@ -461,18 +460,18 @@ * @param fromTypes */ private static void addNumberToShortConverters(Map map, - NumberFormat numberFormat, TypeInfo[] fromTypes) { + NumberFormat numberFormat, Class[] fromTypes) { for (int i = 0; i < fromTypes.length; i++) { - TypeInfo fromType = fromTypes[i]; - if (fromType != typeid(Short) && fromType != Short.TYPE) { - String fromName = isJavaPrimitive(fromType) ? getKeyForClass( - fromType, null) : .getName(fromType); + Class fromType = fromTypes[i]; + if (fromType != Class.fromType!(Short) && fromType != Short.TYPE) { + String fromName = fromType.isPrimitive() ? getKeyForClass( + fromType, null) : fromType.getName(); map .put(new Pair(fromName, SHORT_TYPE), new NumberToShortConverter(numberFormat, fromType, true)); - map.put(new Pair(fromName, .getName(Short.classinfo)), + map.put(new Pair(fromName, Class.fromType!(Short).getName()), new NumberToShortConverter(numberFormat, fromType, false)); } @@ -488,18 +487,18 @@ * @param fromTypes */ private static void addNumberToIntegerConverters(Map map, - NumberFormat numberFormat, TypeInfo[] fromTypes) { + NumberFormat numberFormat, Class[] fromTypes) { for (int i = 0; i < fromTypes.length; i++) { - TypeInfo fromType = fromTypes[i]; - if (fromType != typeid(Integer) + Class fromType = fromTypes[i]; + if (fromType != Class.fromType!(Integer) && fromType != Integer.TYPE) { - String fromName = isJavaPrimitive(fromType) ? getKeyForClass( - fromType, null) : .getName(fromType); + String fromName = fromType.isPrimitive() ? getKeyForClass( + fromType, null) : fromType.getName(); map.put(new Pair(fromName, INTEGER_TYPE), new NumberToIntegerConverter(numberFormat, fromType, true)); - map.put(new Pair(fromName, .getName(Integer.classinfo)), + map.put(new Pair(fromName, Class.fromType!(Integer).getName()), new NumberToIntegerConverter(numberFormat, fromType, false)); } @@ -515,19 +514,19 @@ * @param fromTypes */ private static void addNumberToLongConverters(Map map, - NumberFormat numberFormat, TypeInfo[] fromTypes) { + NumberFormat numberFormat, Class[] fromTypes) { for (int i = 0; i < fromTypes.length; i++) { - TypeInfo fromType = fromTypes[i]; - if (fromType != typeid(Long) && fromType != Long.TYPE) { - String fromName = isJavaPrimitive(fromType) ? getKeyForClass( - fromType, null) : .getName(fromType); + Class fromType = fromTypes[i]; + if (fromType != Class.fromType!(Long) && fromType != Long.TYPE) { + String fromName = fromType.isPrimitive() ? getKeyForClass( + fromType, null) : fromType.getName(); map .put(new Pair(fromName, LONG_TYPE), new NumberToLongConverter(numberFormat, fromType, true)); map - .put(new Pair(fromName, .getName(Long.classinfo)), + .put(new Pair(fromName, Class.fromType!(Long).getName()), new NumberToLongConverter(numberFormat, fromType, false)); } @@ -543,18 +542,18 @@ * @param fromTypes */ private static void addNumberToFloatConverters(Map map, - NumberFormat numberFormat, TypeInfo[] fromTypes) { + NumberFormat numberFormat, Class[] fromTypes) { for (int i = 0; i < fromTypes.length; i++) { - TypeInfo fromType = fromTypes[i]; - if (fromType != typeid(Float) && fromType != Float.TYPE) { - String fromName = isJavaPrimitive(fromType) ? getKeyForClass( - fromType, null) : .getName(fromType); + Class fromType = fromTypes[i]; + if (fromType != Class.fromType!(Float) && fromType != Float.TYPE) { + String fromName = fromType.isPrimitive() ? getKeyForClass( + fromType, null) : fromType.getName(); map .put(new Pair(fromName, FLOAT_TYPE), new NumberToFloatConverter(numberFormat, fromType, true)); - map.put(new Pair(fromName, .getName(Float.classinfo)), + map.put(new Pair(fromName, Class.fromType!(Float).getName()), new NumberToFloatConverter(numberFormat, fromType, false)); } @@ -570,17 +569,17 @@ * @param fromTypes */ private static void addNumberToDoubleConverters(Map map, - NumberFormat numberFormat, TypeInfo[] fromTypes) { + NumberFormat numberFormat, Class[] fromTypes) { for (int i = 0; i < fromTypes.length; i++) { - TypeInfo fromType = fromTypes[i]; - if (fromType != typeid(Double) && fromType != Double.TYPE) { - String fromName = isJavaPrimitive(fromType) ? getKeyForClass( - fromType, null) : .getName(fromType); + Class fromType = fromTypes[i]; + if (fromType != Class.fromType!(Double) && fromType != Double.TYPE) { + String fromName = fromType.isPrimitive() ? getKeyForClass( + fromType, null) : fromType.getName(); map.put(new Pair(fromName, DOUBLE_TYPE), new NumberToDoubleConverter(numberFormat, fromType, true)); - map.put(new Pair(fromName, .getName(Double.classinfo)), + map.put(new Pair(fromName, Class.fromType!(Double).getName()), new NumberToDoubleConverter(numberFormat, fromType, false)); } @@ -596,15 +595,15 @@ * @param fromTypes */ private static void addNumberToBigIntegerConverters(Map map, - NumberFormat numberFormat, TypeInfo[] fromTypes) { + NumberFormat numberFormat, Class[] fromTypes) { for (int i = 0; i < fromTypes.length; i++) { - TypeInfo fromType = fromTypes[i]; - if (!fromType.opEquals(typeid(BigInteger))) { - String fromName = isJavaPrimitive(fromType) ? getKeyForClass( - fromType, null) : .getName(fromType); + Class fromType = fromTypes[i]; + if (!fromType.opEquals(Class.fromType!(BigInteger))) { + String fromName = fromType.isPrimitive() ? getKeyForClass( + fromType, null) : fromType.getName(); map - .put(new Pair(fromName, .getName(BigInteger.classinfo)), + .put(new Pair(fromName, Class.fromType!(BigInteger).getName()), new NumberToBigIntegerConverter(numberFormat, fromType)); } @@ -620,15 +619,15 @@ * @param fromTypes */ private static void addNumberToBigDecimalConverters(Map map, - NumberFormat numberFormat, TypeInfo[] fromTypes) { + NumberFormat numberFormat, Class[] fromTypes) { for (int i = 0; i < fromTypes.length; i++) { - TypeInfo fromType = fromTypes[i]; - if (!fromType.opEquals(typeid(BigDecimal))) { - String fromName = isJavaPrimitive(fromType) ? getKeyForClass( - fromType, null) : .getName(fromType); + Class fromType = fromTypes[i]; + if (!fromType.opEquals(Class.fromType!(BigDecimal))) { + String fromName = fromType.isPrimitive() ? getKeyForClass( + fromType, null) : fromType.getName(); map - .put(new Pair(fromName, .getName(BigDecimal.classinfo)), + .put(new Pair(fromName, Class.fromType!(BigDecimal).getName()), new NumberToBigDecimalConverter(numberFormat, fromType)); } @@ -636,9 +635,9 @@ } private static String getKeyForClass(Object originalValue, - TypeInfo filteredValue) { - if ( null !is cast(TypeInfo)originalValue ) { - TypeInfo originalClass = cast(TypeInfo) originalValue; + Class filteredValue) { + if ( null !is cast(Class)originalValue ) { + Class originalClass = cast(Class) originalValue; if (originalClass == Integer.TYPE) { return INTEGER_TYPE; } else if (originalClass == Byte.TYPE) { @@ -655,7 +654,7 @@ return SHORT_TYPE; } } - return .getName(filteredValue); + return filteredValue.getName(); } /** @@ -669,16 +668,16 @@ * if unknown */ protected Boolean isAssignableFromTo(Object fromType, Object toType) { - if ( null !is cast(TypeInfo)fromType && null !is cast(TypeInfo)toType ) { - TypeInfo toClass = cast(TypeInfo) toType; - if (isJavaPrimitive(toClass)) { + if ( null !is cast(Class)fromType && null !is cast(Class)toType ) { + Class toClass = cast(Class) toType; + if (toClass.isPrimitive()) { toClass = autoboxed(toClass); } - TypeInfo fromClass = cast(TypeInfo) fromType; - if (isJavaPrimitive(fromClass)) { + Class fromClass = cast(Class) fromType; + if (fromClass.isPrimitive()) { fromClass = autoboxed(fromClass); } - return isImplicitly(fromClass, toClass) ? Boolean.TRUE + return toClass.isAssignableFrom(fromClass) ? Boolean.TRUE : Boolean.FALSE; } return null; diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateValueStrategy.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateValueStrategy.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/UpdateValueStrategy.d Sun Apr 19 11:10:09 2009 +0200 @@ -296,41 +296,41 @@ // We only default the validator if we defaulted the converter since the // two are tightly coupled. if (defaultedConverter) { - if (typeid(StringCls) is fromType) { + if (Class.fromType!(StringCls) is fromType) { result = cast(IValidator) validatorsByConverter.get(cast(Object)converter); if (result is null) { // TODO sring based lookup - if (typeid(Integer).opEquals(toType) + if (Class.fromType!(Integer).opEquals(toType) || Integer.TYPE.opEquals(toType)) { result = new StringToIntegerValidator( cast(NumberFormatConverter) converter); - } else if (typeid(Long).opEquals(toType) + } else if (Class.fromType!(Long).opEquals(toType) || Long.TYPE.opEquals(toType)) { result = new StringToLongValidator( cast(NumberFormatConverter) converter); - } else if (typeid(Float).opEquals(toType) + } else if (Class.fromType!(Float).opEquals(toType) || Float.TYPE.opEquals(toType)) { result = new StringToFloatValidator( cast(NumberFormatConverter) converter); - } else if (typeid(Double).opEquals(toType) + } else if (Class.fromType!(Double).opEquals(toType) || Double.TYPE.opEquals(toType)) { result = new StringToDoubleValidator( cast(NumberFormatConverter) converter); - } else if (typeid(Byte).opEquals(toType) + } else if (Class.fromType!(Byte).opEquals(toType) || Byte.TYPE.opEquals(toType)) { result = new StringToByteValidator( cast(NumberFormatConverter) converter); - } else if (typeid(Short).opEquals(toType) + } else if (Class.fromType!(Short).opEquals(toType) || Short.TYPE.opEquals(toType)) { result = new StringToShortValidator( cast(NumberFormatConverter) converter); - } else if (typeid(Character).opEquals(toType) + } else if (Class.fromType!(Character).opEquals(toType) || Character.TYPE.opEquals(toType) && null !is cast(StringToCharacterConverter)converter ) { result = new StringToCharacterValidator( cast(StringToCharacterConverter) converter); - } else if (typeid(Date).opEquals(toType) + } else if (Class.fromType!(Date).opEquals(toType) && null !is cast(StringToDateConverter)converter ) { result = new StringToDateValidator( cast(StringToDateConverter) converter); @@ -516,34 +516,34 @@ private this() { validators = new HashMap(); // Standalone validators here... - associate(typeid(Integer), Integer.TYPE, + associate(Class.fromType!(Integer), Integer.TYPE, new ObjectToPrimitiveValidator(Integer.TYPE)); - associate(typeid(Byte), Byte.TYPE, new ObjectToPrimitiveValidator( + associate(Class.fromType!(Byte), Byte.TYPE, new ObjectToPrimitiveValidator( Byte.TYPE)); - associate(typeid(Short), Short.TYPE, new ObjectToPrimitiveValidator( + associate(Class.fromType!(Short), Short.TYPE, new ObjectToPrimitiveValidator( Short.TYPE)); - associate(typeid(Long), Long.TYPE, new ObjectToPrimitiveValidator( + associate(Class.fromType!(Long), Long.TYPE, new ObjectToPrimitiveValidator( Long.TYPE)); - associate(typeid(Float), Float.TYPE, new ObjectToPrimitiveValidator( + associate(Class.fromType!(Float), Float.TYPE, new ObjectToPrimitiveValidator( Float.TYPE)); - associate(typeid(Double), Double.TYPE, + associate(Class.fromType!(Double), Double.TYPE, new ObjectToPrimitiveValidator(Double.TYPE)); - associate(typeid(Boolean), Boolean.TYPE, + associate(Class.fromType!(Boolean), Boolean.TYPE, new ObjectToPrimitiveValidator(Boolean.TYPE)); - associate(typeid(Object), Integer.TYPE, + associate(Class.fromType!(Object), Integer.TYPE, new ObjectToPrimitiveValidator(Integer.TYPE)); - associate(typeid(Object), Byte.TYPE, new ObjectToPrimitiveValidator( + associate(Class.fromType!(Object), Byte.TYPE, new ObjectToPrimitiveValidator( Byte.TYPE)); - associate(typeid(Object), Short.TYPE, new ObjectToPrimitiveValidator( + associate(Class.fromType!(Object), Short.TYPE, new ObjectToPrimitiveValidator( Short.TYPE)); - associate(typeid(Object), Long.TYPE, new ObjectToPrimitiveValidator( + associate(Class.fromType!(Object), Long.TYPE, new ObjectToPrimitiveValidator( Long.TYPE)); - associate(typeid(Object), Float.TYPE, new ObjectToPrimitiveValidator( + associate(Class.fromType!(Object), Float.TYPE, new ObjectToPrimitiveValidator( Float.TYPE)); - associate(typeid(Object), Double.TYPE, + associate(Class.fromType!(Object), Double.TYPE, new ObjectToPrimitiveValidator(Double.TYPE)); - associate(typeid(Object), Boolean.TYPE, + associate(Class.fromType!(Object), Boolean.TYPE, new ObjectToPrimitiveValidator(Boolean.TYPE)); } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/ValueBinding.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ValueBinding.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ValueBinding.d Sun Apr 19 11:10:09 2009 +0200 @@ -87,7 +87,7 @@ protected void preInit() { validationStatusObservable = new WritableValue(context - .getValidationRealm(), cast(Object) Status.OK_STATUS, typeid(IStatus)); + .getValidationRealm(), cast(Object) Status.OK_STATUS, Class.fromType!(IStatus)); } protected void postInit() { diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/NumberToStringConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/NumberToStringConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/NumberToStringConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -13,7 +13,6 @@ import org.eclipse.core.databinding.conversion.Converter; import java.lang.all; -import java.nonstandard.RuntimeTraits; import java.math.BigInteger; @@ -27,7 +26,7 @@ */ public class NumberToStringConverter : Converter { private final NumberFormat numberFormat; - private final TypeInfo fromType; + private final Class fromType; private bool fromTypeIsLong; private bool fromTypeIsDecimalType; private bool fromTypeIsBigInteger; @@ -41,20 +40,20 @@ * @param numberFormat * @param fromType */ - private this(NumberFormat numberFormat, TypeInfo fromType) { - super(fromType, typeid(StringCls)); + private this(NumberFormat numberFormat, Class fromType) { + super(fromType, Class.fromType!(StringCls)); this.numberFormat = numberFormat; this.fromType = fromType; - if (typeid(Integer) is fromType || Integer.TYPE is fromType - || typeid(Long) is (fromType) || Long.TYPE is (fromType)) { + if (Class.fromType!(Integer) is fromType || Integer.TYPE is fromType + || Class.fromType!(Long) is (fromType) || Long.TYPE is (fromType)) { fromTypeIsLong = true; - } else if (typeid(Float) is (fromType) || Float.TYPE is (fromType) - || typeid(Double) is (fromType) + } else if (Class.fromType!(Float) is (fromType) || Float.TYPE is (fromType) + || Class.fromType!(Double) is (fromType) || Double.TYPE is (fromType)) { fromTypeIsDecimalType = true; - } else if (typeid(BigInteger) is (fromType)) { + } else if (Class.fromType!(BigInteger) is (fromType)) { fromTypeIsBigInteger = true; } } @@ -72,7 +71,7 @@ */ public Object convert(Object fromObject) { // Null is allowed when the type is not primitve. - if (fromObject is null && !isJavaPrimitive(fromType)) { + if (fromObject is null && !fromType.isPrimitive()) { return stringcast(""); //$NON-NLS-1$ } @@ -112,7 +111,7 @@ public static NumberToStringConverter fromDouble(NumberFormat numberFormat, bool primitive) { return new NumberToStringConverter(numberFormat, - (primitive) ? Double.TYPE : typeid(Double)); + (primitive) ? Double.TYPE : Class.fromType!(Double)); } /** @@ -132,7 +131,7 @@ public static NumberToStringConverter fromLong(NumberFormat numberFormat, bool primitive) { return new NumberToStringConverter(numberFormat, - (primitive) ? Long.TYPE : typeid(Long)); + (primitive) ? Long.TYPE : Class.fromType!(Long)); } /** @@ -152,7 +151,7 @@ public static NumberToStringConverter fromFloat(NumberFormat numberFormat, bool primitive) { return new NumberToStringConverter(numberFormat, - (primitive) ? Float.TYPE : typeid(Float)); + (primitive) ? Float.TYPE : Class.fromType!(Float)); } /** @@ -172,7 +171,7 @@ public static NumberToStringConverter fromInteger( NumberFormat numberFormat, bool primitive) { return new NumberToStringConverter(numberFormat, - (primitive) ? Integer.TYPE : typeid(Integer)); + (primitive) ? Integer.TYPE : Class.fromType!(Integer)); } /** @@ -188,6 +187,6 @@ */ public static NumberToStringConverter fromBigInteger( NumberFormat numberFormat) { - return new NumberToStringConverter(numberFormat, typeid(BigInteger)); + return new NumberToStringConverter(numberFormat, Class.fromType!(BigInteger)); } } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/StringToNumberConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/StringToNumberConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/conversion/StringToNumberConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -12,7 +12,6 @@ module org.eclipse.core.databinding.conversion.StringToNumberConverter; import java.lang.all; -import java.nonstandard.RuntimeTraits; import java.math.BigDecimal; import java.math.BigInteger; @@ -29,7 +28,7 @@ * @since 1.0 */ public class StringToNumberConverter : NumberFormatConverter { - private TypeInfo toType; + private Class toType; /** * NumberFormat instance to use for conversion. Access must be synchronized. */ @@ -49,7 +48,7 @@ /** * The boxed type of the toType; */ - private final TypeInfo boxedType; + private final Class boxedType; private static const Integer MIN_INTEGER; private static const Integer MAX_INTEGER; @@ -90,9 +89,9 @@ * a convenience that allows for the checking against one type * rather than boxed and unboxed types */ - private this(NumberFormat numberFormat, TypeInfo toType, - Number min, Number max, TypeInfo boxedType) { - super(typeid(StringCls), toType, numberFormat); + private this(NumberFormat numberFormat, Class toType, + Number min, Number max, Class boxedType) { + super(Class.fromType!(StringCls), toType, numberFormat); this.toType = toType; this.numberFormat = numberFormat; @@ -115,7 +114,7 @@ */ public Object convert(Object fromObject) { StringToNumberParser.ParseResult result = StringToNumberParser.parse(fromObject, - numberFormat, isJavaPrimitive(toType)); + numberFormat, toType.isPrimitive()); if (result.getPosition() !is null) { // this shouldn't happen in the pipeline as validation should catch @@ -135,23 +134,23 @@ * validator should have validated this already but we shouldn't assume * this has occurred. */ - if (typeid(Integer) is (boxedType)) { + if (Class.fromType!(Integer) is boxedType) { if (StringToNumberParser.inIntegerRange(result.getNumber())) { return new Integer(result.getNumber().intValue()); } - } else if (typeid(Double) is (boxedType)) { + } else if (Class.fromType!(Double) is boxedType) { if (StringToNumberParser.inDoubleRange(result.getNumber())) { return new Double(result.getNumber().doubleValue()); } - } else if (typeid(Long) is (boxedType)) { + } else if (Class.fromType!(Long) is boxedType) { if (StringToNumberParser.inLongRange(result.getNumber())) { return new Long(result.getNumber().longValue()); } - } else if (typeid(Float) is (boxedType)) { + } else if (Class.fromType!(Float) is boxedType) { if (StringToNumberParser.inFloatRange(result.getNumber())) { return new Float(result.getNumber().floatValue()); } - } else if (typeid(BigInteger) is (boxedType)) { + } else if (Class.fromType!(BigInteger) is boxedType) { return (new BigDecimal(result.getNumber().doubleValue())) .toBigInteger(); } @@ -186,8 +185,8 @@ public static StringToNumberConverter toInteger(NumberFormat numberFormat, bool primitive) { return new StringToNumberConverter(numberFormat, - (primitive) ? Integer.TYPE : typeid(Integer), MIN_INTEGER, - MAX_INTEGER, typeid(Integer)); + (primitive) ? Integer.TYPE : Class.fromType!(Integer), MIN_INTEGER, + MAX_INTEGER, Class.fromType!(Integer)); } /** @@ -207,8 +206,8 @@ public static StringToNumberConverter toDouble(NumberFormat numberFormat, bool primitive) { return new StringToNumberConverter(numberFormat, - (primitive) ? Double.TYPE : typeid(Double), MIN_DOUBLE, - MAX_DOUBLE, typeid(Double)); + (primitive) ? Double.TYPE : Class.fromType!(Double), MIN_DOUBLE, + MAX_DOUBLE, Class.fromType!(Double)); } /** @@ -228,8 +227,8 @@ public static StringToNumberConverter toLong(NumberFormat numberFormat, bool primitive) { return new StringToNumberConverter(numberFormat, - (primitive) ? Long.TYPE : typeid(Long), MIN_LONG, MAX_LONG, - typeid(Long)); + (primitive) ? Long.TYPE : Class.fromType!(Long), MIN_LONG, MAX_LONG, + Class.fromType!(Long)); } /** @@ -249,8 +248,8 @@ public static StringToNumberConverter toFloat(NumberFormat numberFormat, bool primitive) { return new StringToNumberConverter(numberFormat, - (primitive) ? Float.TYPE : typeid(Float), MIN_FLOAT, MAX_FLOAT, - typeid(Float)); + (primitive) ? Float.TYPE : Class.fromType!(Float), MIN_FLOAT, MAX_FLOAT, + Class.fromType!(Float)); } /** @@ -265,7 +264,7 @@ * @return to BigInteger converter with the provided numberFormat */ public static StringToNumberConverter toBigInteger(NumberFormat numberFormat) { - return new StringToNumberConverter(numberFormat, typeid(BigInteger), - null, null, typeid(BigInteger)); + return new StringToNumberConverter(numberFormat, Class.fromType!(BigInteger), + null, null, Class.fromType!(BigInteger)); } } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Observables.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Observables.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Observables.d Sun Apr 19 11:10:09 2009 +0200 @@ -278,7 +278,7 @@ * @return an observable set backed by the given set */ public static IObservableSet staticObservableSet(Set set) { - return staticObservableSet(Realm.getDefault(), set, typeid(Object)); + return staticObservableSet(Realm.getDefault(), set, Class.fromType!(Object)); } /** @@ -307,7 +307,7 @@ * @return an observable set backed by the given unchanging set */ public static IObservableSet staticObservableSet(Realm realm, Set set) { - return staticObservableSet(realm, set, typeid(Object)); + return staticObservableSet(realm, set, Class.fromType!(Object)); } /** @@ -373,7 +373,7 @@ * @return an observable list backed by the given unchanging list */ public static IObservableList staticObservableList(List list) { - return staticObservableList(Realm.getDefault(), list, typeid(Object)); + return staticObservableList(Realm.getDefault(), list, Class.fromType!(Object)); } /** @@ -403,7 +403,7 @@ * @return an observable list backed by the given unchanging list */ public static IObservableList staticObservableList(Realm realm, List list) { - return staticObservableList(realm, list, typeid(Object)); + return staticObservableList(realm, list, Class.fromType!(Object)); } /** diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListDiff.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListDiff.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListDiff.d Sun Apr 19 11:10:09 2009 +0200 @@ -15,7 +15,6 @@ import org.eclipse.core.databinding.observable.list.ListDiffVisitor; import java.lang.all; -import java.nonstandard.RuntimeTraits; import org.eclipse.core.internal.databinding.Util; @@ -94,7 +93,7 @@ public String toString() { ListDiffEntry[] differences = getDifferences(); StringBuffer buffer = new StringBuffer(); - buffer.append(.getName( this.classinfo )); + buffer.append(Class.fromObject(this).getName()); if (differences is null || differences.length is 0) { buffer diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/MappedSet.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/MappedSet.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/MappedSet.d Sun Apr 19 11:10:09 2009 +0200 @@ -119,7 +119,7 @@ valueCounts = new HashMap(); domainListener = new DomainListener(); mapChangeListener = new MapChangeListener(); - super(input.getRealm(), Collections.EMPTY_SET, typeid(Object)); + super(input.getRealm(), Collections.EMPTY_SET, Class.fromType!(Object)); setWrappedSet(valueCounts.keySet()); this.wrappedMap = map; this.input = input; diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/SetDiff.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/SetDiff.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/set/SetDiff.d Sun Apr 19 11:10:09 2009 +0200 @@ -12,7 +12,6 @@ module org.eclipse.core.databinding.observable.set.SetDiff; import java.lang.all; -import java.nonstandard.RuntimeTraits; import java.util.Set; @@ -38,7 +37,7 @@ public String toString() { StringBuffer buffer = new StringBuffer(); buffer - .append(.getName(this.classinfo)) + .append(Class.fromObject(this).getName()) .append("{additions [") //$NON-NLS-1$ .append(getAdditions() !is null ? getAdditions().toString() : "null") //$NON-NLS-1$ .append("], removals [") //$NON-NLS-1$ diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueDiff.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueDiff.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/value/ValueDiff.d Sun Apr 19 11:10:09 2009 +0200 @@ -12,7 +12,6 @@ module org.eclipse.core.databinding.observable.value.ValueDiff; import java.lang.all; -import java.nonstandard.RuntimeTraits; import org.eclipse.core.databinding.observable.Diffs; @@ -64,7 +63,7 @@ public String toString() { StringBuffer buffer = new StringBuffer(); buffer - .append(.getName(this.classinfo)) + .append(Class.fromObject(this).getName()) .append("{oldValue [") //$NON-NLS-1$ .append(getOldValue() !is null ? getOldValue().toString() : "null") //$NON-NLS-1$ .append("], newValue [") //$NON-NLS-1$ diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/MultiValidator.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/MultiValidator.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/validation/MultiValidator.d Sun Apr 19 11:10:09 2009 +0200 @@ -168,9 +168,9 @@ this.realm = realm; validationStatus = new WritableValue(realm, cast(Object)ValidationStatus.ok(), - typeid(IStatus)); + Class.fromType!(IStatus)); - targets = new WritableList(realm, new ArrayList(), typeid(IObservable)); + targets = new WritableList(realm, new ArrayList(), Class.fromType!(IObservable)); targets.addListChangeListener(targetsListener); unmodifiableTargets = Observables.unmodifiableObservableList(targets); diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/ClassLookupSupport.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/ClassLookupSupport.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/ClassLookupSupport.d Sun Apr 19 11:10:09 2009 +0200 @@ -12,7 +12,6 @@ module org.eclipse.core.internal.databinding.ClassLookupSupport; import java.lang.all; -import java.nonstandard.RuntimeTraits; import java.util.ArrayList; import java.util.Collection; @@ -38,7 +37,7 @@ * @param type * @return an array containing the given type and all its direct and indirect supertypes */ - public static TypeInfo[] getTypeHierarchyFlattened(TypeInfo type) { + public static Class[] getTypeHierarchyFlattened(Class type) { List classes = null; //cache reference to lookup to protect against concurrent flush HashMap lookup = classSearchOrderLookup; @@ -52,7 +51,7 @@ classSearchOrderLookup = lookup = new HashMap(); lookup.put(type, cast(Object)classes); } - return cast(TypeInfo[]) classes.toArray(new TypeInfo[classes.size()]); + return cast(Class[]) classes.toArray(new Class[classes.size()]); } /** @@ -65,20 +64,20 @@ * Note that it is important to maintain a consistent class and interface * lookup order. See the class comment for more details. */ - private static void computeClassOrder(TypeInfo adaptable, Collection classes) { - TypeInfo clazz = adaptable; + private static void computeClassOrder(Class adaptable, Collection classes) { + Class clazz = adaptable; Set seen = new HashSet(4); while (clazz !is null) { classes.add(clazz); - computeInterfaceOrder(getInterfaces(clazz), classes, seen); - clazz = isInterface(clazz) ? typeid(Object) : getSuperclass(clazz); + computeInterfaceOrder(clazz.getInterfaces(), classes, seen); + clazz = clazz.isInterface() ? Class.fromType!(Object) : clazz.getSuperclass(); } } - private static void computeInterfaceOrder(TypeInfo[] interfaces, Collection classes, Set seen) { + private static void computeInterfaceOrder(Class[] interfaces, Collection classes, Set seen) { List newInterfaces = new ArrayList(interfaces.length); for (int i = 0; i < interfaces.length; i++) { - TypeInfo interfac = interfaces[i]; + Class interfac = interfaces[i]; if (seen.add(interfac)) { //note we cannot recurse here without changing the resulting interface order classes.add(interfac); @@ -86,7 +85,7 @@ } } for (Iterator it = newInterfaces.iterator(); it.hasNext();) - computeInterfaceOrder(getInterfaces(cast(TypeInfo) it.next()), classes, seen); + computeInterfaceOrder((cast(Class) it.next()).getInterfaces(), classes, seen); } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/CharacterToStringConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/CharacterToStringConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/CharacterToStringConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -25,7 +25,7 @@ * @param primitive */ private this(bool primitive) { - super(primitive ? Character.TYPE : typeid(Character), typeid(StringCls)); + super(primitive ? Character.TYPE : Class.fromType!(Character), Class.fromType!(StringCls)); this.primitive = primitive; } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/DateToStringConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/DateToStringConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/DateToStringConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -33,10 +33,10 @@ } public Object getFromType() { - return typeid(Date); + return Class.fromType!(Date); } public Object getToType() { - return typeid(StringCls); + return Class.fromType!(StringCls); } } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IdentityConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IdentityConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IdentityConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -13,7 +13,6 @@ module org.eclipse.core.internal.databinding.conversion.IdentityConverter; import java.lang.all; -import java.nonstandard.RuntimeTraits; import org.eclipse.core.databinding.BindingException; import org.eclipse.core.databinding.conversion.IConverter; @@ -23,14 +22,14 @@ */ public class IdentityConverter : IConverter { - private TypeInfo fromType; + private Class fromType; - private TypeInfo toType; + private Class toType; /** * @param type */ - public this(TypeInfo type) { + public this(Class type) { this.fromType = type; this.toType = type; initPrimitiveMap(); @@ -40,21 +39,21 @@ * @param fromType * @param toType */ - public this(TypeInfo fromType, TypeInfo toType) { + public this(Class fromType, Class toType) { this.fromType = fromType; this.toType = toType; initPrimitiveMap(); } - private TypeInfo[][] primitiveMap; + private Class[][] primitiveMap; private void initPrimitiveMap(){ primitiveMap = [ - [ cast(TypeInfo)Integer.TYPE, typeid(Integer) ], [ cast(TypeInfo)Short.TYPE, typeid(Short) ], - [ cast(TypeInfo)Long.TYPE, typeid(Long) ], [ cast(TypeInfo)Double.TYPE, typeid(Double) ], - [ cast(TypeInfo)Byte.TYPE, typeid(Byte) ], [ cast(TypeInfo)Float.TYPE, typeid(Float) ], - [ cast(TypeInfo)Boolean.TYPE, typeid(Boolean) ], - [ cast(TypeInfo)Character.TYPE, typeid(Character) ] ]; + [ cast(Class)Integer.TYPE, Class.fromType!(Integer) ], [ cast(Class)Short.TYPE, Class.fromType!(Short) ], + [ cast(Class)Long.TYPE, Class.fromType!(Long) ], [ cast(Class)Double.TYPE, Class.fromType!(Double) ], + [ cast(Class)Byte.TYPE, Class.fromType!(Byte) ], [ cast(Class)Float.TYPE, Class.fromType!(Float) ], + [ cast(Class)Boolean.TYPE, Class.fromType!(Boolean) ], + [ cast(Class)Character.TYPE, Class.fromType!(Character) ] ]; } /* @@ -63,14 +62,14 @@ * @see org.eclipse.jface.binding.converter.IConverter#convert(java.lang.Object) */ public Object convert(Object source) { - if ( isJavaPrimitive(toType)) { + if ( toType.isPrimitive()) { if (source is null) { throw new BindingException("Cannot convert null to a primitive"); //$NON-NLS-1$ } } if (source !is null) { - TypeInfo sourceClass = getTypeInfo(source.classinfo); - if (isJavaPrimitive(toType) || isJavaPrimitive(sourceClass)) { + Class sourceClass = Class.fromObject(source); + if (toType.isPrimitive() || sourceClass.isPrimitive()) { if (sourceClass.opEquals(toType) || isPrimitiveTypeMatchedWithBoxed(sourceClass, toType)) { return source; @@ -78,9 +77,9 @@ throw new BindingException( "Boxed and unboxed types do not match"); //$NON-NLS-1$ } - if (!isImplicitly(sourceClass, toType)) { - throw new BindingException(asClass(sourceClass).name - ~ " is not assignable to " ~ asClass(toType).name); //$NON-NLS-1$ + if (!toType.isAssignableFrom(sourceClass)) { + throw new BindingException(Class.fromObject(sourceClass).getName() + ~ " is not assignable to " ~ Class.fromObject(toType).getName()); //$NON-NLS-1$ } } return source; @@ -93,8 +92,8 @@ * @param toClass * @return true if sourceClass and toType are matched primitive/boxed types */ - public bool isPrimitiveTypeMatchedWithBoxed(TypeInfo sourceClass, - TypeInfo toClass) { + public bool isPrimitiveTypeMatchedWithBoxed(Class sourceClass, + Class toClass) { for (int i = 0; i < primitiveMap.length; i++) { if (toClass.opEquals(primitiveMap[i][0]) && sourceClass.opEquals(primitiveMap[i][1])) { diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IntegerToStringConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IntegerToStringConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/IntegerToStringConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -12,7 +12,6 @@ module org.eclipse.core.internal.databinding.conversion.IntegerToStringConverter; import java.lang.all; -import java.nonstandard.RuntimeTraits; import org.eclipse.core.databinding.conversion.Converter; @@ -31,17 +30,17 @@ public class IntegerToStringConverter : Converter { private final bool primitive; private final NumberFormat numberFormat; - private final TypeInfo boxedType; + private final Class boxedType; /** * @param numberFormat * @param fromType * @param boxedType */ - private this(NumberFormat numberFormat, TypeInfo fromType, - TypeInfo boxedType) { - super(fromType, typeid(StringCls)); - this.primitive = isJavaPrimitive(fromType); + private this(NumberFormat numberFormat, Class fromType, + Class boxedType) { + super(fromType, Class.fromType!(StringCls)); + this.primitive = fromType.isPrimitive(); this.numberFormat = numberFormat; this.boxedType = boxedType; } @@ -57,7 +56,8 @@ return stringcast(""); //$NON-NLS-1$ } - if (!isImplicitly(fromObject.classinfo, boxedType.classinfo)) { + //FIXME check with org + if (!Class.fromObject(boxedType).isAssignableFrom(Class.fromObject(fromObject))) { throw new IllegalArgumentException( Format("'fromObject' is not of type [{}].", boxedType)); //$NON-NLS-1$//$NON-NLS-2$ } @@ -81,7 +81,7 @@ public static IntegerToStringConverter fromShort(NumberFormat numberFormat, bool primitive) { return new IntegerToStringConverter(numberFormat, - primitive ? Short.TYPE : typeid(Short), typeid(Short)); + primitive ? Short.TYPE : Class.fromType!(Short), Class.fromType!(Short)); } /** @@ -100,6 +100,6 @@ public static IntegerToStringConverter fromByte(NumberFormat numberFormat, bool primitive) { return new IntegerToStringConverter(numberFormat, primitive ? Byte.TYPE - : typeid(Byte), typeid(Byte)); + : Class.fromType!(Byte), Class.fromType!(Byte)); } } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigDecimalConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigDecimalConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigDecimalConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -32,8 +32,8 @@ * @param numberFormat * @param fromType */ - public this(NumberFormat numberFormat, TypeInfo fromType) { - super(numberFormat, fromType, typeid(BigDecimal)); + public this(NumberFormat numberFormat, Class fromType) { + super(numberFormat, fromType, Class.fromType!(BigDecimal)); } /* (non-Javadoc) diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigIntegerConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigIntegerConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToBigIntegerConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -32,8 +32,8 @@ * @param numberFormat * @param fromType */ - public this(NumberFormat numberFormat, TypeInfo fromType) { - super(numberFormat, fromType, typeid(BigInteger)); + public this(NumberFormat numberFormat, Class fromType) { + super(numberFormat, fromType, Class.fromType!(BigInteger)); } /* (non-Javadoc) diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToByteConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToByteConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToByteConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -31,9 +31,9 @@ * @param fromType * @param primitive */ - public this(NumberFormat numberFormat, TypeInfo fromType, + public this(NumberFormat numberFormat, Class fromType, bool primitive) { - super(numberFormat, fromType, (primitive) ? Byte.TYPE : typeid(Byte)); + super(numberFormat, fromType, (primitive) ? Byte.TYPE : Class.fromType!(Byte)); } /* (non-Javadoc) diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToDoubleConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToDoubleConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToDoubleConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -32,9 +32,9 @@ * @param fromType * @param primitive */ - public this(NumberFormat numberFormat, TypeInfo fromType, + public this(NumberFormat numberFormat, Class fromType, bool primitive) { - super(numberFormat, fromType, (primitive) ? Double.TYPE : typeid(Double)); + super(numberFormat, fromType, (primitive) ? Double.TYPE : Class.fromType!(Double)); } /* (non-Javadoc) diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToFloatConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToFloatConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToFloatConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -30,9 +30,9 @@ * @param fromType * @param primitive */ - public this(NumberFormat numberFormat, TypeInfo fromType, + public this(NumberFormat numberFormat, Class fromType, bool primitive) { - super(numberFormat, fromType, (primitive) ? Float.TYPE : typeid(Float)); + super(numberFormat, fromType, (primitive) ? Float.TYPE : Class.fromType!(Float)); } /* (non-Javadoc) diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToIntegerConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToIntegerConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToIntegerConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -44,8 +44,8 @@ * @param primitive */ public this(NumberFormat numberFormat, - TypeInfo fromType, bool primitive) { - super(numberFormat, fromType, (primitive) ? Integer.TYPE : typeid(Integer)); + Class fromType, bool primitive) { + super(numberFormat, fromType, (primitive) ? Integer.TYPE : Class.fromType!(Integer)); } /* (non-Javadoc) diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToLongConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToLongConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToLongConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -30,9 +30,9 @@ * @param fromType * @param primitive */ - public this(NumberFormat numberFormat, TypeInfo fromType, + public this(NumberFormat numberFormat, Class fromType, bool primitive) { - super(numberFormat, fromType, (primitive) ? Long.TYPE : typeid(Long)); + super(numberFormat, fromType, (primitive) ? Long.TYPE : Class.fromType!(Long)); } /* (non-Javadoc) diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToNumberConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToNumberConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToNumberConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -13,7 +13,6 @@ import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; import java.lang.all; -import java.nonstandard.RuntimeTraits; import org.eclipse.core.databinding.conversion.Converter; @@ -35,10 +34,10 @@ private String outOfRangeMessage; protected this(NumberFormat numberFormat, - TypeInfo fromType, TypeInfo toType) { + Class fromType, Class toType) { super(fromType, toType); this.numberFormat = numberFormat; - this.primitive = isJavaPrimitive(toType); + this.primitive = toType.isPrimitive(); } /* diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToShortConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToShortConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/NumberToShortConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -30,10 +30,10 @@ * @param fromType * @param primitive */ - public this(NumberFormat numberFormat, TypeInfo fromType, + public this(NumberFormat numberFormat, Class fromType, bool primitive) { - super(numberFormat, fromType, (primitive) ? Short.TYPE : typeid(Short)); + super(numberFormat, fromType, (primitive) ? Short.TYPE : Class.fromType!(Short)); } /* diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/ObjectToStringConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/ObjectToStringConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/ObjectToStringConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -19,19 +19,19 @@ * Converts any object to a string by calling its toString() method. */ public class ObjectToStringConverter : IConverter { - private final TypeInfo fromClass; + private final Class fromClass; /** * */ public this() { - this(typeid(Object)); + this(Class.fromType!(Object)); } /** * @param fromClass */ - public this(TypeInfo fromClass) { + public this(Class fromClass) { this.fromClass = fromClass; } @@ -52,7 +52,7 @@ } public Object getToType() { - return typeid(StringCls); + return Class.fromType!(StringCls); } } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StatusToStringConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StatusToStringConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StatusToStringConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -33,7 +33,7 @@ * Constructs a new instance. */ public this() { - super(typeid(IStatus), typeid(StringCls)); + super(Class.fromType!(IStatus), Class.fromType!(StringCls)); } /* (non-Javadoc) diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -33,7 +33,7 @@ } public Object getToType() { - return typeid(Boolean); + return Class.fromType!(Boolean); } } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanPrimitiveConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanPrimitiveConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToBooleanPrimitiveConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -80,7 +80,7 @@ } public Object getFromType() { - return typeid(StringCls); + return Class.fromType!(StringCls); } public Object getToType() { diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToByteConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToByteConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToByteConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -13,7 +13,6 @@ import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; import java.lang.all; -import java.nonstandard.RuntimeTraits; import org.eclipse.core.internal.databinding.validation.NumberFormatConverter; @@ -31,9 +30,9 @@ * @param numberFormat * @param toType */ - private this(NumberFormat numberFormat, TypeInfo toType) { - super(typeid(StringCls), toType, numberFormat); - primitive = isJavaPrimitive(cast(TypeInfo)toType); + private this(NumberFormat numberFormat, Class toType) { + super(Class.fromType!(StringCls), toType, numberFormat); + primitive = toType.isPrimitive(); this.numberFormat = numberFormat; } @@ -44,7 +43,7 @@ */ public static StringToByteConverter toByte(NumberFormat numberFormat, bool primitive) { - return new StringToByteConverter(numberFormat, (primitive) ? Byte.TYPE : typeid(Byte)); + return new StringToByteConverter(numberFormat, (primitive) ? Byte.TYPE : Class.fromType!(Byte)); } /** diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToCharacterConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToCharacterConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToCharacterConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -65,11 +65,11 @@ } public Object getFromType() { - return typeid(StringCls); + return Class.fromType!(StringCls); } public Object getToType() { - return primitiveTarget ? Character.TYPE : typeid(Character); + return primitiveTarget ? Character.TYPE : Class.fromType!(Character); } /** diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToDateConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToDateConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToDateConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -30,10 +30,10 @@ } public Object getFromType() { - return typeid(StringCls); + return Class.fromType!(StringCls); } public Object getToType() { - return typeid(Date); + return Class.fromType!(Date); } } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToShortConverter.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToShortConverter.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/conversion/StringToShortConverter.d Sun Apr 19 11:10:09 2009 +0200 @@ -13,7 +13,6 @@ import org.eclipse.core.internal.databinding.conversion.StringToNumberParser; import java.lang.all; -import java.nonstandard.RuntimeTraits; import org.eclipse.core.internal.databinding.validation.NumberFormatConverter; @@ -31,10 +30,10 @@ /** * Constructs a new instance. */ - private this(NumberFormat numberFormat, TypeInfo toType) { - super(typeid(String), toType, numberFormat); + private this(NumberFormat numberFormat, Class toType) { + super(Class.fromType!(String), toType, numberFormat); this.numberFormat = numberFormat; - primitive = isJavaPrimitive(toType); + primitive = toType.isPrimitive(); } /* @@ -90,6 +89,6 @@ public static StringToShortConverter toShort(NumberFormat numberFormat, bool primitive) { return new StringToShortConverter(numberFormat, - (primitive) ? Short.TYPE : typeid(Short)); + (primitive) ? Short.TYPE : Class.fromType!(Short)); } } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/AbstractStringToNumberValidator.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/AbstractStringToNumberValidator.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/AbstractStringToNumberValidator.d Sun Apr 19 11:10:09 2009 +0200 @@ -13,7 +13,6 @@ import org.eclipse.core.internal.databinding.validation.NumberFormatConverter; import java.lang.all; -import java.nonstandard.RuntimeTraits; import org.eclipse.core.databinding.validation.IValidator; import org.eclipse.core.databinding.validation.ValidationStatus; @@ -49,9 +48,9 @@ this.min = min; this.max = max; - if (null !is cast(TypeInfo)converter.getToType()) { - TypeInfo clazz = cast(TypeInfo) converter.getToType(); - toPrimitive = isJavaPrimitive(clazz); + if (null !is cast(Class)converter.getToType()) { + Class clazz = cast(Class) converter.getToType(); + toPrimitive = clazz.isPrimitive(); } else { toPrimitive = false; } diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToNumberValidator.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToNumberValidator.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/NumberToNumberValidator.d Sun Apr 19 11:10:09 2009 +0200 @@ -12,7 +12,6 @@ module org.eclipse.core.internal.databinding.validation.NumberToNumberValidator; import java.lang.all; -import java.nonstandard.RuntimeTraits; import org.eclipse.core.databinding.validation.IValidator; import org.eclipse.core.databinding.validation.ValidationStatus; @@ -53,7 +52,7 @@ this.min = min; this.max = max; - primitive = isJavaPrimitive(cast(TypeInfo)converter.getToType()); + primitive = (cast(Class)converter.getToType()).isPrimitive(); } /* diff -r 8594250b1d1c -r 9e0ab372d5d8 org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/ObjectToPrimitiveValidator.d --- a/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/ObjectToPrimitiveValidator.d Sat Apr 18 14:20:15 2009 +0200 +++ b/org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/validation/ObjectToPrimitiveValidator.d Sun Apr 19 11:10:09 2009 +0200 @@ -13,7 +13,6 @@ module org.eclipse.core.internal.databinding.validation.ObjectToPrimitiveValidator; import java.lang.all; -import java.nonstandard.RuntimeTraits; import org.eclipse.core.databinding.validation.IValidator; import org.eclipse.core.databinding.validation.ValidationStatus; @@ -27,26 +26,26 @@ */ public class ObjectToPrimitiveValidator : IValidator { - private TypeInfo toType; + private Class toType; - private static TypeInfo[][] primitiveMap; + private static Class[][] primitiveMap; static this(){ primitiveMap = [ - [ Integer.TYPE, typeid(Integer) ], [ Short.TYPE, typeid(Short) ], - [ Long.TYPE, typeid(Long) ], [ Double.TYPE, typeid(Double) ], - [ Byte.TYPE, typeid(Byte) ], [ Float.TYPE, typeid(Float) ], - [ Boolean.TYPE, typeid(Boolean) ], - [ Character.TYPE, typeid(Character) ] ]; + [ Integer.TYPE, Class.fromType!(Integer) ], [ Short.TYPE, Class.fromType!(Short) ], + [ Long.TYPE, Class.fromType!(Long) ], [ Double.TYPE, Class.fromType!(Double) ], + [ Byte.TYPE, Class.fromType!(Byte) ], [ Float.TYPE, Class.fromType!(Float) ], + [ Boolean.TYPE, Class.fromType!(Boolean) ], + [ Character.TYPE, Class.fromType!(Character) ] ]; } /** * @param toType */ - public this(TypeInfo toType) { + public this(Class toType) { this.toType = toType; } - protected TypeInfo getToType() { + protected Class getToType() { return this.toType; } @@ -56,7 +55,7 @@ private IStatus doValidate(Object value) { if (value !is null) { - if (!mapContainsValues(toType, getTypeInfo(value.classinfo))) { + if (!mapContainsValues(toType, Class.fromObject(value))) { return ValidationStatus.error(getClassHint()); } return Status.OK_STATUS; @@ -64,7 +63,7 @@ return ValidationStatus.error(getNullHint()); } - private bool mapContainsValues(TypeInfo toType, TypeInfo fromType) { + private bool mapContainsValues(Class toType, Class fromType) { for (int i = 0; i < primitiveMap.length; i++) { if ((primitiveMap[i][0] == toType ) && (primitiveMap[i][1] == fromType )) {