1.1 --- a/src/share/classes/com/sun/tools/javap/StackMapWriter.java Tue Sep 25 11:56:46 2012 +0100 1.2 +++ b/src/share/classes/com/sun/tools/javap/StackMapWriter.java Tue Sep 25 13:06:58 2012 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -25,10 +25,11 @@ 1.11 1.12 package com.sun.tools.javap; 1.13 1.14 -import com.sun.tools.classfile.AccessFlags; 1.15 +import java.util.Arrays; 1.16 import java.util.HashMap; 1.17 import java.util.Map; 1.18 1.19 +import com.sun.tools.classfile.AccessFlags; 1.20 import com.sun.tools.classfile.Attribute; 1.21 import com.sun.tools.classfile.Code_attribute; 1.22 import com.sun.tools.classfile.ConstantPool; 1.23 @@ -233,8 +234,7 @@ 1.24 StackMap prev = map.get(pc); 1.25 assert (prev != null); 1.26 int k = 251 - frame.frame_type; 1.27 - verification_type_info[] new_locals = new verification_type_info[prev.locals.length - k]; 1.28 - System.arraycopy(prev.locals, 0, new_locals, 0, new_locals.length); 1.29 + verification_type_info[] new_locals = Arrays.copyOf(prev.locals, prev.locals.length - k); 1.30 StackMap m = new StackMap(new_locals, empty); 1.31 map.put(new_pc, m); 1.32 return new_pc;