+1999-07-22 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * java/lang/natString.cc (substring): optimize where substring is
+ entire String.
+ * java/io/File.java (getName): don't return separator with file name.
+ * java/io/natFile.cc (attr): fix overflow.
+
Sun Jul 25 01:43:34 1999 Anthony Green <green@cygnus.com>
* mauve-libgcj: Disable Object Serialization tests.
public String getName ()
{
int last = path.lastIndexOf(separatorChar);
- if (last == -1)
- last = 0;
- return path.substring(last);
+ return path.substring(last + 1);
}
public String getParent ()
JvAssert (query == MODIFIED || query == LENGTH);
// FIXME: time computation is very POSIX-specific -- POSIX and Java
// have the same Epoch.
- return query == MODIFIED ? sb.st_mtime * 1000 : sb.st_size;
+ return query == MODIFIED ? (jlong)sb.st_mtime * 1000 : sb.st_size;
#else
// There's no good choice here.
return 23;
{
if (beginIndex < 0 || endIndex > count || beginIndex > endIndex)
JvThrow (new StringIndexOutOfBoundsException());
+ if (beginIndex == 0 && endIndex == count)
+ return this;
jint newCount = endIndex - beginIndex;
if (newCount <= 8) // Optimization, mainly for GC.
return JvNewString(JvGetStringChars(this) + beginIndex, newCount);