<commit_before>/*
 * Bytecode Analysis Framework
 * Copyright (C) 2003-2007 University of Maryland
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package edu.umd.cs.findbugs.ba;

import java.util.BitSet;
import java.util.Iterator;
import java.util.NoSuchElementException;

import javax.annotation.CheckForNull;

import org.apache.bcel.Constants;
import org.apache.bcel.generic.CodeExceptionGen;
import org.apache.bcel.generic.InstructionHandle;

import edu.umd.cs.findbugs.SystemProperties;
import edu.umd.cs.findbugs.graph.AbstractVertex;

/**
 * Simple basic block abstraction for BCEL.
 * 
 * @author <NAME>
 * @see CFG
 */
public class BasicBlock extends AbstractVertex<Edge, BasicBlock> implements Debug {

    /*
     * ----------------------------------------------------------------------
     * Static data
     * ----------------------------------------------------------------------
     */

    /**
     * Set of instruction opcodes that have an implicit null check.
     */
    private static final BitSet nullCheckInstructionSet = new BitSet();

    static {
        nullCheckInstructionSet.set(Constants.GETFIELD);
        nullCheckInstructionSet.set(Constants.PUTFIELD);
        nullCheckInstructionSet.set(Constants.INVOKESPECIAL);
        nullCheckInstructionSet.set(Constants.INVOKEVIRTUAL);
        nullCheckInstructionSet.set(Constants.INVOKEINTERFACE);
        nullCheckInstructionSet.set(Constants.AALOAD);
        nullCheckInstructionSet.set(Constants.AASTORE);
        nullCheckInstructionSet.set(Constants.BALOAD);
        nullCheckInstructionSet.set(Constants.BASTORE);
        nullCheckInstructionSet.set(Constants.CALOAD);
        nullCheckInstructionSet.set(Constants.CASTORE);
        nullCheckInstructionSet.set(Constants.DALOAD);
        nullCheckInstructionSet.set(Constants.DASTORE);
        nullCheckInstructionSet.set(Constants.FALOAD);
        nullCheckInstructionSet.set(Constants.FASTORE);
        nullCheckInstructionSet.set(Constants.IALOAD);
        nullCheckInstructionSet.set(Constants.IASTORE);
        nullCheckInstructionSet.set(Constants.LALOAD);
        nullCheckInstructionSet.set(Constants.LASTORE);
        nullCheckInstructionSet.set(Constants.SALOAD);
        nullCheckInstructionSet.set(Constants.SASTORE);
        nullCheckInstructionSet.set(Constants.MONITORENTER);
        nullCheckInstructionSet.set(Constants.ARRAYLENGTH);
        // nullCheckInstructionSet.set(Constants.MONITOREXIT);
        if (!SystemProperties.getBoolean("npe.noAthrow")) {
            nullCheckInstructionSet.set(Constants.ATHROW);
        }
        // Any others?
    }

    /*
     * ----------------------------------------------------------------------
     * Fields
     * ----------------------------------------------------------------------
     */

    private InstructionHandle firstInstruction;

    private InstructionHandle lastInstruction;
<commit_msg>clean up of unused options<commit_after>/*
 * Bytecode Analysis Framework
 * Copyright (C) 2003-2007 University of Maryland
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package edu.umd.cs.findbugs.ba;

import java.util.BitSet;
import java.util.Iterator;
import java.util.NoSuchElementException;

import javax.annotation.CheckForNull;

import org.apache.bcel.Constants;
import org.apache.bcel.generic.CodeExceptionGen;
import org.apache.bcel.generic.InstructionHandle;

import edu.umd.cs.findbugs.SystemProperties;
import edu.umd.cs.findbugs.graph.AbstractVertex;

/**
 * Simple basic block abstraction for BCEL.
 * 
 * @author <NAME>
 * @see CFG
 */
public class BasicBlock extends AbstractVertex<Edge, BasicBlock> implements Debug {

    /*
     * ----------------------------------------------------------------------
     * Static data
     * ----------------------------------------------------------------------
     */

    /**
     * Set of instruction opcodes that have an implicit null check.
     */
    private static final BitSet nullCheckInstructionSet = new BitSet();

    static {
        nullCheckInstructionSet.set(Constants.GETFIELD);
        nullCheckInstructionSet.set(Constants.PUTFIELD);
        nullCheckInstructionSet.set(Constants.INVOKESPECIAL);
        nullCheckInstructionSet.set(Constants.INVOKEVIRTUAL);
        nullCheckInstructionSet.set(Constants.INVOKEINTERFACE);
        nullCheckInstructionSet.set(Constants.AALOAD);
        nullCheckInstructionSet.set(Constants.AASTORE);
        nullCheckInstructionSet.set(Constants.BALOAD);
        nullCheckInstructionSet.set(Constants.BASTORE);
        nullCheckInstructionSet.set(Constants.CALOAD);
        nullCheckInstructionSet.set(Constants.CASTORE);
        nullCheckInstructionSet.set(Constants.DALOAD);
        nullCheckInstructionSet.set(Constants.DASTORE);
        nullCheckInstructionSet.set(Constants.FALOAD);
        nullCheckInstructionSet.set(Constants.FASTORE);
        nullCheckInstructionSet.set(Constants.IALOAD);
        nullCheckInstructionSet.set(Constants.IASTORE);
        nullCheckInstructionSet.set(Constants.LALOAD);
        nullCheckInstructionSet.set(Constants.LASTORE);
        nullCheckInstructionSet.set(Constants.SALOAD);
        nullCheckInstructionSet.set(Constants.SASTORE);
        nullCheckInstructionSet.set(Constants.MONITORENTER);
        nullCheckInstructionSet.set(Constants.ARRAYLENGTH);
        // nullCheckInstructionSet.set(Constants.MONITOREXIT);
        nullCheckInstructionSet.set(Constants.ATHROW);
        
        // Any others?
    }

    /*
     * ----------------------------------------------------------------------
     * Fields
     * ----------------------------------------------------------------------
     */

    private InstructionHandle firstInstruction;

    private InstructionHandle lastInstruction;

{'fraction_non_alphanumeric': 0.15443853262391488, 'fraction_numerical': 0.006720806496779613, 'mean_word_length': 2.5786573146292584, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6537623', 'n_tokens_mistral': 1854, 'n_tokens_neox': 1827, 'n_words': 442}