[Demonstration 1]

[Buggy Method]
public Dimension getPreferredSize(JComponent c) {
    Dimension dim = super.getPreferredSize(c);
    return new Dimension(dim.width, dim.height);
}

[Buggy Hunk]
return new Dimension(dim.width, dim.height);

[Patch]
return new Dimension(dim.height, dim.width);

[Demonstration 2]

[Buggy Method]
@Override
public void onClick(View v) {
    switch(v.getId()) {
        case R.id.startHiking:
            if (startHiking.getText().toString().equals("START HIKING")) {
                //Todo: start hiking:-
                Log.i(TAG, "start button clicked");
                if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
                    // TODO: Consider calling
                    // ActivityCompat#requestPermissions
                    // here to request the missing permissions, and then overriding
                    // public void onRequestPermissionsResult(int requestCode, String[] permissions,
                    //                                        int[] grantResults)
                    // to handle the case where the user grants the permission. See the documentation
                    // for ActivityCompat#requestPermissions for more details.
                    ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.ACCESS_FINE_LOCATION }, MY_PERMISSION);
                } else {
                    startHiking.setText(R.string.stop_hiking);
                    try {
                        Log.i(TAG, "fix is here");
                        LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
                        LocationListener locationListener = new MyLocationListener(getBaseContext(), MapsActivity.this);
                        currentLocation = locationManager.getLastKnownLocation(locationManager.GPS_PROVIDER);
                        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10000, 10, locationListener);
                        // Add a marker of your current location and move the camera
                        LatLng latLng = new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude());
                        trail.add(latLng);
                        mMap.addMarker(new MarkerOptions().position(latLng).title("Your Location"));
                        mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 16));
                    } catch (SecurityException | NullPointerException e) {
                        Log.i(TAG, "onMapReady");
                        e.printStackTrace();
                    }
                }
            } else {
                new createTrailAsyncTask();
                startHiking.setText(R.string.start_hiking);
            }
            break;
        default:
            break;
    }
}

[Buggy Hunk]
new createTrailAsyncTask();

[Patch]
new createTrailAsyncTask().execute();

[Demonstration 3]

[Buggy Method]
protected static void writeName(String nickname) {
    Font font = new Font("Open Sans", Font.PLAIN, 12);
    JLabel name = new JLabel(nickname.toUpperCase());
    name.setBounds(20, 115, 100, 22);
    name.setFont(font);
    name.setForeground(new Color(255, 255, 255, 255));
    layeredPane.add(name);
    layeredPane.setLayer(name, LAYER_GAME);
    name.setVisible(true);
}

[Buggy Hunk]
JLabel name = new JLabel(nickname.toUpperCase());

[Patch]
JLabel name = new JLabel(nickname);