[Demonstration 1]

[Buggy Method]
@Override
public void process(AuthSuccess authSuccess, Identity id) throws MessageException {
    String nick = null;
    String fullName = null;
    String email = null;
    try {
        SRegResponse sr = getMessageAs(SRegResponse.class, authSuccess, SRegMessage.OPENID_NS_SREG);
        nick = sr.getAttributeValue("nickname");
        fullName = sr.getAttributeValue("fullname");
        email = sr.getAttributeValue("email");
    } catch (MessageException e) {
        // ignore as this is a failure to sign sreg
    }
    try {
        FetchResponse fr = getMessageAs(FetchResponse.class, authSuccess, AxMessage.OPENID_NS_AX);
        if (fr != null) {
            if (fullName == null) {
                String first = fr.getAttributeValue("firstName");
                String last = fr.getAttributeValue("lastName");
                if (first != null & last != null) {
                    fullName = first + " " + last;
                }
            }
            if (email == null)
                email = fr.getAttributeValue("email");
            if (email == null)
                email = fr.getAttributeValue("email2");
            if (email == null)
                email = fr.getAttributeValue("email3");
            if (nick == null)
                nick = fr.getAttributeValue("nickName");
        }
    } catch (MessageException e) {
        // if the process doesn't contain AX information, ignore. Maybe this is a bug in openid4java?
        // "0x100: Invalid value for attribute exchange mode: null"
    }
    if (nick != null) {
        id.setNick(nick);
    }
    if (fullName != null) {
        id.setFullName(fullName);
    }
    if (email != null) {
        id.setEmail(email);
    }
}

[Buggy Hunk]
if (first != null & last != null) {

[Patch]
if (first != null && last != null) {

[Demonstration 2]

[Buggy Method]
protected static byte[] readBody(byte[] bodyBuffer, InputStream is, long contentLength) throws WebException {
    int numRead = 0;
    int startIndex = 0;
    int maxIntake = 1;
    //Loop conditions: Stop when buffer is filled without reaching contentLength, we timeout, or contentLength is reached
    while (startIndex < bodyBuffer.length && startIndex < contentLength) {
        try {
            //read one additional value into the buffer in the correct position
            numRead = is.read(bodyBuffer, startIndex, maxIntake);
        } catch (IOException e) {
            //If IO error, throw exception
            throw new HeaderIOException("IO exception reading HTTP message body");
        }
        if (numRead == -1) {
            //If end of stream reached
            throw new SocketClosedException("End of stream reached while reading message body");
        } else {
            //Byte was successfully read
            //Move index to insert next value up by one
            startIndex++;
        }
    }
    //If we left loop because we successfully read everything
    if (startIndex >= bodyBuffer.length) {
        throw new BufferOverflow("Buffer overflow while reading HTTP message body");
    }
    return bodyBuffer;
}

[Buggy Hunk]
protected static byte[] readBody(byte[] bodyBuffer, InputStream is, long contentLength) throws WebException{

[Patch]
public static byte[] readBody(byte[] bodyBuffer, InputStream is, long contentLength) throws WebException{

[Demonstration 3]

[Buggy Method]
private static void addDatasetEntry(DefaultCategoryDataset dataset, PollingDetailDTO dto) {
    Properties props = EMSUtility.loadProperties(dto.getUnitresponse());
    logger.trace("Unit response : {} Device Reading : {}", dto.getUnitresponse(), dto.getDeviceReading());
    for (Entry<Object, Object> entry : props.entrySet()) {
        String seriesName = dto.getDeviceReading().getProperty(String.valueOf(Integer.valueOf(entry.getKey().toString())));
        logger.trace("Reading: {} Series : {} Time : {}", entry.getValue().toString(), seriesName, dto.getFormattedDate());
        // Skip memory mapping record whose value is "NoMap"
        if (seriesName != null && !EmsConstants.NO_MAP.equalsIgnoreCase(seriesName.trim())) {
            try {
                dataset.addValue(Float.parseFloat(entry.getValue().toString()), /* Reading */
                seriesName, /* Series name */
                dto.getFormattedDate());
            } catch (Exception e) {
                logger.error("{}", e);
            }
        }
    }
}

[Buggy Hunk]
.getProperty(String.valueOf(Integer.valueOf(entry.getKey().toString())));

[Patch]
.getProperty(String.valueOf(entry.getKey().toString()));