summaryrefslogtreecommitdiff
path: root/src/proguard/classfile/constant/MethodTypeConstant.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/proguard/classfile/constant/MethodTypeConstant.java')
-rw-r--r--src/proguard/classfile/constant/MethodTypeConstant.java31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/proguard/classfile/constant/MethodTypeConstant.java b/src/proguard/classfile/constant/MethodTypeConstant.java
index 96c136f..5efd0fe 100644
--- a/src/proguard/classfile/constant/MethodTypeConstant.java
+++ b/src/proguard/classfile/constant/MethodTypeConstant.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
@@ -22,6 +22,7 @@ package proguard.classfile.constant;
import proguard.classfile.*;
import proguard.classfile.constant.visitor.ConstantVisitor;
+import proguard.classfile.visitor.ClassVisitor;
/**
* This Constant represents a method handle constant in the constant pool.
@@ -43,6 +44,15 @@ public class MethodTypeConstant extends Constant
/**
+ * An extra field pointing to the Clazz objects referenced in the
+ * descriptor string. This field is filled out by the <code>{@link
+ * proguard.classfile.util.ClassReferenceInitializer ClassReferenceInitializer}</code>.
+ * References to primitive types are ignored.
+ */
+ public Clazz[] referencedClasses;
+
+
+ /**
* Creates an uninitialized MethodTypeConstant.
*/
public MethodTypeConstant()
@@ -79,6 +89,25 @@ public class MethodTypeConstant extends Constant
}
+ /**
+ * Lets the Clazz objects referenced in the descriptor string
+ * accept the given visitor.
+ */
+ public void referencedClassesAccept(ClassVisitor classVisitor)
+ {
+ if (referencedClasses != null)
+ {
+ for (int index = 0; index < referencedClasses.length; index++)
+ {
+ if (referencedClasses[index] != null)
+ {
+ referencedClasses[index].accept(classVisitor);
+ }
+ }
+ }
+ }
+
+
// Implementations for Constant.
public int getTag()