#fixed code
                                private void handleGcStart(XMLEventReader eventReader, StartElement startElement, GCEvent event) throws XMLStreamException {
        event.setType(Type.lookup(getAttributeValue(startElement, "type")));
        if (event.getExtendedType() == null) {
            LOG.warning("could not determine type of event " + startElement.toString());
            return;
        }
        
        String currentElementName = "";
        while (eventReader.hasNext() && !currentElementName.equals(GC_START)) {
            
            XMLEvent xmlEvent = eventReader.nextEvent();
            if (xmlEvent.isStartElement()) {
                StartElement startEl = xmlEvent.asStartElement();
                if (startEl.getName().getLocalPart().equals("mem-info")) {
                    setTotalAndPreUsed(event, startEl);
                }
                else if (startEl.getName().getLocalPart().equals("mem")) {
                    switch (getAttributeValue(startEl, "type")) {
                        case "nursery":
                            GCEvent young = new GCEvent();
                            young.setType(Type.lookup("nursery"));
                            setTotalAndPreUsed(young, startEl);
                            event.add(young);
                            break;
                        case "tenure":
                            GCEvent tenured = new GCEvent();
                            tenured.setType(Type.lookup("tenure"));
                            setTotalAndPreUsed(tenured, startEl);
                            event.add(tenured);
                            break;
                        // all other are ignored
                    }
                }
            }
            else if (xmlEvent.isEndElement()) {
                EndElement endElement = xmlEvent.asEndElement();
                currentElementName = endElement.getName().getLocalPart();
            }
        }
    }
#vulnerable code 
                                private void handleGcStart(XMLEventReader eventReader, StartElement startElement, GCEvent event) throws XMLStreamException {
        event.setType(Type.lookup(getAttributeValue(startElement, "type")));
        if (event.getExtendedType() == null) {
            LOG.warning("could not determine type of event " + startElement.toString());
            return;
        }
        
        String currentElementName = "";
        while (eventReader.hasNext() && !currentElementName.equals(GC_START)) {
            
            XMLEvent xmlEvent = eventReader.nextEvent();
            if (xmlEvent.isStartElement()) {
                StartElement startEl = xmlEvent.asStartElement();
                if (startEl.getName().getLocalPart().equals("mem-info")) {
                    event.setTotal(NumberParser.parseInt(getAttributeValue(startEl, "total")) / 1024);
                    event.setPreUsed(event.getTotal() - (NumberParser.parseInt(getAttributeValue(startEl, "free")) / 1024));
                }
                else if (startEl.getName().getLocalPart().equals("mem")) {
                    switch (getAttributeValue(startEl, "type")) {
                        case "nursery":
                            // TODO read young
                            break;
                    }
                }
            }
            else if (xmlEvent.isEndElement()) {
                EndElement endElement = xmlEvent.asEndElement();
                currentElementName = endElement.getName().getLocalPart();
            }
        }
    } 
                            #location 15 
                            #vulnerability type NULL_DEREFERENCE