<commit_before>
package polyglot.util.typedump;

import polyglot.util.*;
import polyglot.util.CodeWriter;
import polyglot.types.*;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Date;
import java.util.Map;
import java.util.Set;

class TypeDumper {
    static Set dontExpand;
    static {
	Object[] primitiveLike = {
	    Void.class,
	    Boolean.class,
	    Short.class,
	    Integer.class,
	    Long.class,
	    Float.class,
	    Double.class,
	    Class.class,
	    String.class,
	};
	dontExpand =
	    new java.util.HashSet(java.util.Arrays.asList(primitiveLike));
    }

    TypeObject theType;
    String rawName;
    String compilerVersion;
    Date timestamp;
    TypeDumper(String rawName, TypeObject t, String compilerVersion,
	       Long timestamp) {
	theType = t;
	this.rawName = rawName;
	this.compilerVersion = compilerVersion;
	this.timestamp = new Date(timestamp.longValue());
    }
    
    public static TypeDumper load(String name, TypeSystem ts)
	throws ClassNotFoundException, NoSuchFieldException, 
	       java.io.IOException, SecurityException
    {
	Class c = Class.forName(name);
	try {
	    Field jlcVersion = c.getDeclaredField("jlc$CompilerVersion");
	    Field jlcTimestamp = c.getDeclaredField("jlc$SourceLastModified");
	    Field jlcType = c.getDeclaredField("jlc$ClassType");
	    String t = (String)jlcType.get(null);
	    TypeEncoder te = new TypeEncoder(ts);
	    return new TypeDumper(name,
				  te.decode(t),
				  (String)jlcVersion.get(null),
				  (Long)jlcTimestamp.get(null));
	} catch (IllegalAccessException exn) {
	    throw new SecurityException("illegal access: "+exn.getMessage());
	}
    }

    public void dump(CodeWriter w) {
	Map cache = new java.util.HashMap();<commit_msg>Fixed a compile bug.<commit_after>
package polyglot.util.typedump;

import polyglot.util.*;
import polyglot.util.CodeWriter;
import polyglot.types.*;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Date;
import java.util.Map;
import java.util.Set;

class TypeDumper {
    static Set dontExpand;
    static {
	Object[] primitiveLike = {
	    Void.class,
	    Boolean.class,
	    Short.class,
	    Integer.class,
	    Long.class,
	    Float.class,
	    Double.class,
	    Class.class,
	    String.class,
	};
	dontExpand =
	    new java.util.HashSet(java.util.Arrays.asList(primitiveLike));
    }

    TypeObject theType;
    String rawName;
    String compilerVersion;
    Date timestamp;
    TypeDumper(String rawName, TypeObject t, String compilerVersion,
	       Long timestamp) {
	theType = t;
	this.rawName = rawName;
	this.compilerVersion = compilerVersion;
	this.timestamp = new Date(timestamp.longValue());
    }
    
    public static TypeDumper load(String name, TypeSystem ts)
	throws ClassNotFoundException, NoSuchFieldException, 
	       java.io.IOException, SecurityException
    {
	Class c = Class.forName(name);
	try {
	    Field jlcVersion = c.getDeclaredField("jlc$CompilerVersion");
	    Field jlcTimestamp = c.getDeclaredField("jlc$SourceLastModified");
	    Field jlcType = c.getDeclaredField("jlc$ClassType");
	    String t = (String)jlcType.get(null);
	    TypeEncoder te = new TypeEncoder(ts);
	    return new TypeDumper(name,
				  te.decode(t, name),
				  (String)jlcVersion.get(null),
				  (Long)jlcTimestamp.get(null));
	} catch (IllegalAccessException exn) {
	    throw new SecurityException("illegal access: "+exn.getMessage());
	}
    }

    public void dump(CodeWriter w) {
	Map cache = new java.util.HashMap();
{'fraction_non_alphanumeric': 0.11001410437235543, 'fraction_numerical': 0.0, 'mean_word_length': 3.5229591836734695, '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': '7475990', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1115, 'n_words': 239}