lsp4j icon indicating copy to clipboard operation
lsp4j copied to clipboard

TypeAdapter(Factories) dont check passed (token) type

Open cdietrich opened this issue 2 years ago • 0 comments

our TypeAdapter(Factories) dont check if the (token) type passed into public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { matches the type the adapter is for.

when testing with

GsonBuilder builder = new GsonBuilder();
		builder.registerTypeAdapterFactory(new RestartArgumentsTypeAdapterFactory());
		Gson gson = builder.create();
		XXXX object = gson.fromJson("{\"noDebug\":true}", ELEMENT_TYPE.getType());

this may lead to stackoverflows

cdietrich avatar May 17 '22 15:05 cdietrich