<commit_before>package org.ldg.mcpd;

import org.objectweb.asm.*;
import org.objectweb.asm.commons.*;
import java.io.*;
import java.util.*;

public class Remapper extends org.objectweb.asm.commons.Remapper implements ClassHandler {
    List<String> exemptions;
    InheritanceGraph inheritance;
    String default_package = null;
    Map<String, String> packages = new HashMap<String, String>();
    Map<String, String> classes = new HashMap<String, String>();
    Map<String, String> fields = new HashMap<String, String>();
    Map<String, String> methods = new HashMap<String, String>();

    public Remapper(File configfile, List<String> exclude, InheritanceGraph inheritanceGraph, boolean invert) throws IOException {
        exemptions = exclude;
        if (exemptions == null) {
            exemptions = new ArrayList<String>();
        }
        inheritance = inheritanceGraph;

        FileInputStream fis = new FileInputStream(configfile);
        InputStreamReader isr = new InputStreamReader(fis);
        BufferedReader config = new BufferedReader(isr);

        String line = config.readLine();
        while (line != null) {
            String[] pieces = line.trim().split(" ");

            if (pieces[0].equals("PK:")) {
                if (pieces.length != 3) {
                    System.out.println("Bad config line: " + line);
                }

                String sourcePackage = pieces[1];
                String destPackage = pieces[2];
                if (invert) {
                    sourcePackage = pieces[2];
                    destPackage = pieces[1];
                }

                if (sourcePackage.equals(".")) {
                    default_package = destPackage;
                } else {
                    packages.put(sourcePackage, destPackage);
                }
            } else if (pieces[0].equals("CL:")) {
                if (pieces.length != 3) {
                    System.out.println("Bad config line: " + line);
                }

                String sourceClass = pieces[1];
                String destClass = pieces[2];
                if (invert) {
                    sourceClass = pieces[2];
                    destClass = pieces[1];
                }<commit_msg>Ignore comments at the end of a retroguard config line.<commit_after>package org.ldg.mcpd;

import org.objectweb.asm.*;
import org.objectweb.asm.commons.*;
import java.io.*;
import java.util.*;

public class Remapper extends org.objectweb.asm.commons.Remapper implements ClassHandler {
    List<String> exemptions;
    InheritanceGraph inheritance;
    String default_package = null;
    Map<String, String> packages = new HashMap<String, String>();
    Map<String, String> classes = new HashMap<String, String>();
    Map<String, String> fields = new HashMap<String, String>();
    Map<String, String> methods = new HashMap<String, String>();

    public Remapper(File configfile, List<String> exclude, InheritanceGraph inheritanceGraph, boolean invert) throws IOException {
        exemptions = exclude;
        if (exemptions == null) {
            exemptions = new ArrayList<String>();
        }
        inheritance = inheritanceGraph;

        FileInputStream fis = new FileInputStream(configfile);
        InputStreamReader isr = new InputStreamReader(fis);
        BufferedReader config = new BufferedReader(isr);

        String line = config.readLine();
        while (line != null) {
            line = line.split("#")[0];
            String[] pieces = line.trim().split(" ");

            if (pieces[0].equals("PK:")) {
                if (pieces.length != 3) {
                    System.out.println("Bad config line: " + line);
                }

                String sourcePackage = pieces[1];
                String destPackage = pieces[2];
                if (invert) {
                    sourcePackage = pieces[2];
                    destPackage = pieces[1];
                }

                if (sourcePackage.equals(".")) {
                    default_package = destPackage;
                } else {
                    packages.put(sourcePackage, destPackage);
                }
            } else if (pieces[0].equals("CL:")) {
                if (pieces.length != 3) {
                    System.out.println("Bad config line: " + line);
                }

                String sourceClass = pieces[1];
                String destClass = pieces[2];
                if (invert) {
                    sourceClass = pieces[2];
                    destClass = pieces[1];
                }
{'fraction_non_alphanumeric': 0.11160026414263702, 'fraction_numerical': 0.00550297160466652, 'mean_word_length': 1.8560653676932746, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '4216199', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1101, 'n_words': 291}