summaryrefslogtreecommitdiff
path: root/libjava/java
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-23 13:04:18 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-23 13:04:18 +0000
commit20bb3346b8014d3f8dbc3c9f480c47b4a096bc31 (patch)
treede028939d2784b099a5232cd9d023170c9fe58d1 /libjava/java
parent480610ccadbe82fc775f1b6cff34af291ebff5a2 (diff)
downloadgcc-20bb3346b8014d3f8dbc3c9f480c47b4a096bc31.tar.gz
2008-05-22 Andrew Haley <aph@redhat.com>
PR libgcj/35020 * java/lang/Class.java (getSimpleName): Replace incorrect use of String.lastIndexOf(String, int) with String.substring. * testsuite/libjava.lang/PR35020.java: New file. * testsuite/libjava.lang/PR35020.out: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135801 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r--libjava/java/lang/Class.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/libjava/java/lang/Class.java b/libjava/java/lang/Class.java
index d59e83ea4ec..868e370b819 100644
--- a/libjava/java/lang/Class.java
+++ b/libjava/java/lang/Class.java
@@ -1090,10 +1090,12 @@ public final class Class<T>
++pos;
while (Character.isDigit(fullName.charAt(pos)))
++pos;
+ fullName = fullName.substring(pos);
}
- int packagePos = fullName.lastIndexOf(".", pos);
+
+ int packagePos = fullName.lastIndexOf(".");
if (packagePos == -1)
- return fullName.substring(pos);
+ return fullName;
else
return fullName.substring(packagePos + 1);
}