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 * @param name
* the function name that should be called * 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 * @param javaCodePos
* the code position/offset in the Java method * the code position/offset in the Java method
* @param lineNumber * @param lineNumber

View File

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

View File

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