[Demonstration 1]

[Buggy Method]
@Override
public String qnameFor(String uri) {
    int split = Util.splitNamespaceXML(uri);
    String ns = uri.substring(0, split), local = uri.substring(split);
    if (local.equals(""))
        return null;
    String prefix = getNsURIPrefix(uri);
    return prefix == null ? null : prefix + ":" + local;
}

[Buggy Hunk]
String prefix = getNsURIPrefix(uri) ;

[Patch]
String prefix = getNsURIPrefix(ns) ;

[Demonstration 2]

[Buggy Method]
private static boolean isValidIp(String ip) {
    if (ip == null || ip.isEmpty())
        return false;
    ip = ip.trim();
    if ((ip.length() < 6) || (ip.length() > 15))
        return false;
    try {
        Pattern pattern = Pattern.compile("^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$");
        Matcher matcher = pattern.matcher(ip);
        return matcher.matches();
    } catch (PatternSyntaxException ex) {
        return false;
    }
}

[Buggy Hunk]
private static boolean isValidIp(String ip) {

[Patch]
static boolean isValidIp(String ip) {

[Demonstration 3]

[Buggy Method]
public static List<Date> getTime(String time) {
    if (time.equals("[]")) {
        return parser.parse(time);
    }
    time = time.substring(1, time.length() - 1);
    String[] segments = time.split(", ");
    List<Date> result = new ArrayList<Date>();
    for (int i = 0; i < segments.length; i++) {
        result.add(parser.parse(segments[i]).get(0));
    }
    return result;
}

[Buggy Hunk]
result.add(parser.parse(segments[i]).get(0));

[Patch]
result.add(parser.parse(format(segments[i])).get(0));