diff options
author | Brian Carlstrom <bdc@google.com> | 2015-01-08 08:24:06 -0800 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2015-01-08 09:27:15 -0800 |
commit | 2270795fbe0b277bfd49f40950ecaa78583175cc (patch) | |
tree | 9ac962825d41c4fb8ad1ec0fc2e8b441b42d3869 /src/proguard/classfile/editor/LocalVariableTypeTableAttributeEditor.java | |
parent | 9961286c06c25cd03464d3e2b00bd9b9dedf96ba (diff) | |
download | external_proguard-2270795fbe0b277bfd49f40950ecaa78583175cc.tar.gz external_proguard-2270795fbe0b277bfd49f40950ecaa78583175cc.tar.bz2 external_proguard-2270795fbe0b277bfd49f40950ecaa78583175cc.zip |
Upgrade Proguard to 5.1.
Downloaded from:
http://sourceforge.net/projects/proguard/files/proguard/5.1/
Bug: 17550647
Change-Id: I2b4eab16eb7821fc232b294ab7f433aae08f71e1
Diffstat (limited to 'src/proguard/classfile/editor/LocalVariableTypeTableAttributeEditor.java')
-rw-r--r-- | src/proguard/classfile/editor/LocalVariableTypeTableAttributeEditor.java | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/proguard/classfile/editor/LocalVariableTypeTableAttributeEditor.java b/src/proguard/classfile/editor/LocalVariableTypeTableAttributeEditor.java index 00f7ef3..724b7b0 100644 --- a/src/proguard/classfile/editor/LocalVariableTypeTableAttributeEditor.java +++ b/src/proguard/classfile/editor/LocalVariableTypeTableAttributeEditor.java @@ -2,7 +2,7 @@ * ProGuard -- shrinking, optimization, obfuscation, and preverification * of Java bytecode. * - * Copyright (c) 2002-2013 Eric Lafortune (eric@graphics.cornell.edu) + * Copyright (c) 2002-2014 Eric Lafortune (eric@graphics.cornell.edu) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -21,6 +21,7 @@ package proguard.classfile.editor; import proguard.classfile.attribute.*; +import proguard.util.ArrayUtil; /** * This class can add local variables to a given local variable type table @@ -31,12 +32,12 @@ import proguard.classfile.attribute.*; */ public class LocalVariableTypeTableAttributeEditor { - private LocalVariableTypeTableAttribute targetLocalVariableTypeTableAttribute; + private final LocalVariableTypeTableAttribute targetLocalVariableTypeTableAttribute; /** - * Creates a new LocalVariableTypeTableAttributeEditor that will edit line numbers - * in the given line number table attribute. + * Creates a new LocalVariableTypeTableAttributeEditor that will edit local + * variable types in the given local variable type table attribute. */ public LocalVariableTypeTableAttributeEditor(LocalVariableTypeTableAttribute targetLocalVariableTypeTableAttribute) { @@ -45,24 +46,13 @@ public class LocalVariableTypeTableAttributeEditor /** - * Adds a given line number to the line number table attribute. + * Adds a given local variable type to the local variable type table attribute. */ public void addLocalVariableTypeInfo(LocalVariableTypeInfo localVariableTypeInfo) { - int localVariableTypeTableLength = targetLocalVariableTypeTableAttribute.u2localVariableTypeTableLength; - LocalVariableTypeInfo[] localVariableTypeTable = targetLocalVariableTypeTableAttribute.localVariableTypeTable; - - // Make sure there is enough space for the new localVariableTypeInfo. - if (localVariableTypeTable.length <= localVariableTypeTableLength) - { - targetLocalVariableTypeTableAttribute.localVariableTypeTable = new LocalVariableTypeInfo[localVariableTypeTableLength+1]; - System.arraycopy(localVariableTypeTable, 0, - targetLocalVariableTypeTableAttribute.localVariableTypeTable, 0, - localVariableTypeTableLength); - localVariableTypeTable = targetLocalVariableTypeTableAttribute.localVariableTypeTable; - } - - // Add the localVariableTypeInfo. - localVariableTypeTable[targetLocalVariableTypeTableAttribute.u2localVariableTypeTableLength++] = localVariableTypeInfo; + targetLocalVariableTypeTableAttribute.localVariableTypeTable = + (LocalVariableTypeInfo[])ArrayUtil.add(targetLocalVariableTypeTableAttribute.localVariableTypeTable, + targetLocalVariableTypeTableAttribute.u2localVariableTypeTableLength++, + localVariableTypeInfo); } }
\ No newline at end of file |