[Demonstration 1]

[Buggy Method]
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    Log.v("DB", "onUpgrade");
    db.execSQL("DROP TABLE IF EXISTS " + DATABASE_NAME);
    onCreate(db);
}

[Buggy Hunk]
Log.v("DB", "onUpgrade");

[Patch]
Log.v(TAG, "onUpgrade");

[Demonstration 2]

[Buggy Method]
public static Object unproxy(Object object) {
    Object result = object;
    if (object != null && isProxy(object)) {
        Hibernate.initialize(object);
        HibernateProxy proxy = (HibernateProxy) object;
        result = proxy.getHibernateLazyInitializer().getImplementation();
    }
    return result;
}

[Buggy Hunk]
public static Object unproxy(Object object) {

[Patch]
public Object unproxy(Object object) {

[Demonstration 3]

[Buggy Method]
public void dataUrlToImage(ObjectNode node, Entity entity, String property, String path) {
    Objects.requireNonNull(fileServer, "Fileserver not injected");
    Objects.requireNonNull(entity, "Cannot convert entity to image: entity is null");
    Objects.requireNonNull(node, "Cannot convert entity to image: node is null");
    String imageData = null;
    if (!node.get(PREFIX + property).isNull()) {
        imageData = node.get(PREFIX + property).asText();
    }
    if (StringUtils.isNotEmpty(imageData)) {
        try {
            URLData urlData = URLData.parse(imageData);
            String imagePath = fileServer.saveImage(path, urlData.getMimeType().getSubtype(), new ByteArrayInputStream(urlData.getBytes()));
            PropertyUtils.setProperty(entity, property, imagePath);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    } else {
        try {
            String actualImage = (String) PropertyUtils.getProperty(entity, property);
            if (actualImage != null) {
                fileServer.deleteFile(actualImage);
            }
            PropertyUtils.setProperty(entity, property, null);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}

[Buggy Hunk]
if (!node.get(PREFIX + property).isNull()) {

[Patch]
if (node.get(PREFIX + property) != null && !node.get(PREFIX + property).isNull()) {