From cf38a465eca401054b78e6182f0dced39418554b Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Fri, 23 May 2008 13:04:18 +0000 Subject: [PATCH] re PR libgcj/35020 (Class.getSimpleName() differs from Sun Java) 2008-05-22 Andrew Haley 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. From-SVN: r135801 --- libjava/ChangeLog | 8 +++++++ libjava/classpath/lib/java/lang/Class$1.class | Bin 677 -> 677 bytes libjava/classpath/lib/java/lang/Class.class | Bin 15581 -> 15551 bytes libjava/java/lang/Class.java | 6 +++-- libjava/testsuite/libjava.lang/PR35020.jar | Bin 0 -> 1856 bytes libjava/testsuite/libjava.lang/PR35020.java | 21 ++++++++++++++++++ libjava/testsuite/libjava.lang/PR35020.out | 6 +++++ 7 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 libjava/testsuite/libjava.lang/PR35020.jar create mode 100644 libjava/testsuite/libjava.lang/PR35020.java create mode 100644 libjava/testsuite/libjava.lang/PR35020.out diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 52061d2c1ed..37f12e2c892 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,11 @@ +2008-05-22 Andrew Haley + + 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 PR libgcj/35020 diff --git a/libjava/classpath/lib/java/lang/Class$1.class b/libjava/classpath/lib/java/lang/Class$1.class index 09e3e86f9954b60f48813dff60c6349d9a59a6f1..9c4806c02337392a561302e5da00c839f9d02193 100644 GIT binary patch delta 23 fcmZ3=x|DT;1`}idWKAYV*2xSUtWzfEGnoMZPb3C0 delta 23 fcmZ3=x|DT;1`}iNWKAYV)`<)ptdl0^GnoMZPU;3L diff --git a/libjava/classpath/lib/java/lang/Class.class b/libjava/classpath/lib/java/lang/Class.class index bdcfcfe83bda48e1ab9fce5acf4427d4f3df4cc3..ce854558e542fb0e5114f54b01889a3be01df88d 100644 GIT binary patch delta 2035 zcmZuyTWpk75dLQNobGn}_p&X!?Y6tU;DU5_X{GlrP{dl~vI`hvNFx##UA0<^q16Nv z(nN_5l1S|Tpe1VbL3!b!gk($QB8dnQs~iSRn{}0kLb(LbJ;?`?^$!g6^wzIT_TQaI-tT4?JZ=yh2Iq@= zK~;sz#f1hJvBz9g)fsSciNSNQgOGRomcD^xPhbC<)HWykEGXkaZ`-QAyHi_x22yue zx0D&|Cl8^dr+;~0-^pw_If_T}ec1#YzdZg#R7 zs-9|y8XU%$byc0g^;Ag6@99sZ?%SN&+S!}z@3&4C85qJkYt?9QlUY~OklSW(J6*IO zd8&NoV9olRr3OvXIrD>>7+q@?&Gi*6~JX%BMbKN3je#{+a?_w+egl8Q%4=#4ZT>j?65(2b}Y-XM?%IIr5wGcFYL*EME*@S8{2?@UMq_W3b8duMti2oPG z53?xdBUezoA}Ef*t&XEooj|pE4fE7V)T-A}r`|xDdehw0S~{2s-S$7Bm(GNi#t~39 zmo#Bhv^`5vaE2DgVfyvIfPS9^5jO4aPCT5XN)UkuDBB($CYi9Fwn?DZDnXz(;6;mwicFW53;L! zl-==gn)AA2`bdj%bnHQ?Uk4i!k?0s*B1F?%U@mX>4vIm}krwS}QG0NWKgX*Y)-JRy zV$O))ndai%@cEr3>`im&F!E$?p}20?p~$Pe`uXX%qG`kv(G%0@NSezN(dZZl35RKF zj4K&OxoY+SIxNPt6E5vSK<8qC$jBn?MvKlvyDq>wU4#wVgL`!``bFQa4LmGok7_S= zYTr<-w7HsVB-;QCo@=wzg7tirFvrqqA$!k(4G3^Z_MF&>5}wEN&3Me8s^+W3)3)aY zVxKvywK%k9ScXHK6%OSo&?~R`(lA0I4y8E~j~qwYK}>W<4&dA<{wkrPX7`(qC*1GkpuR z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T}^ zYq^AN>01P4>|-b_Agik#ERSprZ7S@F19X~gU2~II>V*uM4rn=Q~G3wvU(4p zI;>-@L&@e@xC^^}otqyev7l%tKRqGXNJdc!} z4BIt%t~`LMupMGq)=ncRn` zjnyL8X&*YYAKlu)c3p-MU5=mYC72NXCLO>na`tN-!hXHXqiw()bsQ|x=ELp0g5y$t z6b`RUc)WFBm{$pxEO#-^D`n5Z2%>zE?Ah3l5U=JYvo;mZuHb~YdiIAUqG~yy2%JbTE@(I)&$H$||V>my9FGKW59vAXNM}+l@r;!xVCU)j< zDo*X@xm3fp9@u&#%5^V7dXtpD87;aWo%&Mr=*y(^Ey(HtT&D-WcVowkrIsViUEYLt zqJg{3hMw@Kd>e`wuNLWIT#}gKl=ooB&6rOo7s+4hzHE9_`2Q*V`YM#^9bT5If?qL< zMvynMZSL=>9+4MZB9i;<5F76vve!cF5Z%q@B$9dF^n_fn!`5NZ3$JU5V1d5jd(oYR zDR ++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 0000000000000000000000000000000000000000..bedaed7ecdba7b3a38f6411f9e1d1c7d89b0873d GIT binary patch literal 1856 zcmWIWW@h1H0D)r(+bzHhD8b1f%HZo7;;8HC=cXST!pXp_ywuDCghMM>7``xmVGIE3 z6#=T|0PC$()l@YA@{E931X-`Iqo1dnYjB93uNzilKKq_I?c=ShcahgySL@uF^P7VV zt{6Wk()04w@$|h|x@t?1MzhC@Y0svLEnikp$jE?dt?VT2Pp=pm7=oA?7Ijd9Nft@6VC_x@UZ-xI%o|38Kcht@StX(;@W_Pw%r zd8UHy1pCSIDTk;2TkvsL`LbUN9lo`GEBz6aurlg3*OKpT%TFB=@{yKIVGWacySjPf z_27fiH;bn_9F+XF^!C)ozDFuE`R>1-*zi*2^(~*upx;bSUu`swzss)V=d+qQsMQi78+Ap{A-VurLE6dHgAKut%ddF;o--*wS z)$3$>bM73BoyH$>&kcg^X?r>^SG z>;6%llFZ%DT69Nh@q;7U+>cfGS8}eASAX>9w|z~$Q`mpGTblyfJ+o2`I@t6Q!VbLR zIqn$0_tM4vH#}dLg`6m`U!)bc)LYd!)8BnFa56cvt)00Y`?!y@d7;sB?|Ywi%-SY*y!c_8+9w`&PZNQ>C8b&iujG;try^>B!;FiRs=7n!OROJ>Ojd+o6_l?E*>c`l3y*s9DoX^%< zpvK&`XtUfZ_bFD3__n%T{%J3*x^|&_X84^`5_!uvY~C?p);*2upP5%K`>r(Sr?7A- zoAKI>8{2DN?RYTh#_Qhc_HPac2(J*&Pr9$ET5|ufqXN?w$Hx<%yl9XVy4AafDKhp_ zPszI{%-5h&z+lX{zm%S z@8_Sn4+xgA$T+=!_wR|0U0?eyjS$rbf{SL>Onn?9cK-40l4YCPF673Q*!FPNUHWxC za?gd^yna?d;@PPd2R!)!pDKu(t8SM*f89 zi+BEE6>(LYpIE~(?Z>y7a}PaaYWmw;-p1dOf5-BLaoO7Iu16%IZWE=;K{2 zbX{#*V|;)&Ba=8Yu7aBvT7(NQymbUIk&1CvNHHE-!2rx1ATw|k;1Dx_vBR*W(FWNJ zl;RwZai|3|%t;{QHUo`AE2i<7gPLuT&AH12HwTf4@tA~~=8#RwVnLXMk^)goV`T$6 QoPiYxi-F;?ofX6b0L_5QDgXcg literal 0 HcmV?d00001 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[][][][][][][][] + -- 2.30.2