<commit_before>package org.nidget.eclipse.djeclipse.decompilers.cfr;

import org.benf.cfr.reader.entities.ClassFile;
import org.benf.cfr.reader.util.CannotLoadClassException;
import org.benf.cfr.reader.util.ConfusedCFRException;
import org.benf.cfr.reader.util.getopt.BadParametersException;
import org.benf.cfr.reader.util.getopt.CFRState;
import org.benf.cfr.reader.util.getopt.GetOptParser;
import org.benf.cfr.reader.util.output.Dumper;
import org.benf.cfr.reader.util.output.ToStringDumper;
import org.eclipse.core.runtime.IPath;
import org.nidget.eclipse.djeclipse.decompilers.exceptions.DecompilerException;

public class CFRDecompiler {

	public static String decompile(IPath jarPath, IPath classPath) {
		String classPathStr = classPath.toString();
		GetOptParser getOptParser = new GetOptParser();

		try {
			CFRState params = (CFRState) getOptParser.parse(new String[] {classPathStr}, CFRState.getFactory());
			ClassFile c = params.getClassFileMaybePath(classPathStr, false);

			params.setClassFileVersion(c.getClassFileVersion());

			try {
				c = params.getClassFile(c.getClassType(), true);
			} catch (CannotLoadClassException e) {
			}

			c.analyseTop(params);
			Dumper result = new ToStringDumper();
			String methname = params.getMethodName();
			if (methname == null) {
				c.dump(result);
			} else {
				try {
					c.getMethodByName(methname).dump(result, true);
				} catch (NoSuchMethodException e) {
					throw new BadParametersException("No such method '"
							+ methname + "'.", CFRState.getFactory());
				}
			}
			return result.toString();
		} catch (CannotLoadClassException clce) {
			throw new DecompilerException(clce);
		} catch (BadParametersException bpe) {
			throw new DecompilerException(bpe); 
		} catch (ConfusedCFRException ccfre) {
			throw new DecompilerException(ccfre);
		}
	}
}<commit_msg>Updated CFR to version 0.38<commit_after>package org.nidget.eclipse.djeclipse.decompilers.cfr;

import org.benf.cfr.reader.entities.ClassFile;
import org.benf.cfr.reader.entities.Method;
import org.benf.cfr.reader.util.CannotLoadClassException;
import org.benf.cfr.reader.util.ConfusedCFRException;
import org.benf.cfr.reader.util.getopt.BadParametersException;
import org.benf.cfr.reader.util.getopt.CFRState;
import org.benf.cfr.reader.util.getopt.GetOptParser;
import org.benf.cfr.reader.util.output.Dumper;
import org.benf.cfr.reader.util.output.ToStringDumper;
import org.eclipse.core.runtime.IPath;
import org.nidget.eclipse.djeclipse.decompilers.exceptions.DecompilerException;

public class CFRDecompiler {

	public static String decompile(IPath jarPath, IPath classPath) {
		String classPathStr = classPath.toString();
		GetOptParser getOptParser = new GetOptParser();

		try {
			CFRState params = (CFRState)getOptParser.parse(new String[] {classPathStr}, CFRState.getFactory());
			ClassFile c = params.getClassFileMaybePath(params.getFileName());

			params.setClassFileVersion(c.getClassFileVersion());
			try {
				c = params.getClassFile(c.getClassType());
				if (params.analyseInnerClasses()) {
					 c.loadInnerClasses(params);
				}
			} catch (CannotLoadClassException e) {
			}

			c.analyseTop(params);
			Dumper result = new ToStringDumper();
			String methname = params.getMethodName();
			if (methname == null) {
				c.dump(result);
			} else {
				try {
					for (Method method : c.getMethodByName(methname)) {
						method.dump(result, true);
					}
				} catch (NoSuchMethodException e) {
					throw new BadParametersException("No such method '"
							+ methname + "'.", CFRState.getFactory());
				}
			}
			return result.toString();
		} catch (CannotLoadClassException clce) {
			throw new DecompilerException(clce);
		} catch (BadParametersException bpe) {
			throw new DecompilerException(bpe); 
		} catch (ConfusedCFRException ccfre) {
			throw new DecompilerException(ccfre);
		}
	}
}
{'fraction_non_alphanumeric': 0.11752523945120373, 'fraction_numerical': 0.000776598498576236, 'mean_word_length': 4.527896995708154, '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': '4945896', 'n_tokens_mistral': 1425, 'n_tokens_neox': 1257, 'n_words': 220}