Example usage for org.objectweb.asm MethodTooLargeException getClassName

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

Introduction

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

Prototype

public String getClassName() 

Source Link

Document

Returns the internal name of the owner class.

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 {// ww w  .j av  a  2  s  .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());
    }
}