#vulnerable code 
                                public void testEncodingAttributeXML() throws Exception {
        final InputStream is = new ByteArrayInputStream(ENCODING_ATTRIBUTE_XML.getBytes());
        final XmlReader xmlReader = new XmlReader(is, "", true);
        assertEquals(xmlReader.getEncoding(), "UTF-8");
    } 
                            #location 4 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public void testEncodingAttributeXML() throws Exception {
        final InputStream is = new ByteArrayInputStream(ENCODING_ATTRIBUTE_XML.getBytes());
        final XmlReader xmlReader = new XmlReader(is, "", true);
        assertEquals(xmlReader.getEncoding(), "UTF-8");
        xmlReader.close();
    }