<commit_before>package ibis.io;

import ibis.util.TypedProperties;

import java.io.Externalizable;
import java.io.IOException;
import java.io.NotActiveException;
import java.io.NotSerializableException;
import java.io.ObjectStreamClass;
import java.io.Serializable;
import java.io.StreamCorruptedException;
import java.io.UTFDataFormatException;

import java.lang.reflect.Field;

import sun.misc.Unsafe;

/**
 * This is the <code>SerializationInputStream</code> version that is used
 * for Ibis serialization.
 * An effort has been made to make it look like and extend
 * <code>java.io.ObjectInputStream</code>.
 * However, versioning is not supported, like it is in Sun serialization.
 */
public class IbisSerializationInputStream
	extends DataSerializationInputStream
	implements IbisStreamFlags
{
    /**
     * Record how many objects of any class are sent the expensive way:
     * via the uninitialized native creator.
     */
    private static final boolean STATS_NONREWRITTEN = TypedProperties.booleanProperty(IOProps.s_stats_nonrewritten);

    // if STATS_NONREWRITTEN
    private static java.util.Hashtable nonRewritten = new java.util.Hashtable();

    // Only works as of Java 1.4, earlier versions of Java don't have Unsafe.
    private static Unsafe unsafe = Unsafe.getUnsafe();

    static {<commit_msg>Modified initialization of unsafe to catch exception<commit_after>package ibis.io;

import ibis.util.TypedProperties;

import java.io.Externalizable;
import java.io.IOException;
import java.io.NotActiveException;
import java.io.NotSerializableException;
import java.io.ObjectStreamClass;
import java.io.Serializable;
import java.io.StreamCorruptedException;
import java.io.UTFDataFormatException;

import java.lang.reflect.Field;

import sun.misc.Unsafe;

/**
 * This is the <code>SerializationInputStream</code> version that is used
 * for Ibis serialization.
 * An effort has been made to make it look like and extend
 * <code>java.io.ObjectInputStream</code>.
 * However, versioning is not supported, like it is in Sun serialization.
 */
public class IbisSerializationInputStream
	extends DataSerializationInputStream
	implements IbisStreamFlags
{
    /**
     * Record how many objects of any class are sent the expensive way:
     * via the uninitialized native creator.
     */
    private static final boolean STATS_NONREWRITTEN = TypedProperties.booleanProperty(IOProps.s_stats_nonrewritten);

    // if STATS_NONREWRITTEN
    private static java.util.Hashtable nonRewritten = new java.util.Hashtable();

    // Only works as of Java 1.4, earlier versions of Java don't have Unsafe.
    private static Unsafe unsafe = null;

    static {
	try {
	    unsafe = Unsafe.getUnsafe();
	} catch(Exception e) {
	    unsafe = null;
	}
{'fraction_non_alphanumeric': 0.07918634217217581, 'fraction_numerical': 0.001452960406828914, 'mean_word_length': 4.34757281553398, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2003338', 'n_tokens_mistral': 795, 'n_tokens_neox': 782, 'n_words': 245}