mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
Replace native methods with methods from partial classes.
This commit is contained in:
parent
e54fa767c1
commit
8fccc94615
@ -388,9 +388,12 @@ public class ClassFile {
|
|||||||
String origClassName = partialClassFile.thisClass.getName();
|
String origClassName = partialClassFile.thisClass.getName();
|
||||||
ArrayList<MethodInfo> allMethods = new ArrayList<>( Arrays.asList( methods ) );
|
ArrayList<MethodInfo> allMethods = new ArrayList<>( Arrays.asList( methods ) );
|
||||||
for( MethodInfo m : partialClassFile.methods ) {
|
for( MethodInfo m : partialClassFile.methods ) {
|
||||||
if( getMethod( m.getName(), m.getType() ) == null ) {
|
m.setDeclaringClassFile( origClassName, this );
|
||||||
m.setDeclaringClassFile( origClassName, this );
|
MethodInfo origMethod = getMethod( m.getName(), m.getType() );
|
||||||
|
if( origMethod == null ) {
|
||||||
allMethods.add( m );
|
allMethods.add( m );
|
||||||
|
} else if( origMethod.isNative() ) {
|
||||||
|
allMethods.set( allMethods.indexOf( origMethod ), m );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
methods = allMethods.toArray( methods );
|
methods = allMethods.toArray( methods );
|
||||||
|
@ -101,6 +101,15 @@ public class MethodInfo implements Member {
|
|||||||
return (accessFlags & 0x0008) > 0;
|
return (accessFlags & 0x0008) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the method is native
|
||||||
|
*
|
||||||
|
* @return true, if abstract
|
||||||
|
*/
|
||||||
|
public boolean isNative() {
|
||||||
|
return (accessFlags & 0x0100) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the method is abstract
|
* If the method is abstract
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user