changeset 921:0dd54eea1a25

8049223: RewriteException class exposes public mutable arrays Reviewed-by: hannesw, sundar
author attila
date Thu, 03 Jul 2014 11:18:26 +0200
parents f364357f0290
children ad26ecacc9a3
files src/jdk/nashorn/internal/runtime/RewriteException.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk/nashorn/internal/runtime/RewriteException.java	Thu Jul 03 11:18:10 2014 +0200
+++ b/src/jdk/nashorn/internal/runtime/RewriteException.java	Thu Jul 03 11:18:26 2014 +0200
@@ -331,7 +331,7 @@
      * @return bytecode slot contents.
      */
     public Object[] getByteCodeSlots() {
-        return byteCodeSlots;
+        return byteCodeSlots == null ? null : byteCodeSlots.clone();
     }
 
     /**
@@ -339,7 +339,7 @@
      * function (a rest-of triggering a rest-of triggering a...)
      */
     public int[] getPreviousContinuationEntryPoints() {
-        return previousContinuationEntryPoints;
+        return previousContinuationEntryPoints == null ? null : previousContinuationEntryPoints.clone();
     }
 
     /**
@@ -388,7 +388,7 @@
 
         //slot contents
         if (!isShort) {
-            final Object[] slots = getByteCodeSlots();
+            final Object[] slots = byteCodeSlots;
             if (slots != null) {
                 sb.append("slots=").
                     append(Arrays.asList(slots)).