8139484: [Findbugs] new sun.jvm.hotspot.SAGetopt(String[]) may expose internal representation
authordsamersoff
Thu, 10 Dec 2015 12:05:53 +0300
changeset 35053 cd0fc9dee122
parent 35043 30543d2a0a20
child 35054 309d5a6a63e9
8139484: [Findbugs] new sun.jvm.hotspot.SAGetopt(String[]) may expose internal representation Summary: Clone array instead of just assign it Reviewed-by: dholmes
hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java	Tue Nov 24 15:56:40 2015 -0800
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java	Thu Dec 10 12:05:53 2015 +0300
@@ -37,7 +37,7 @@
     private boolean _optreset; // special handling of first call
 
     public SAGetopt(String[] args) {
-        _argv  = args;
+        _argv  = args.clone();
         _optind   = 0;
         _optopt   = 1;
         _optarg   = null;