From d16b2b63c228bbaee1cbf3d91f9506861388a212 Mon Sep 17 00:00:00 2001 From: Volker Date: Mon, 6 Aug 2018 12:44:47 +0200 Subject: [PATCH] Add constructor with ConstantRef --- .../jwebassembly/module/FunctionName.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/de/inetsoftware/jwebassembly/module/FunctionName.java b/src/de/inetsoftware/jwebassembly/module/FunctionName.java index 9134a03..63a13d2 100644 --- a/src/de/inetsoftware/jwebassembly/module/FunctionName.java +++ b/src/de/inetsoftware/jwebassembly/module/FunctionName.java @@ -18,6 +18,7 @@ package de.inetsoftware.jwebassembly.module; import javax.annotation.Nonnull; +import de.inetsoftware.classparser.ConstantRef; import de.inetsoftware.classparser.MethodInfo; /** @@ -50,4 +51,17 @@ public class FunctionName { fullName = className + '.' + methodName; signatureName = fullName + method.getDescription(); } + + /** + * Create a new instance from the given reference in the ConstantPool. + * + * @param method + * the Java method + */ + FunctionName( @Nonnull ConstantRef method ) { + String methodName = method.getName(); + String className = method.getConstantClass().getName(); + fullName = className + '.' + methodName; + signatureName = fullName + method.getType(); + } }