[Demonstration 1]

[Buggy Method]
@Override
public void run() {
    while (true) {
        try {
            Socket clientSocket = serverSocket.accept();
            new Thread(new ChatRunnable(clientSocket, client)).start();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

[Buggy Hunk]
new Thread(new ChatRunnable(clientSocket, client)).start();

[Patch]
new Thread(new ChatRunnable(clientSocket, client, panel)).start();

[Demonstration 2]

[Buggy Method]
public static int getConnectorPort(ServerConnector connector) {
    return connector.getLocalPort();
}

[Buggy Hunk]
return connector.getLocalPort();

[Patch]
return (connector.getPort()!=0)?connector.getPort():connector.getLocalPort();

[Demonstration 3]

[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());