@@ -122,8 +122,8 @@ public class JavaExpressionVisitor implements ExpressionVisitor<Void>, JavaNativ
122122 private static final JavaMethod MAP_CONTAINS_KEY = JavaMethod .getInterface (JavaClass .MAP , "containsKey" , "(Ljava/lang/Object;)Z" );
123123 private static final JavaMethod MAP_SIZE = JavaMethod .getInterface (JavaClass .MAP , "size" , "()I" );
124124 private static final JavaMethod MAP_ISEMPTY = JavaMethod .getInterface (JavaClass .MAP , "isEmpty" , "()Z" );
125- private static final JavaMethod MAP_KEYS = JavaMethod .getInterface (JavaClass .MAP , "keys " , "()Ljava/lang/Object ;" );
126- private static final JavaMethod MAP_VALUES = JavaMethod .getInterface (JavaClass .MAP , "values" , "()Ljava/lang/Object ;" );
125+ private static final JavaMethod MAP_KEYS = JavaMethod .getInterface (JavaClass .MAP , "keySet " , "()Ljava/util/Set ;" );
126+ private static final JavaMethod MAP_VALUES = JavaMethod .getInterface (JavaClass .MAP , "values" , "()Ljava/util/Collection ;" );
127127 private static final JavaMethod ARRAYS_COPY_OF_RANGE_OBJECTS = JavaMethod .getNativeStatic (JavaClass .ARRAYS , "copyOfRange" , "([Ljava/lang/Object;II)[Ljava/lang/Object;" );
128128 private static final JavaMethod ARRAYS_COPY_OF_RANGE_BOOLS = JavaMethod .getNativeStatic (JavaClass .ARRAYS , "copyOfRange" , "([ZII)[Z" );
129129 private static final JavaMethod ARRAYS_COPY_OF_RANGE_BYTES = JavaMethod .getNativeStatic (JavaClass .ARRAYS , "copyOfRange" , "([BII)[B" );
@@ -2433,7 +2433,7 @@ public Void visitGetter(GetterExpression expression) {
24332433 javaWriter .invokeVirtual (MAP_KEYS );
24342434 javaWriter .dup ();
24352435 javaWriter .invokeVirtual (COLLECTION_SIZE );
2436- javaWriter .newArray (resultType );
2436+ javaWriter .newArray (resultType . getElementType () );
24372437 javaWriter .invokeVirtual (COLLECTION_TOARRAY );
24382438 javaWriter .checkCast (resultType );
24392439 break ;
@@ -2444,7 +2444,7 @@ public Void visitGetter(GetterExpression expression) {
24442444 javaWriter .invokeVirtual (MAP_VALUES );
24452445 javaWriter .dup ();
24462446 javaWriter .invokeVirtual (COLLECTION_SIZE );
2447- javaWriter .newArray (resultType );
2447+ javaWriter .newArray (resultType . getElementType () );
24482448 javaWriter .invokeVirtual (COLLECTION_TOARRAY );
24492449 javaWriter .checkCast (resultType );
24502450 break ;
0 commit comments