#vulnerable code 
                                public ClassFile getClassFile2() {
        if (classfile != null)
            return classfile;

        try {
            byte[] b = classPool.readSource(getName());
            DataInputStream dis
                = new DataInputStream(new ByteArrayInputStream(b));
            return (classfile = new ClassFile(dis));
        }
        catch (NotFoundException e) {
            throw new RuntimeException(e.toString());
        }
        catch (IOException e) {
            throw new RuntimeException(e.toString());
        }
        catch (CannotCompileException e) {
            throw new RuntimeException(e.toString());
        }
    } 
                            #location 9 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public ClassFile getClassFile2() {
        if (classfile != null)
            return classfile;

        InputStream fin = null;
        try {
            fin = classPool.openClassfile(getName());
            if (fin == null)
                throw new NotFoundException(getName());

            classfile = new ClassFile(new DataInputStream(fin));
            return classfile;
        }
        catch (NotFoundException e) {
            throw new RuntimeException(e.toString());
        }
        catch (IOException e) {
            throw new RuntimeException(e.toString());
        }
        finally {
            if (fin != null)
                try {
                    fin.close();
                }
                catch (IOException e) {}
        }
    }