[Nice-commit] Nice/testsuite/compiler/native methods.testsuite,1.3,1.4
Brought to you by:
bonniot
From: <bo...@us...> - 2003-06-24 20:07:40
|
Update of /cvsroot/nice/Nice/testsuite/compiler/native In directory sc8-pr-cvs1:/tmp/cvs-serv31471/testsuite/compiler/native Modified Files: methods.testsuite Log Message: In the bytecode, make method calls refer to the most precise reveiver. This improves the ability to compile on one version of the JDK and run on an earlier one, if a super-class is added in the later version (this happens in particular between JDK 1.3 and 1.4 with String and CharSequence). Incidentally, it can make the method call more efficient, especially if it changes an interface method into a class method. Index: methods.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/native/methods.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** methods.testsuite 17 Jun 2003 09:27:41 -0000 1.3 --- methods.testsuite 24 Jun 2003 20:07:37 -0000 1.4 *************** *** 17,18 **** --- 17,25 ---- List<String> list2 = [s1, s2]; assert list1.equals(list2); + + /// PASS + assert foo(true).equals("1"); + assert foo(false).equals("2"); + ///Toplevel + String foo(boolean b) = + (b ? new Integer(1) : new Long(2)).toString(); |