[Demonstration 1]

[Buggy Method]
@Override
public boolean equals(Object o) {
    if (!this.getClass().equals(o.getClass()))
        return false;
    Case c = (Case) o;
    return this.x == c.x && this.y == c.y && this.board == c.board;
}

[Buggy Hunk]
if(!this.getClass().equals(o.getClass()))

[Patch]
if(o==null||!this.getClass().equals(o.getClass()))

[Demonstration 2]

[Buggy Method]
public static Codec getCodec(ProtocolVersion version) {
    if (codecMap.containsKey(version))
        return codecMap.get(version);
    else
        throw new IllegalArgumentException("Invalid Hot Rod protocol version");
}

[Buggy Hunk]
throw new IllegalArgumentException("Invalid Hot Rod protocol version");

[Patch]
throw new IllegalArgumentException(String.format("Invalid Hot Rod protocol version '%s'", version));

[Demonstration 3]

[Buggy Method]
private Map<String, String> synchronizeRequiredManifest(Map<String, String> requiredManifest) {
    if (requiredManifest == null)
        throw new RuntimeException("requiredManifest not set for synchronizeRequiredManifest");
    Map<String, String> installedManifest = refreshInstalledManifest();
    LOG.info("modifying installedManifest :" + ManifestUtils.manifestMapToCsvString(installedManifest) + "\n to match requiredManifast :" + ManifestUtils.manifestMapToCsvString(requiredManifest));
    // remove features in installedManifest but not in required manifest
    Iterator<String> it = installedManifest.keySet().iterator();
    while (it.hasNext()) {
        String featureName = it.next();
        if (!requiredManifest.containsKey(featureName)) {
            // remove feature
            String featureVersion = requiredManifest.get(featureName);
            Feature feature = null;
            try {
                featuresService.uninstallFeature(featureName);
            } catch (Exception e) {
                LOG.error("could not uninstall installedManifest feature=" + featureName, e);
            }
            LOG.info("removed from installedManifest feature=" + featureName);
            it.remove();
        }
    }
    // install features in required manifest
    for (String featureName : requiredManifest.keySet()) {
        String featureVersion = requiredManifest.get(featureName);
        String installedVersion = "";
        if (!"".equals(featureVersion)) {
            Feature feature = null;
            try {
                feature = featuresService.getFeature(featureName, featureVersion);
            } catch (Exception e) {
                LOG.error("problem finding featureName=" + featureName + " version=" + featureVersion, e);
            }
            if (feature == null) {
                try {
                    feature = featuresService.getFeature(featureName);
                } catch (Exception e) {
                    LOG.error("problem finding featureName=" + featureName, e);
                }
                if (feature != null) {
                    LOG.info("found featureName=" + feature.getName() + " version=" + feature.getVersion());
                    if (featuresService.isInstalled(feature)) {
                        LOG.info("uninstalling featureName=" + feature.getName() + " version=" + feature.getVersion());
                        try {
                            featuresService.uninstallFeature(featureName);
                        } catch (Exception e) {
                            LOG.info("could not uninstall installedManifest feature=" + featureName, e);
                        }
                    }
                }
                try {
                    LOG.info("installing featureName=" + feature.getName() + " version=" + feature.getVersion());
                    featuresService.installFeature(featureName, featureVersion);
                    installedManifest.put(featureName, featureVersion);
                } catch (Exception e) {
                    LOG.error("problem installing featureName=" + featureName + " version=" + featureVersion, e);
                }
            }
        }
    }
    LOG.info("saving new InstalledManifest=" + ManifestUtils.manifestMapToCsvString(installedManifest));
    propertiesCache.setInstalledManifest(installedManifest);
    return installedManifest;
}

[Buggy Hunk]
LOG.info("installing featureName="+feature.getName()+" version="+feature.getVersion());

[Patch]
LOG.info("installing featureName="+featureName+" version="+featureVersion);