[Demonstration 1]

[Buggy Method]
@RequestMapping(value = "/avatar/{profileId}", method = RequestMethod.POST)
@ResponseBody
public Profile getProfileAvatar(MultipartHttpServletRequest request, HttpServletResponse response, @PathVariable("profileId") String profileId) throws IOException, ProfileException {
    final Profile profile = SocialSecurityUtils.getCurrentProfile();
    if (profile != null && !profile.getUsername().equalsIgnoreCase(SocialSecurityUtils.ANONYMOUS)) {
        final Iterator<String> files = request.getFileNames();
        String fileName = null;
        if (files.hasNext()) {
            fileName = files.next();
        }
        if (!StringUtils.isBlank(fileName)) {
            final MultipartFile avatar = request.getFile(fileName);
            profileService.addProfileAttachment(profile.getId().toString(), AVATAR + "." + FilenameUtils.getExtension(avatar.getOriginalFilename()), avatar.getInputStream());
        }
        return profile;
    } else {
        response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
        return null;
    }
}

[Buggy Hunk]
.getExtension(avatar.getOriginalFilename()), avatar.getInputStream());

[Patch]
.getExtension(avatar.getOriginalFilename()).toLowerCase(), avatar.getInputStream());

[Demonstration 2]

[Buggy Method]
public void showCompanyStatistics() {
    try {
        // Load the fxml file and create a new stage for the popup dialog.
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(MainApplication.class.getResource("../view/CompanyStatistics.fxml"));
        AnchorPane pane = (AnchorPane) loader.load();
        // Create the dialog Stage.
        Stage dialogStage = new Stage();
        dialogStage.setTitle("Company Statistics");
        dialogStage.initModality(Modality.WINDOW_MODAL);
        dialogStage.initOwner(primaryStage);
        Scene scene = new Scene(pane);
        dialogStage.setScene(scene);
        // Set the cds into the controller.
        CompanyStatisticsController controller = loader.getController();
        controller.setCDData(cdData);
        // Show the dialog and wait until the user closes it
        dialogStage.showAndWait();
    } catch (IOException e) {
    }
}

[Buggy Hunk]
loader.setLocation(MainApplication.class.getResource("../view/CompanyStatistics.fxml"));

[Patch]
loader.setLocation(CompanyStatisticsController.class.getResource("CompanyStatistics.fxml"));

[Demonstration 3]

[Buggy Method]
public void initRootLayout() {
    try {
        // Load root layout from fxml file.
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(MainApplication.class.getResource("../view/RootLayout.fxml"));
        rootLayout = (BorderPane) loader.load();
        // Show the scene containing the root layout.
        Scene scene = new Scene(rootLayout);
        primaryStage.setScene(scene);
        // Give the controller access to the main app.
        RootLayoutController controller = loader.getController();
        controller.setMainApp(this);
        primaryStage.show();
    } catch (IOException e) {
        e.printStackTrace();
    }
    // Try to load the last opened CD file
    File file = this.getXmlFilePath();
    if (file != null) {
        this.loadCdDataFromFile(file);
    }
}

[Buggy Hunk]
loader.setLocation(MainApplication.class.getResource("../view/RootLayout.fxml"));

[Patch]
loader.setLocation(RootLayoutController.class.getResource("RootLayout.fxml"));