#fixed code
                             public void testArUnarchive() throws Exception {
		final File output = new File(dir, "bla.ar");
		{
			final File file1 = getFile("test1.xml");
			final File file2 = getFile("test2.xml");
			
			final OutputStream out = new FileOutputStream(output);
	        final ArchiveOutputStream os = new ArchiveStreamFactory().createArchiveOutputStream("ar", out);
			os.putArchiveEntry(new ArArchiveEntry("test1.xml", file1.length()));
			IOUtils.copy(new FileInputStream(file1), os);
			os.closeArchiveEntry();
			
			os.putArchiveEntry(new ArArchiveEntry("test2.xml", file2.length()));
			IOUtils.copy(new FileInputStream(file2), os);
			os.closeArchiveEntry();
			os.close();
			out.close();
		}
		
		// UnArArchive Operation
		final File input = output;
		final InputStream is = new FileInputStream(input);
		final ArchiveInputStream in = new ArchiveStreamFactory().createArchiveInputStream("ar", is);
		final ArArchiveEntry entry = (ArArchiveEntry)in.getNextEntry();
		
		File target = new File(dir, entry.getName());
        final OutputStream out = new FileOutputStream(target);
        
        IOUtils.copy(in, out);
    
        out.close();
        in.close();
        is.close();
	}
#vulnerable code 
                             public void testArUnarchive() throws Exception {
		final File output = new File(dir, "bla.ar");
		{
			final File file1 = getFile("test1.xml");
			final File file2 = getFile("test2.xml");
			
			final OutputStream out = new FileOutputStream(output);
	        final ArchiveOutputStream os = new ArchiveStreamFactory().createArchiveOutputStream("ar", out);
			os.putArchiveEntry(new ArArchiveEntry("test1.xml", file1.length()));
			IOUtils.copy(new FileInputStream(file1), os);
			os.closeArchiveEntry();
			
			os.putArchiveEntry(new ArArchiveEntry("test2.xml", file2.length()));
			IOUtils.copy(new FileInputStream(file2), os);
			os.closeArchiveEntry();
			os.close();
		}
		
		// UnArArchive Operation
		final File input = output;
		final InputStream is = new FileInputStream(input);
		final ArchiveInputStream in = new ArchiveStreamFactory().createArchiveInputStream("ar", is);
		final ArArchiveEntry entry = (ArArchiveEntry)in.getNextEntry();
		
		File target = new File(dir, entry.getName());
        final OutputStream out = new FileOutputStream(target);
        
        IOUtils.copy(in, out);
    
        out.close();
        in.close();
	} 
                            #location 31 
                            #vulnerability type RESOURCE_LEAK