changeset 25254:a56c2713f1a8

8049223: RewriteException class exposes public mutable arrays Reviewed-by: hannesw, sundar
author attila
date Thu, 03 Jul 2014 11:18:26 +0200
parents 61601aa79b10
children cf56cdc2c663
files nashorn/src/jdk/nashorn/internal/runtime/RewriteException.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/nashorn/src/jdk/nashorn/internal/runtime/RewriteException.java	Thu Jul 03 11:18:10 2014 +0200
+++ b/nashorn/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)).