<commit_before>package dynsem.strategies;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

import org.spoofax.interpreter.core.Tools;
import org.spoofax.interpreter.terms.IStrategoString;
import org.spoofax.interpreter.terms.IStrategoTerm;
import org.strategoxt.lang.Context;
import org.strategoxt.lang.Strategy;

public class read_property_0_3 extends Strategy {

	public static read_property_0_3 instance = new read_property_0_3();

	@Override
	public IStrategoTerm invoke(Context context, IStrategoTerm current,
			IStrategoTerm projectpath, IStrategoTerm tpropname,
			IStrategoTerm defaultvalue) {

		if (!(current instanceof IStrategoString)) {
			return null;
		}
		if (!(projectpath instanceof IStrategoString)) {
			return null;
		}
		if (!(tpropname instanceof IStrategoString)) {
			return null;
		}
		if (!(defaultvalue instanceof IStrategoString)) {
			return null;
		}

		Properties prop = new Properties();

		File propfile = new File(Tools.javaString(current));
		if (!(propfile.exists() && propfile.canRead())) {
			System.out.println("Hello 1");
			return defaultvalue;
		}

		try {
			prop.load(new FileInputStream(propfile));
		} catch (IOException e) {
			context.getIOAgent().printError(e.getMessage());
			return null;
		}

		String propval = prop.getProperty(Tools.javaString(tpropname));

		if (propval == null) {
			System.out.println("Hello 2");
			return defaultvalue;
		}

		File projectdir = new File(Tools.javaString(projectpath));

		if (!new File(propval).isAbsolute()) {
			propval = new File(projectdir, propval).getAbsolutePath();
		}

		return context.getFactory().makeString(propval);
	}<commit_msg>Remove silly stdouts from native java strategy<commit_after>package dynsem.strategies;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

import org.spoofax.interpreter.core.Tools;
import org.spoofax.interpreter.terms.IStrategoString;
import org.spoofax.interpreter.terms.IStrategoTerm;
import org.strategoxt.lang.Context;
import org.strategoxt.lang.Strategy;

public class read_property_0_3 extends Strategy {

	public static read_property_0_3 instance = new read_property_0_3();

	@Override
	public IStrategoTerm invoke(Context context, IStrategoTerm current,
			IStrategoTerm projectpath, IStrategoTerm tpropname,
			IStrategoTerm defaultvalue) {

		if (!(current instanceof IStrategoString)) {
			return null;
		}
		if (!(projectpath instanceof IStrategoString)) {
			return null;
		}
		if (!(tpropname instanceof IStrategoString)) {
			return null;
		}
		if (!(defaultvalue instanceof IStrategoString)) {
			return null;
		}

		Properties prop = new Properties();

		File propfile = new File(Tools.javaString(current));
		if (!(propfile.exists() && propfile.canRead())) {
			return defaultvalue;
		}

		try {
			prop.load(new FileInputStream(propfile));
		} catch (IOException e) {
			context.getIOAgent().printError(e.getMessage());
			return null;
		}

		String propval = prop.getProperty(Tools.javaString(tpropname));

		if (propval == null) {
			return defaultvalue;
		}

		File projectdir = new File(Tools.javaString(projectpath));

		if (!new File(propval).isAbsolute()) {
			propval = new File(projectdir, propval).getAbsolutePath();
		}

		return context.getFactory().makeString(propval);
	}
{'fraction_non_alphanumeric': 0.11292719167904904, 'fraction_numerical': 0.004160475482912333, 'mean_word_length': 4.8336221837088384, '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': '1215732', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1066, 'n_words': 232}