Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with inner classes of a generic class #183

Closed
AtomBaf opened this issue Jan 24, 2014 · 0 comments
Closed

Problem with inner classes of a generic class #183

AtomBaf opened this issue Jan 24, 2014 · 0 comments

Comments

@AtomBaf
Copy link

AtomBaf commented Jan 24, 2014

given this snippet class :

import java.io.IOException;
import java.io.OutputStream;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.io.Output;

public class b<T> {

    class D {
    }

    T t;
    D d = new D();

    public static void main(String[] args) throws Exception {

        Kryo kryo = new Kryo();
        Output output = new Output(new OutputStream() {
            @Override
            public void write(int b) throws IOException {
            }
        });

        kryo.writeObject(output, new b());
        output.close();

    }
}

we obtain a

Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    at com.esotericsoftware.kryo.serializers.FieldSerializerGenericsUtil.newCachedFieldOfGenericType(FieldSerializerGenericsUtil.java:199)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.newCachedField(FieldSerializer.java:279)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.createCachedFields(FieldSerializer.java:243)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.rebuildCachedFields(FieldSerializer.java:188)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.<init>(FieldSerializer.java:109)

So it seems that in FieldSerializerGenericsUtil.java:198 a chekc on the fieldGenerics length should be done

@romix romix closed this as completed in f9cb9ea Jan 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant