Skip to content

Upgrading incompatible issue #1566

@SElab2019

Description

@SElab2019

Hi,

The following code snippets throw an incompatible issue when I try to upgrade Gson from 2.2.2 to 2.8.5.

public class TestGson {
	
    public static <T> String convertObjectToString(T t, Class<T> clazz) {
        Gson gson = new GsonBuilder().create();
        try {
            return gson.getAdapter(clazz).toJson(t);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "";
    }
}

It works well before, but It throws an error after upgrading:

exception java.io.IOException is never thrown in body of corresponding try statement

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions