[Demonstration 1]

[Buggy Method]
private void setbrowser(String browser) {
    try {
        if (browser.equalsIgnoreCase("firefox")) {
            System.setProperty("webdriver.gecko.driver", frameworkClassPath + "\\geckodriver.exe");
            baseDriver = new FirefoxDriver();
        } else if (browser.equalsIgnoreCase("chrome")) {
            System.setProperty("webdriver.chrome.driver", frameworkClassPath + "\\chromedriver.exe");
            baseDriver = new ChromeDriver();
            driver.manage().window().maximize();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}

[Buggy Hunk]
driver.manage().window().maximize();

[Patch]
baseDriver.manage().window().maximize();

[Demonstration 2]

[Buggy Method]
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    Connection con = dbConnect();
    Gson gson = new Gson();
    accDailyData = getAccDailyData(con);
    String jsonDailyString = gson.toJson(accDailyData);
    response.setContentType("application/json");
    response.getWriter().write(jsonDailyString);
    accMonthlyData = getAccMonthlyData(con);
    String jsonMonthlyString = gson.toJson(accMonthlyData);
    response.setContentType("application/json");
    response.getWriter().write(jsonMonthlyString);
    accCategoryData = getAccCategoryData(con);
    String jsonCategoryString = gson.toJson(accCategoryData);
    response.setContentType("application/json");
    response.getWriter().write(jsonCategoryString);
    dbClose(con);
}

[Buggy Hunk]
Connection con = dbConnect();

[Patch]
con = dbConnect();

[Demonstration 3]

[Buggy Method]
public TrafodionOutputConnection connect(boolean autoCommit) throws SQLException {
    Connection c = driver.connect(url, properties);
    try {
        TrafodionOutputConnection con = new TrafodionOutputConnection(c, autoCommit);
        c = null;
        return con;
    } finally {
        if (c != null) {
            c.close();
        }
    }
}

[Buggy Hunk]
TrafodionOutputConnection con = new TrafodionOutputConnection(c,autoCommit);

[Patch]
TrafodionOutputConnection con = new TrafodionOutputConnection(c,autoCommit,this.schema);