mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-26 07:49:28 +01:00
better error message
This commit is contained in:
parent
23b01afaea
commit
6fc9feca70
@ -21,6 +21,7 @@ import java.util.Iterator;
|
|||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import de.inetsoftware.classparser.Member;
|
import de.inetsoftware.classparser.Member;
|
||||||
|
import de.inetsoftware.jwebassembly.WasmException;
|
||||||
import de.inetsoftware.jwebassembly.wasm.AnyType;
|
import de.inetsoftware.jwebassembly.wasm.AnyType;
|
||||||
import de.inetsoftware.jwebassembly.wasm.ValueTypeParser;
|
import de.inetsoftware.jwebassembly.wasm.ValueTypeParser;
|
||||||
|
|
||||||
@ -109,6 +110,7 @@ public class FunctionName {
|
|||||||
* the full Java method signature like "com/foo/Bar.method()V"
|
* the full Java method signature like "com/foo/Bar.method()V"
|
||||||
*/
|
*/
|
||||||
public FunctionName( String signatureName ) {
|
public FunctionName( String signatureName ) {
|
||||||
|
try {
|
||||||
int idx1 = signatureName.indexOf( '.' );
|
int idx1 = signatureName.indexOf( '.' );
|
||||||
this.className = signatureName.substring( 0, idx1 );
|
this.className = signatureName.substring( 0, idx1 );
|
||||||
int idx2 = signatureName.indexOf( '(', idx1 );
|
int idx2 = signatureName.indexOf( '(', idx1 );
|
||||||
@ -116,6 +118,9 @@ public class FunctionName {
|
|||||||
this.fullName = signatureName.substring( 0, idx2 );
|
this.fullName = signatureName.substring( 0, idx2 );
|
||||||
this.signatureName = signatureName;
|
this.signatureName = signatureName;
|
||||||
this.signature = signatureName.substring( idx2 );
|
this.signature = signatureName.substring( idx2 );
|
||||||
|
} catch( IndexOutOfBoundsException ex ) {
|
||||||
|
throw WasmException.create( "Invalid method signature: " + signatureName, ex );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user