reduce compiler warnings

This commit is contained in:
Volker Berlin 2021-07-10 22:30:53 +02:00
parent fdceb07079
commit a47d1e3bc8
3 changed files with 8 additions and 7 deletions

View File

@ -608,6 +608,7 @@ public abstract class WasmCodeBuilder {
*
* @param name
* the function name that should be called
* @param needThisParameter true, if the hidden THIS parameter is needed, If it is an instance method call.
* @param javaCodePos
* the code position/offset in the Java method
* @param lineNumber

View File

@ -98,7 +98,7 @@ public class ReplacementForArray {
* @return the length of the object
*/
@Replace( "java/lang/reflect/Array.newInstance(Ljava/lang/Class;I)Ljava/lang/Object;" )
private static Object array_newInstance( ReplacementForClass componentClass, int length ) {
private static Object array_newInstance( ReplacementForClass<?> componentClass, int length ) {
int vtable = componentClass.vtable;
int componentType = getIntFromMemory( vtable + TYPE_DESCRIPTION_INSTANCEOF_OFFSET );
switch( componentType ) {

View File

@ -88,7 +88,7 @@ class ReplacementForClass<T> {
+ "return " //
)
@Replace( "java/lang/Object.getClass()Ljava/lang/Class;" )
private static native ReplacementForClass getClassObject( Object obj );
private static native ReplacementForClass<?> getClassObject( Object obj );
/**
* WASM code
@ -100,8 +100,8 @@ class ReplacementForClass<T> {
* @return the string
* @see TypeManager#getClassConstantFunction()
*/
private static ReplacementForClass classConstant( int classIdx ) {
ReplacementForClass clazz = getClassFromTable( classIdx );
private static ReplacementForClass<?> classConstant( int classIdx ) {
ReplacementForClass<?> clazz = getClassFromTable( classIdx );
if( clazz != null ) {
return clazz;
}
@ -117,7 +117,7 @@ class ReplacementForClass<T> {
*/
int vtable = getIntFromMemory( classIdx * 4 + typeTableMemoryOffset() );
clazz = new ReplacementForClass( vtable, classIdx );
clazz = new ReplacementForClass<>( vtable, classIdx );
// save the string for future use
setClassIntoTable( classIdx, clazz );
return clazz;
@ -135,7 +135,7 @@ class ReplacementForClass<T> {
@WasmTextCode( "local.get 0 " + //
"table.get 2 " + // table 2 is used for classes
"return" )
private static native ReplacementForClass getClassFromTable( int classIdx );
private static native ReplacementForClass<?> getClassFromTable( int classIdx );
/**
* WASM code
@ -151,7 +151,7 @@ class ReplacementForClass<T> {
"local.get 1 " + //
"table.set 2 " + // table 2 is used for classes
"return" )
private static native void setClassIntoTable( int strIdx, ReplacementForClass clazz );
private static native void setClassIntoTable( int strIdx, ReplacementForClass<?> clazz );
/**
* WASM code