From 6e7b20ac6e8b1446e10418b911ea5c007d51d8ac Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 16 Jul 2007 05:00:28 +0000 Subject: [PATCH] File.java: Implement Comparable. * java/io/File.java: Implement Comparable. (compareTo): Removed. * java/io/File.h: Rebuilt. * classpath/lib/java/io/File.class: Rebuilt. From-SVN: r126670 --- libjava/ChangeLog | 7 +++++ libjava/classpath/lib/java/io/File.class | Bin 14275 -> 14356 bytes libjava/java/io/File.h | 6 ++-- libjava/java/io/File.java | 38 +++++------------------ libjava/prims.cc | 21 +++++++------ 5 files changed, 30 insertions(+), 42 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 229832bd74d..510d5f71316 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,10 @@ +2007-07-15 Tom Tromey + + * java/io/File.java: Implement Comparable. + (compareTo): Removed. + * java/io/File.h: Rebuilt. + * classpath/lib/java/io/File.class: Rebuilt. + 2007-07-14 Tom Tromey * Rebuilt .class files. diff --git a/libjava/classpath/lib/java/io/File.class b/libjava/classpath/lib/java/io/File.class index d4cf93dbf97f75140eafc13d65015577bf2f915b..746da883bc8db70d78312a49fef61eb438755fb3 100644 GIT binary patch delta 1849 zcmZ8idr*{B6#t#`-TN(zABf8?C<-hfuLVLVu!*!Bm7+92Ce1Wy(N))QK?G|swM?^| z9y+(_Jy}zYHB-~W26{|}In$JrHKyVt&FrDs%Liup$U3_===8^a=XZYhoZmg?p6|Q6 zx#h9e_$}w(-w2?Lli!Npl59>TXD04)a1X}BgJ_RKJ4}vu6df=@Z;pM?!8rQPtoG)3 zesJh(+DB0B;rXF>JV}SmN8S|sXZqDeznHJR>DF)byE*HvclXgBE;>m_GbO&XY==%E zK=8~8%?@@nw@+ycw})z*=7naq$5S8u<Toe@C5S|kWws*7% zf7660SK1tm%qhLFchvu5Ko(w+^g{7Y!eA-L!;9Qp}f zI)Wnl9XHZ3G|+L}K_{@1`ml~p;{`g0cj-LdW1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GqZg*w>u+@X1byqow?=>x*0(K=p+6$l~p z5m&4!g&81}zUPXh03Ff3gG~y%B^)A9r?npv=Ey6XSyAZAD4y;k*!`i~i<4$e+7=PE z#-6wzk`BN|2N6m?B9acF3mris{e)zy$3SYpFpfEN6r|E7`PFd7JH+Pyqy>(7Z zQ}RFvF&Hk9iSA+uGR067ieV@h&tZ^6{}4y=`LWQ8cND)22X* z=?E94h!ADyBxWF0yo78~iDEGm3&kuf7gbmzX5&Lqjg4XfYQ;kA5{vMiSd8z*>o_8o zpXViQ~)w-V1M~v38B3JET^bMnMz1)*Xd-YDwJl79U#vxe7VMH4ZNHvb3mvKVp zdiR81gw42w&c z2^oSI8H!lh4j$>!GI2^!4Ci!4po~S3jMG(#8RXqom$-!H=kgDEu*ngyr0BgbOA90#8qk5a}JvH-8hLTFipRdNbGkkhbPmf%ZSitVxtJ7hWb z$Qd{!E6^mXa7NC-Z8?`B<$Owz)s!S(qZGN2dYH0`(&QU@fA{xjy)H<~QaibzI(;uW zOz%(XONVtpa+bQxTyqOop4^uVy@@$Dq>5&4tm?z4ubz;yIWvnitnBz4U$Bv&qcn@P(R7TXF6kLr*x1!uLoe4*qsLoICm!3ihhn>W?z(}yK8Cic z5gpWt7JD}gHfdEUoouO8q9fK~9Rwf5`;0Y2zfzOF)YF}HsuumDYUuYGWYiMsJhhnT ziK?Zuk53GRNSW>gryxgZ_FfZJCG}%hEWO z#M%Tj{B|`jbjxR*e-*io1=oK;Lx_2vbYUuW3zhM6q&2H@19f4+2D * listRoots(); static ::java::io::File * createTempFile(::java::lang::String *, ::java::lang::String *); - virtual jint compareTo(::java::io::File *); - virtual jint compareTo(::java::lang::Object *); + virtual jint File$compareTo(::java::io::File *); private: jboolean performRenameTo(::java::io::File *); public: @@ -130,6 +129,9 @@ public: private: void writeObject(::java::io::ObjectOutputStream *); void readObject(::java::io::ObjectInputStream *); +public: + virtual jint compareTo(::java::lang::Object *); +private: static const jlong serialVersionUID = 301077366599181567LL; static const jint READ = 0; static const jint WRITE = 1; diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java index 0026ffaeedf..67d1b96df6c 100644 --- a/libjava/java/io/File.java +++ b/libjava/java/io/File.java @@ -1,5 +1,5 @@ /* File.java -- Class representing a file on disk - Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 + Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -59,7 +59,7 @@ import gnu.classpath.Configuration; * @author Aaron M. Renn (arenn@urbanophile.com) * @author Tom Tromey (tromey@cygnus.com) */ -public class File implements Serializable, Comparable +public class File implements Serializable, Comparable { private static final long serialVersionUID = 301077366599181567L; @@ -103,7 +103,7 @@ public class File implements Serializable, Comparable /** * This is the string that is used to separate the host name from the - * path name in paths than include the host name. It is the value of + * path name in paths that include the host name. It is the value of * the path.separator system property. */ public static final String pathSeparator @@ -454,7 +454,8 @@ public class File implements Serializable, Comparable * This method initializes a new File object to represent * a file corresponding to the specified file: protocol URI. * - * @param uri The uri. + * @param uri The URI + * @throws IllegalArgumentException if the URI is not hierarchical */ public File(URI uri) { @@ -605,7 +606,8 @@ public class File implements Serializable, Comparable /** * This method returns a String the represents this file's * parent. null is returned if the file has no parent. The - * parent is determined via a simple operation which removes the + * parent is determined via a simple operation which removes the name + * after the last file separator character, as determined by the platform. * * @return The parent directory of this file */ @@ -1445,32 +1447,6 @@ public class File implements Serializable, Comparable return path.compareToIgnoreCase (other.path); } - /** - * This method compares the specified Object to this one - * to test for equality. It does this by comparing the canonical path names - * of the files. This method is identical to compareTo(File) - * except that if the Object passed to it is not a - * File, it throws a ClassCastException - *

- * The canonical paths of the files are determined by calling the - * getCanonicalPath method on each object. - *

- * This method returns a 0 if the specified Object is equal - * to this one, a negative value if it is less than this one - * a positive value if it is greater than this one. - * - * @return An integer as described above - * - * @exception ClassCastException If the passed Object is - * not a File - * - * @since 1.2 - */ - public int compareTo(Object obj) - { - return compareTo((File) obj); - } - /* * This native method actually performs the rename. */ diff --git a/libjava/prims.cc b/libjava/prims.cc index 706ab4b7a3e..5d3a260e9d0 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -1262,7 +1262,11 @@ parse_x_arg (char* option_string) { // FIXME: fail if impossible to share class data } - + else + { + // Unrecognized. + return -1; + } return 0; } @@ -1571,21 +1575,20 @@ parse_init_args (JvVMInitArgs* vm_args) JVMTI::enabled = true; continue; } - else if (vm_args->ignoreUnrecognized) + else { + int r = -1; if (option_string[0] == '_') - parse_x_arg (option_string + 1); - else if (! strncmp (option_string, "-X", 2)) - parse_x_arg (option_string + 2); - else + r = parse_x_arg (option_string + 1); + else if (! strncmp (option_string, "-X", 2)) + r = parse_x_arg (option_string + 2); + + if (r == -1 && ! vm_args->ignoreUnrecognized) { - unknown_option: fprintf (stderr, "libgcj: unknown option: %s\n", option_string); return -1; } } - else - goto unknown_option; } return 0; } -- 2.30.2