[Demonstration 1]

[Buggy Method]
public void createConnection() {
    if (dbconnection != null) {
        return;
    }
    Connection connection = null;
    try {
        connection = DriverManager.getConnection(URL, USER, PASSWORD);
        System.out.println("Connected.");
        System.out.println("");
    } catch (SQLException e) {
        System.out.println("ERROR: Unable to Connect to Database.");
    }
    dbconnection = connection;
}

[Buggy Hunk]
System.out.println("Connected.");

[Patch]
System.out.println("Connected to DB : " + URL);

[Demonstration 2]

[Buggy Method]
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // TODO For future implementation: lock navigation (no home-screen access)
    /**
     * getWindow().getDecorView().setSystemUiVisibility(8);
     * requestWindowFeature(Window.FEATURE_ACTION_BAR);
     * getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
     * 		WindowManager.LayoutParams.FLAG_FULLSCREEN);
     */
    preferences = getSharedPreferences("LayoutData", Context.MODE_PRIVATE);
    version = setupColourData(version);
    colourData = DataUtil.loadFromPreferences(preferences);
    colourData.setDALI(false);
    // Set default command to either DALI or DMX, depending on setting type.
    Comms.DALI_DMX_COMMAND = (colourData.isDALI()) ? Comms.DALI_START_COMMAND : Comms.DMX_START_COMMAND;
    // Uncomment to make app keep Android device screen on.
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    setContentView(R.layout.activity_main);
    // Start background read service.
    startService(new Intent(MainActivity.this, TelnetRxService.class));
    // Inflate action bar and tabs.
    constructActionbar();
    // Create Wearable
    wearable.createWearable(this);
    isWifiEnabled();
}

[Buggy Hunk]
version = setupColourData(version);

[Patch]
version = setupColourData(DEFAULT);

[Demonstration 3]

[Buggy Method]
@Override
public void undeploy(String fileName) throws DeploymentException {
    String platformId = getPlatformID(fileName);
    try {
        DataHolder.getInstance().getPlatformManager().unregister(CarbonContext.getThreadLocalCarbonContext().getTenantId(), platformId, true);
        log.info("Platform configuration : " + fileName + " un-deployed successfully");
    } catch (PlatformManagementException e) {
        log.error("Error occurred while un-deploying the platform - " + fileName);
    }
}

[Buggy Hunk]
log.error("Error occurred while un-deploying the platform - " + fileName);

[Patch]
log.error("Error occurred while un-deploying the platform - " + fileName, e);