[Demonstration 1]

[Buggy Method]
public byte[] decodeBase64(byte[] data) {
    return Base64.decode(data, Base64.NO_WRAP);
}

[Buggy Hunk]
public byte[] decodeBase64(byte[] data) {

[Patch]
protected byte[] decodeBase64(byte[] data) {

[Demonstration 2]

[Buggy Method]
public String fetchFileRevision(String repoLocation, String revision, String filePath) throws MissingObjectException, IncorrectObjectTypeException, IOException {
    Repository localRepository = new FileRepository(new File(repoLocation));
    ObjectId id = localRepository.resolve(revision);
    ObjectReader reader = localRepository.newObjectReader();
    try {
        RevWalk walk = new RevWalk(reader);
        RevCommit commit = walk.parseCommit(id);
        RevTree tree = commit.getTree();
        TreeWalk treewalk = TreeWalk.forPath(reader, filePath, tree);
        if (treewalk != null) {
            byte[] data = reader.open(treewalk.getObjectId(0)).getBytes();
            return new String(data, "utf-8");
        } else {
            return "";
        }
    } finally {
        reader.close();
    }
}

[Buggy Hunk]
Repository localRepository = new FileRepository(new File(repoLocation));

[Patch]
Repository localRepository = new FileRepository(new File(repoLocation + "/.git"));

[Demonstration 3]

[Buggy Method]
private static File makeBase(final BundleContext context) {
    String basePath = System.getProperty("org.eclipse.scada.hd.server.storage.master.hds.basePath", System.getProperty("org.eclipse.scada.hd.server.storage.hds.basePath"));
    // replace variables in path, like "user.home"
    basePath = StringReplacer.replace(basePath, System.getProperties());
    if (basePath == null) {
        final File base = context.getDataFile("storage");
        base.mkdir();
        logger.warn("Using local data storage - {}, exists: {}", base, base.exists());
        return base;
    } else {
        final File base = new File(basePath);
        base.mkdir();
        logger.warn("Using global data storage - {}, exists: {}", base, base.exists());
        return base;
    }
}

[Buggy Hunk]
String basePath = System.getProperty ( "org.eclipse.scada.hd.server.storage.master.hds.basePath", System.getProperty ( "org.eclipse.scada.hd.server.storage.hds.basePath" ) );

[Patch]
String basePath = unEscapeArgValue ( System.getProperty ( "org.eclipse.scada.hd.server.storage.master.hds.basePath", System.getProperty ( "org.eclipse.scada.hd.server.storage.hds.basePath" ) ) );