diff java/src/java/lang/Byte.d @ 21:9b96950f2c3c

the 'java' tree compiles on both D1-Tango and D2-Phobos
author Frank Benoit <benoit@tionex.de>
date Thu, 19 Mar 2009 20:38:55 +0100
parents 712ffca654f3
children
line wrap: on
line diff
--- a/java/src/java/lang/Byte.d	Wed Mar 18 12:10:17 2009 +0100
+++ b/java/src/java/lang/Byte.d	Thu Mar 19 20:38:55 2009 +0100
@@ -3,17 +3,26 @@
 import java.lang.util;
 import java.lang.exceptions;
 
+version(Tango){
+    static import tango.text.convert.Integer;
+} else { // Phobos
+}
 class Byte : ValueWrapperT!(byte) {
     public static byte parseByte( String s ){
-        try{
-            int res = tango.text.convert.Integer.parse( s );
-            if( res < byte.min || res > byte.max ){
-                throw new NumberFormatException( "out of range" );
+        version(Tango){
+            try{
+                int res = tango.text.convert.Integer.parse( s );
+                if( res < byte.min || res > byte.max ){
+                    throw new NumberFormatException( "out of range" );
+                }
+                return res;
             }
-            return res;
-        }
-        catch( IllegalArgumentException e ){
-            throw new NumberFormatException( e );
+            catch( IllegalArgumentException e ){
+                throw new NumberFormatException( e );
+            }
+        } else { // Phobos
+            implMissing( __FILE__, __LINE__);
+            return 0;
         }
     }
     this( byte value ){
@@ -21,7 +30,7 @@
     }
 
     public static String toString( byte i ){
-        return tango.text.convert.Integer.toString(i);
+        return String_valueOf(i);
     }
 
 }