Author: miguel
Date: 2006-11-28 17:43:45 -0500 (Tue, 28 Nov 2006)
New Revision: 68623

Modified:
   
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ObjectType.vb
Log:
A few changes to improve Moma reports

Modified: 
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ObjectType.vb
===================================================================
--- 
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ObjectType.vb
       2006-11-28 22:31:11 UTC (rev 68622)
+++ 
trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ObjectType.vb
       2006-11-28 22:43:45 UTC (rev 68623)
@@ -116,8 +116,6 @@
         End Function
 
 
-
-
         Public Shared Function ObjTst(ByVal o1 As System.Object, ByVal o2 As 
System.Object, ByVal TextCompare As System.Boolean) As System.Int32
 
             Dim b1 As Byte
@@ -285,10 +283,19 @@
                 Return bool1.CompareTo(bool2)
 
             Else ' Not implemented case
-                Throw New NotImplementedException("Implement me: " + 
o1.GetType.Name + " " + o2.GetType.Name)
+                Throw GetCaseNotImplemented()
             End If
 
         End Function
+
+       Public Shared Function GetCaseNotImplemented() as System.Exception
+           return new NotImplementedException("This case is not handled")
+       End Function 
+
+       Public Shared Function GetCaseNotImplemented(ByVal msg As 
System.String) as System.Exception
+           return new NotImplementedException(msg)
+       End Function 
+ 
         Public Shared Function PlusObj(ByVal obj As System.Object) As 
System.Object
             Throw New NotImplementedException
         End Function
@@ -319,7 +326,7 @@
                     Dim dbl1 As Double = Convert.ToDouble(obj)
                     Return (Convert.ToString(-1 * DoubleType.FromObject(obj)))
                 Case Else
-                    Throw New InvalidCastException
+                    Throw GetCaseNotImplemented()
             End Select
 
         End Function
@@ -819,7 +826,7 @@
 
                 Return dbl1 + dbl2
             Else ' Not implemented case
-                Throw New NotImplementedException("Implement me: " + 
o1.GetType.Name + " " + o2.GetType.Name)
+                Throw GetCaseNotImplemented("Implement me: " + o1.GetType.Name 
+ " " + o2.GetType.Name)
             End If
         End Function
 
@@ -926,7 +933,7 @@
 
                 Return dbl1 - dbl2
             Else ' Not implemented case
-                Throw New NotImplementedException("Implement me: " + 
o1.GetType.Name + " " + o2.GetType.Name)
+                Throw GetCaseNotImplemented("Implement me: " + o1.GetType.Name 
+ " " + o2.GetType.Name)
             End If
         End Function
 
@@ -1036,7 +1043,7 @@
                 Return dbl1 * dbl2
 
             Else ' Not implemented case
-                Throw New NotImplementedException("Implement me: " + 
o1.GetType.Name + " " + o2.GetType.Name)
+                Throw GetCaseNotImplemented("Implement me: " + o1.GetType.Name 
+ " " + o2.GetType.Name)
             End If
         End Function
 
@@ -1079,7 +1086,7 @@
             If (o1 Is Nothing) Then
                 o1 = CreateNullObjectType(o2)
                 ' divide of zero and x is infinite
-                Throw New NotImplementedException("implement me")
+                Throw GetCaseNotImplemented("implement me")
             End If
             If (o2 Is Nothing) Then
                 o2 = CreateNullObjectType(o1)
@@ -1146,7 +1153,7 @@
                 Return dbl1 / dbl2
 
             Else ' Not implemented case
-                Throw New NotImplementedException("Implement me: " + 
o1.GetType.Name + " " + o2.GetType.Name)
+                Throw GetCaseNotImplemented("Implement me: " + o1.GetType.Name 
+ " " + o2.GetType.Name)
             End If
         End Function
 
@@ -1235,7 +1242,7 @@
             ElseIf TypeOf otype Is Date Then
                 Return Nothing
             Else
-                Throw New NotImplementedException("Implement me: " + 
otype.GetType.Name)
+                Throw GetCaseNotImplemented("Implement me: " + 
otype.GetType.Name)
             End If
 
         End Function

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to