Example usage for org.objectweb.asm MethodTooLargeException getMethodName

List of usage examples for org.objectweb.asm MethodTooLargeException getMethodName

Introduction

In this page you can find the example usage for org.objectweb.asm MethodTooLargeException getMethodName.

Prototype

public String getMethodName() 

Source Link

Document

Returns the name of the method.

Usage

From source file:org.ballerinalang.nativeimpl.jvm.classwriter.ToByteArray.java

License:Open Source License

public static Object toByteArray(Strand strand, ObjectValue oCw) {
    ClassWriter cw = ASMUtil.getRefArgumentNativeData(oCw);
    try {/*from w ww . j  a  va2s  .c om*/
        return new ArrayValue(cw.toByteArray());
    } catch (MethodTooLargeException e) {
        MapValue<String, String> details = new MapValueImpl<>(BTypes.typeErrorDetail);
        details.put(NAME, e.getMethodName());
        return BallerinaErrors.createError(ErrorReasons.METHOD_TOO_LARGE, details);
    } catch (ClassTooLargeException e) {
        MapValue<String, String> details = new MapValueImpl<>(BTypes.typeErrorDetail);
        details.put(NAME, e.getClassName());
        return BallerinaErrors.createError(ErrorReasons.CLASS_TOO_LARGE, details);
    } catch (Exception e) {
        return BallerinaErrors.createError(e.getMessage());
    }
}