1 // Copyright 2012 Google Inc. All Rights Reserved.
3 package com
.google
.appengine
.tools
.development
.agent
.impl
;
5 import org
.objectweb
.asm
.MethodVisitor
;
6 import org
.objectweb
.asm
.Type
;
7 import org
.objectweb
.asm
.commons
.GeneratorAdapter
;
10 * A subclass of {@link GeneratorAdapter} that does not record the types of newly added local
11 * variables, thereby avoiding a bug in {@link org.objectweb.asm.commons.LocalVariablesSorter}.
13 * Use this class instead of {@link GeneratorAdapter} to avoid <a
14 * href="http://forge.ow2.org/tracker/index.php?func=detail&aid=316352&group_id=23&atid=100023">ASM
20 public class NonRecordingGeneratorAdapter
extends GeneratorAdapter
{
22 public NonRecordingGeneratorAdapter(
23 MethodVisitor methodVisitor
, int access
, String name
, String desc
) {
24 super(methodVisitor
, access
, name
, desc
);
28 * Creates a new local variable of the given type.
30 * @param type the type of the local variable to be created.
31 * @return the identifier of the newly created local variable.
34 public int newLocal(final Type type
) {
35 int local
= nextLocal
;
36 nextLocal
+= type
.getSize();
37 setLocalType(local
, type
);