Nice/stdlib/nice/lang/inline Assert.java,1.9,1.10

Artem Gr Kozarezov <[email protected]> Mon, 11 Apr 2005 13:56:15 +0000
Newsgroups gmane.comp.lang.nice.cvs
Message-ID <[email protected]>
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31056/stdlib/nice/lang/inline

Modified Files:
	Assert.java 
Log Message:
Made assertions Object message to be JDK1.3 compatible.

Index: Assert.java
===================================================================
RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/Assert.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Assert.java	9 Apr 2005 20:59:12 -0000	1.9
--- Assert.java	11 Apr 2005 13:56:13 -0000	1.10
***************
*** 82,88 ****
        {
  	args[1].compile(comp, Target.pushObject);
!         Method init = args[1].getType().getName().equals(Type.string_type.getName())
!           ? errorInitString : errorInitObject;
! 	code.emitInvokeSpecial(init);
        }
  
--- 82,91 ----
        {
  	args[1].compile(comp, Target.pushObject);
!         if(args[1].getType().getName().equals(Type.string_type.getName())){
!           code.emitInvokeSpecial(errorInitString);
!         }else{
!           code.emitInvokeVirtual(errorToString);
!           code.emitInvokeSpecial(errorInitString);
!         }
        }
  
***************
*** 96,100 ****
      errorClass = ClassType.make("nice.lang.AssertionFailed");
  
!   private static Method errorInit, errorInitString, errorInitObject;
  
    private static void prepare()
--- 99,103 ----
      errorClass = ClassType.make("nice.lang.AssertionFailed");
  
!   private static Method errorInit, errorInitString, errorToString;
  
    private static void prepare()
***************
*** 107,112 ****
      errorInitString = errorClass.addMethod
        ("<init>", Access.PUBLIC, new Type[]{Type.string_type}, Type.void_type);
!     errorInitObject = errorClass.addMethod
!       ("<init>", Access.PUBLIC, new Type[]{Type.pointer_type}, Type.void_type);
    }
  
--- 110,115 ----
      errorInitString = errorClass.addMethod
        ("<init>", Access.PUBLIC, new Type[]{Type.string_type}, Type.void_type);
!     errorToString = Type.pointer_type.addMethod
!       ("toString", Access.PUBLIC, new Type[]{}, Type.string_type);
    }
  



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click