<commit_before>package soot.javaToJimple;
import polyglot.main.*;
import polyglot.frontend.*;
import polyglot.util.*;
import polyglot.visit.*;
import polyglot.ast.*;

import java.util.*;
import java.io.*;

public class JavaToJimple {
	
    public static final polyglot.frontend.Pass.ID CAST_INSERTION = new polyglot.frontend.Pass.ID("cast-insertion");
    public static final polyglot.frontend.Pass.ID SAVE_AST = new polyglot.frontend.Pass.ID("save-ast");
    
    /**
     * sets up the info needed to invoke polyglot
     */
	public polyglot.frontend.ExtensionInfo initExtInfo(String fileName, List sourceLocations){
		
        Set source = new HashSet();
        ExtensionInfo extInfo = new soot.javaToJimple.jj.ExtensionInfo() {
            public List passes(Job job) {
                List passes = super.passes(job);
                beforePass(passes, Pass.TYPE_CHECK, new VisitorPass(polyglot.frontend.Pass.FOLD, job, new polyglot.visit.ConstantFolder(ts, nf)));
                beforePass(passes, Pass.EXIT_CHECK, new VisitorPass(CAST_INSERTION, job, new CastInsertionVisitor(job, ts, nf)));
                afterPass(passes, Pass.PRE_OUTPUT_ALL, new SaveASTVisitor(SAVE_AST, job, this));
                removePass(passes, Pass.OUTPUT);
                return passes;
            }
            
        };
        polyglot.main.Options options = extInfo.getOptions();

        options.assertions = true;
        options.source_path = new LinkedList();
        Iterator it = sourceLocations.iterator();
        while (it.hasNext()){
            Object next = it.next();
            options.source_path.add(new File(next.toString()));
        }

        options.source_ext = "java";
		options.serialize_type_info = false;
		
		source.add(fileName);
		
		options.source_path.add(new File(fileName).getParentFile());
		
        polyglot.main.Options.global = options;

        return extInfo;
    }
	
    /**<commit_msg>- update source_ext to match latest polyglot (with string array instead of string)<commit_after>package soot.javaToJimple;
import polyglot.main.*;
import polyglot.frontend.*;
import polyglot.util.*;
import polyglot.visit.*;
import polyglot.ast.*;

import java.util.*;
import java.io.*;

public class JavaToJimple {
	
    public static final polyglot.frontend.Pass.ID CAST_INSERTION = new polyglot.frontend.Pass.ID("cast-insertion");
    public static final polyglot.frontend.Pass.ID SAVE_AST = new polyglot.frontend.Pass.ID("save-ast");
    
    /**
     * sets up the info needed to invoke polyglot
     */
	public polyglot.frontend.ExtensionInfo initExtInfo(String fileName, List sourceLocations){
		
        Set source = new HashSet();
        ExtensionInfo extInfo = new soot.javaToJimple.jj.ExtensionInfo() {
            public List passes(Job job) {
                List passes = super.passes(job);
                beforePass(passes, Pass.TYPE_CHECK, new VisitorPass(polyglot.frontend.Pass.FOLD, job, new polyglot.visit.ConstantFolder(ts, nf)));
                beforePass(passes, Pass.EXIT_CHECK, new VisitorPass(CAST_INSERTION, job, new CastInsertionVisitor(job, ts, nf)));
                afterPass(passes, Pass.PRE_OUTPUT_ALL, new SaveASTVisitor(SAVE_AST, job, this));
                removePass(passes, Pass.OUTPUT);
                return passes;
            }
            
        };
        polyglot.main.Options options = extInfo.getOptions();

        options.assertions = true;
        options.source_path = new LinkedList();
        Iterator it = sourceLocations.iterator();
        while (it.hasNext()){
            Object next = it.next();
            options.source_path.add(new File(next.toString()));
        }

        options.source_ext = new String []{"java"};
		options.serialize_type_info = false;
		
		source.add(fileName);
		
		options.source_path.add(new File(fileName).getParentFile());
		
        polyglot.main.Options.global = options;

        return extInfo;
    }
	
    /**
{'fraction_non_alphanumeric': 0.11153455284552846, 'fraction_numerical': 0.0, 'mean_word_length': 2.700187969924812, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3092107', 'n_tokens_mistral': 1203, 'n_tokens_neox': 1143, 'n_words': 250}