summaryrefslogtreecommitdiff
path: root/libjava
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
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')
-rw-r--r--libjava/ChangeLog8
-rw-r--r--libjava/classpath/lib/java/lang/Class$1.classbin677 -> 677 bytes
-rw-r--r--libjava/classpath/lib/java/lang/Class.classbin15581 -> 15551 bytes
-rw-r--r--libjava/java/lang/Class.java6
-rw-r--r--libjava/testsuite/libjava.lang/PR35020.jarbin0 -> 1856 bytes
-rw-r--r--libjava/testsuite/libjava.lang/PR35020.java21
-rw-r--r--libjava/testsuite/libjava.lang/PR35020.out6
7 files changed, 39 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 52061d2c1ed..37f12e2c892 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,6 +1,14 @@
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.
+
+2008-05-22 Andrew Haley <aph@redhat.com>
+
+ PR libgcj/35020
* java/lang/Class.java (getSimpleName): Import from GNU Classpath.
2008-05-20 David Daney <ddaney@avtrex.com>
diff --git a/libjava/classpath/lib/java/lang/Class$1.class b/libjava/classpath/lib/java/lang/Class$1.class
index 09e3e86f995..9c4806c0233 100644
--- a/libjava/classpath/lib/java/lang/Class$1.class
+++ b/libjava/classpath/lib/java/lang/Class$1.class
Binary files differ
diff --git a/libjava/classpath/lib/java/lang/Class.class b/libjava/classpath/lib/java/lang/Class.class
index bdcfcfe83bd..ce854558e54 100644
--- a/libjava/classpath/lib/java/lang/Class.class
+++ b/libjava/classpath/lib/java/lang/Class.class
Binary files differ
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);
}
diff --git a/libjava/testsuite/libjava.lang/PR35020.jar b/libjava/testsuite/libjava.lang/PR35020.jar
new file mode 100644
index 00000000000..bedaed7ecdb
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/PR35020.jar
Binary files differ
diff --git a/libjava/testsuite/libjava.lang/PR35020.java b/libjava/testsuite/libjava.lang/PR35020.java
new file mode 100644
index 00000000000..1850da79683
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/PR35020.java
@@ -0,0 +1,21 @@
+public class PR35020
+{
+ class inner
+ {
+ }
+ public static void main(String[] args)
+ {
+ System.out.println(inner.class.getSimpleName());
+ System.out.println(PR35020.class.getSimpleName());
+ System.out.println(Class.class.getSimpleName());
+ System.out.println((new int[7]).getClass().getSimpleName());
+ System.out.println((new Object[1][1][1][1][1][1][1][1]).getClass().getSimpleName());
+ System.out.println((new java.security.PrivilegedAction()
+ {
+ public Object run() {
+ return null;
+ }
+ }).getClass().getSimpleName());
+ }
+}
+
diff --git a/libjava/testsuite/libjava.lang/PR35020.out b/libjava/testsuite/libjava.lang/PR35020.out
new file mode 100644
index 00000000000..73eb0c917fc
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/PR35020.out
@@ -0,0 +1,6 @@
+inner
+PR35020
+Class
+int[]
+Object[][][][][][][][]
+