<commit_before>package vorquel.mod.simpleskygrid.asm;

import com.google.common.collect.Sets;
import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper;
import org.objectweb.asm.ClassReader;
import vorquel.mod.simpleskygrid.helper.Log;

import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

class SuperClassMap {
    
    private boolean useNotchNames;
    private Set<String> toMatch;
    private Map<String, Set<String>> map = new HashMap<>();
    
    SuperClassMap(boolean useNotchNames, String... toMatch) {
        this.useNotchNames = useNotchNames;
        this.toMatch = Sets.newHashSet(toMatch);
    }
    
    Set<String> get(String className) {
        className = getGoodClassName(className);
        if(map.containsKey(className))
            return map.get(className);
        else {
            InputStream classStream = this.getClass().getClassLoader().getResourceAsStream(className + ".class");
            Set<String> matching = Sets.newHashSet();
            if(toMatch.contains(className))
                matching.add(className);
            try {
                String superClassName = new ClassReader(classStream).getSuperName();
                classStream.close();
                if(superClassName != null)
                    matching.addAll(get(superClassName));
            } catch (IOException e) {
                Log.error("Exception determining superclass of %s: %s", className, e.getMessage());
            }
            map.put(className, matching);
            return matching;
        }
    }
    
    private String getGoodClassName(String className) {
        if(className.indexOf('.') != -1)
            className = className.replace('.', '/');
        if(useNotchNames)
            return FMLDeobfuscatingRemapper.INSTANCE.unmap(className);
        else
            return className;
    }
}<commit_msg>Fix coremod in non-dev environment<commit_after>package vorquel.mod.simpleskygrid.asm;

import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper;
import org.objectweb.asm.ClassReader;
import vorquel.mod.simpleskygrid.helper.Log;

import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

class SuperClassMap {
    
    private boolean useNotchNames;
    private Map<String, String> toMatch;
    private Map<String, Set<String>> map = new HashMap<>();
    
    SuperClassMap(boolean useNotchNames, String... toMatch) {
        this.useNotchNames = useNotchNames;
        this.toMatch = Maps.newHashMap();
        for(String className : toMatch) {
            this.toMatch.put(getGoodClassName(className), className);
        }
    }
    
    Set<String> get(String className) {
        className = getGoodClassName(className);
        if(map.containsKey(className))
            return map.get(className);
        else {
            InputStream classStream = this.getClass().getClassLoader().getResourceAsStream(className + ".class");
            Set<String> matching = Sets.newHashSet();
            if(toMatch.containsKey(className))
                matching.add(toMatch.get(className));
            try {
                String superClassName = new ClassReader(classStream).getSuperName();
                classStream.close();
                if(superClassName != null)
                    matching.addAll(get(superClassName));
            } catch (IOException e) {
                Log.error("Exception determining superclass of %s: %s", className, e.getMessage());
            }
            map.put(className, matching);
            return matching;
        }
    }
    
    private String getGoodClassName(String className) {
        if(className.indexOf('.') != -1)
            className = className.replace('.', '/');
        if(useNotchNames)
            return FMLDeobfuscatingRemapper.INSTANCE.unmap(className);
        else
            return className;
    }
}
{'fraction_non_alphanumeric': 0.10980103168754606, 'fraction_numerical': 0.0004912797838368951, 'mean_word_length': 2.4863013698630136, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '5627903', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1109, 'n_words': 208}