#fixed code
                                public static void clearDirectiory(String dir) {
        File dirFile = new File(dir);
        for (File file : Objects.requireNonNull(dirFile.listFiles())) {
            file.delete();
        }

    }
#vulnerable code 
                                public static void clearDirectiory(String dir) {
        File dirFile = new File(dir);
        for (File file : dirFile.listFiles()) {
            file.delete();
        }

    } 
                            #location 3 
                            #vulnerability type NULL_DEREFERENCE