#vulnerable code 
                             public static void main(String[] args){
	    
	    FullAPI test = null;
	    
	    ProblemSet ps = new ProblemSet();
	    File parent = new File("/Users/tdutko200/git/jstylo/jsan_resources/corpora/drexel_1");
        try {
            for (File author : parent.listFiles()) {
                if (!author.getName().equalsIgnoreCase(".DS_Store")) {
                    for (File document : author.listFiles()) {
                        if (!document.getName().equalsIgnoreCase(".DS_Store")) {
                            Document doc = new StringDocument(toDeleteGetStringFromFile(document), author.getName(),document.getName());
                            doc.load();
                            ps.addTrainDoc(author.getName(), doc);
                        }
                    }
                }
            }
        } catch (Exception e) {
            LOG.error("Womp womp.",e);
            System.exit(1);
        }
	    
        try {
            test = new FullAPI.Builder()
                    .cfdPath("jsan_resources/feature_sets/writeprints_feature_set_limited.xml")
                    .ps(ps)
                    .setAnalyzer(new WekaAnalyzer())
                    .numThreads(1).analysisType(analysisType.CROSS_VALIDATION).useCache(false).chunkDocs(false)
                    .loadDocContents(true)
                    .build();
        } catch (Exception e) {
            e.printStackTrace();
            System.err.println("Failed to intialize API, exiting...");
            System.exit(1);
        }

		test.prepareInstances();
		test.calcInfoGain();
		//test.applyInfoGain(5);
		test.run();
		System.out.println(test.getStatString());
		System.out.println(test.getReadableInfoGain(false));
		System.out.println(test.getResults().toJson().toString());
		//System.out.println(test.getClassificationAccuracy());
		//System.out.println(test.getStatString());
	} 
                            #location 8 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             public static void main(String[] args){
	    
	    FullAPI test = null;
	    
        try {
            test = new FullAPI.Builder()
                    .cfdPath("jsan_resources/feature_sets/writeprints_feature_set_limited.xml")
                    .psPath("jsan_resources/problem_sets/drexel_1_train_test.xml")
                    .setAnalyzer(new SparkAnalyzer())
                    .numThreads(1).analysisType(analysisType.TRAIN_TEST_KNOWN).useCache(false).chunkDocs(false)
                    .loadDocContents(true)
                    .build();
        } catch (Exception e) {
            e.printStackTrace();
            System.err.println("Failed to intialize API, exiting...");
            System.exit(1);
        }

		test.prepareInstances();
		test.calcInfoGain();
		//test.applyInfoGain(5);
		test.run();
		System.out.println(test.getStatString());
		System.out.println(test.getReadableInfoGain(false));
		System.out.println(test.getResults().toJson().toString());
		//System.out.println(test.getClassificationAccuracy());
		//System.out.println(test.getStatString());
	}