changeset 11966:6837759aa403

8061254: SPECjvm2008-XML performance regressions in 9-b33 Reviewed-by: alanb, shade
author redestad
date Fri, 15 May 2015 16:09:55 +0200
parents ed94f3e7ba6b
children 5f4dda02ab10
files src/java.base/share/classes/java/lang/String.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/String.java	Thu May 14 20:15:26 2015 -0700
+++ b/src/java.base/share/classes/java/lang/String.java	Fri May 15 16:09:55 2015 +0200
@@ -1473,7 +1473,9 @@
             for (char v : value) {
                 h = 31 * h + v;
             }
-            hash = h;
+            if (h != 0) {
+                hash = h;
+            }
         }
         return h;
     }