#vulnerable code 
                                public static List<String> find(String staticResourcesFolder) throws Exception {
        CodeSource src = ServerLauncher.class.getProtectionDomain().getCodeSource();
        List<String> staticResources = new ArrayList<>();

        if (src != null) {
            URL jar = src.getLocation();
            ZipInputStream zip = new ZipInputStream(jar.openStream());
            ZipEntry ze;

            while((ze = zip.getNextEntry()) != null) {
                String entryName = ze.getName();
                if (entryName.startsWith(staticResourcesFolder) &&
                               (entryName.endsWith(".js") ||
                                entryName.endsWith(".css") ||
                                entryName.endsWith(".html")) ||
                                entryName.endsWith(".ico") ||
                                entryName.endsWith(".png")) {
                    staticResources.add(entryName);
                }
            }
        }

        return staticResources;
    } 
                            #location 23 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public static List<String> find(String staticResourcesFolder) throws Exception {
        CodeSource src = ServerLauncher.class.getProtectionDomain().getCodeSource();
        List<String> staticResources = new ArrayList<>();

        if (src != null) {
            URL jar = src.getLocation();
            try (ZipInputStream zip = new ZipInputStream(jar.openStream())) {
                ZipEntry ze;

                while ((ze = zip.getNextEntry()) != null) {
                    String entryName = ze.getName();
                    if (entryName.startsWith(staticResourcesFolder) &&
                            (entryName.endsWith(".js") ||
                                    entryName.endsWith(".css") ||
                                    entryName.endsWith(".html")) ||
                            entryName.endsWith(".ico") ||
                            entryName.endsWith(".png")) {
                        staticResources.add(entryName);
                    }
                }
            }
        }

        return staticResources;
    }