<commit_before>/* 
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package java.util.logging;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

import org.apache.harmony.logging.internal.nls.Messages;
import org.apache.harmony.kernel.vm.VM;

/**
 * <code>Level</code> objects are used to indicate the level of logging. There
 * are a set of predefined logging levels, each associated with an integer
 * value. Enabling a certain logging level also enables all logging levels with
 * larger values.
 * <p>
 * The predefined levels in ascending order are FINEST, FINER, FINE, CONFIG,
 * INFO, WARNING, SEVERE. There are two additional predefined levels, which are
 * ALL and OFF. ALL indicates logging all messages, and OFF indicates logging no
 * messages.
 * </p>
 * 
 */
public class Level implements Serializable {

    private static final long serialVersionUID = -8176160795706313070L;

    private static final List<Level> levels = new ArrayList<Level>(9);

    /**
     * The OFF level provides no logging messages.
     */
    public static final Level OFF = new Level("OFF", Integer.MAX_VALUE); //$NON-NLS-1$

    /**
     * The SEVERE level indicates a severe failure.
     */
    public static final Level SEVERE = new Level("SEVERE", 1000); //$NON-NLS-1$

    /**
     * The WARNING level indicates a warning.
     */
    public static final Level WARNING = new Level("WARNING", 900); //$NON-NLS-1$

    /**
     * The INFO level indicates an informative message.
     */
    public static final Level INFO = new Level("INFO", 800); //$NON-NLS-1$

    /**
     * The CONFIG level indicates a static configuration message.
     */
    public static final Level CONFIG = new Level("CONFIG", 700); //$NON-NLS-1$

    /**
     * The FINE level provides tracing messages.
     */
    public static final Level FINE = new Level("FINE", 500); //$NON-NLS-1$

    /**
     * The FINER level provides more detailed tracing messages.
     */
    public static final Level FINER = new Level("FINER", 400); //$NON-NLS-1$

    /**
     * The FINEST level provides highly detailed tracing messages.
     */
    public static final Level FINEST = new Level("FINEST", 300); //$NON-NLS-1$

    /**
     * The ALL level provides all logging messages.
     */
    public static final Level ALL = new Level("ALL", Integer.MIN_VALUE); //$NON-NLS-1$

    /**
     * Parses a level name into a <code>Level</code> object.
     * 
     * @param name
     *            the name of the desired level, which cannot be null
     * @return a <code>Level</code> object with the specified name
     * @throws NullPointerException
     *             if <code>name</code> is <code>null</code>.
     * @throws IllegalArgumentException
     *             if <code>name</code> is not valid.
     */
    public static final Level parse(String name) {
        if (name == null) {
            // logging.1C=The 'name' parameter is null.<commit_msg>Level#parse method should not be final<commit_after>/* 
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package java.util.logging;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

import org.apache.harmony.logging.internal.nls.Messages;
import org.apache.harmony.kernel.vm.VM;

/**
 * <code>Level</code> objects are used to indicate the level of logging. There
 * are a set of predefined logging levels, each associated with an integer
 * value. Enabling a certain logging level also enables all logging levels with
 * larger values.
 * <p>
 * The predefined levels in ascending order are FINEST, FINER, FINE, CONFIG,
 * INFO, WARNING, SEVERE. There are two additional predefined levels, which are
 * ALL and OFF. ALL indicates logging all messages, and OFF indicates logging no
 * messages.
 * </p>
 * 
 */
public class Level implements Serializable {

    private static final long serialVersionUID = -8176160795706313070L;

    private static final List<Level> levels = new ArrayList<Level>(9);

    /**
     * The OFF level provides no logging messages.
     */
    public static final Level OFF = new Level("OFF", Integer.MAX_VALUE); //$NON-NLS-1$

    /**
     * The SEVERE level indicates a severe failure.
     */
    public static final Level SEVERE = new Level("SEVERE", 1000); //$NON-NLS-1$

    /**
     * The WARNING level indicates a warning.
     */
    public static final Level WARNING = new Level("WARNING", 900); //$NON-NLS-1$

    /**
     * The INFO level indicates an informative message.
     */
    public static final Level INFO = new Level("INFO", 800); //$NON-NLS-1$

    /**
     * The CONFIG level indicates a static configuration message.
     */
    public static final Level CONFIG = new Level("CONFIG", 700); //$NON-NLS-1$

    /**
     * The FINE level provides tracing messages.
     */
    public static final Level FINE = new Level("FINE", 500); //$NON-NLS-1$

    /**
     * The FINER level provides more detailed tracing messages.
     */
    public static final Level FINER = new Level("FINER", 400); //$NON-NLS-1$

    /**
     * The FINEST level provides highly detailed tracing messages.
     */
    public static final Level FINEST = new Level("FINEST", 300); //$NON-NLS-1$

    /**
     * The ALL level provides all logging messages.
     */
    public static final Level ALL = new Level("ALL", Integer.MIN_VALUE); //$NON-NLS-1$

    /**
     * Parses a level name into a <code>Level</code> object.
     * 
     * @param name
     *            the name of the desired level, which cannot be null
     * @return a <code>Level</code> object with the specified name
     * @throws NullPointerException
     *             if <code>name</code> is <code>null</code>.
     * @throws IllegalArgumentException
     *             if <code>name</code> is not valid.
     */
    public static Level parse(String name) throws IllegalArgumentException {
        if (name == null) {
            // logging.1C=The 'name' parameter is null.
{'fraction_non_alphanumeric': 0.09929351316634553, 'fraction_numerical': 0.014386640976236351, 'mean_word_length': 2.9542915185373286, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5220814', 'n_tokens_mistral': 2199, 'n_tokens_neox': 2082, 'n_words': 863}