<commit_before>
package orc.run.porce.runtime;

import scala.Function1;

import orc.Accessor;
import orc.NoSuchMemberAccessor;
import orc.OrcRuntime;
import orc.run.porce.distrib.DOrcMarshalingReplacement;
import orc.values.Field;
import orc.values.sites.AccessorValue;

public final class PorcEObject implements AccessorValue, DOrcMarshalingReplacement {
    public final Field[] fieldNames;
    public final Object[] fieldValues;

    // TODO: PERFORMANCE: Using a frame instead of an array for field values may
    // perform better. Though that will mainly be true when we start using
    // native values.
    public PorcEObject(final Field[] fieldNames, final Object[] fieldValues) {
        assert fieldNames.length == fieldValues.length;

        this.fieldNames = fieldNames;
        this.fieldValues = fieldValues;
    }

    @Override
    public Accessor getAccessor(final OrcRuntime runtime, final Field field) {
        for (int i = 0; i < fieldNames.length; i++) {
            if (field.equals(fieldNames[i])) {
                final int index = i;
                final Field[] theseFieldNames = fieldNames;
                return new Accessor() {
                    @Override
                    public boolean canGet(final Object target) {
                        return target instanceof PorcEObject && theseFieldNames == ((PorcEObject) target).fieldNames;
                    }<commit_msg>Fix import in PorcEObject.  (Was causing Scala compiler crash!)<commit_after>
package orc.run.porce.runtime;

import scala.Function1;

import orc.Accessor;
import orc.NoSuchMemberAccessor;
import orc.OrcRuntime;
import orc.run.distrib.DOrcMarshalingReplacement;
import orc.values.Field;
import orc.values.sites.AccessorValue;

public final class PorcEObject implements AccessorValue, DOrcMarshalingReplacement {
    public final Field[] fieldNames;
    public final Object[] fieldValues;

    // TODO: PERFORMANCE: Using a frame instead of an array for field values may
    // perform better. Though that will mainly be true when we start using
    // native values.
    public PorcEObject(final Field[] fieldNames, final Object[] fieldValues) {
        assert fieldNames.length == fieldValues.length;

        this.fieldNames = fieldNames;
        this.fieldValues = fieldValues;
    }

    @Override
    public Accessor getAccessor(final OrcRuntime runtime, final Field field) {
        for (int i = 0; i < fieldNames.length; i++) {
            if (field.equals(fieldNames[i])) {
                final int index = i;
                final Field[] theseFieldNames = fieldNames;
                return new Accessor() {
                    @Override
                    public boolean canGet(final Object target) {
                        return target instanceof PorcEObject && theseFieldNames == ((PorcEObject) target).fieldNames;
                    }
{'fraction_non_alphanumeric': 0.0793151642208246, 'fraction_numerical': 0.001397624039133473, 'mean_word_length': 2.6799485861182517, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2005296', 'n_tokens_mistral': 770, 'n_tokens_neox': 744, 'n_words': 238}