1dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/*
2dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Licensed to the Apache Software Foundation (ASF) under one or more
3dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * contributor license agreements.  See the NOTICE file distributed with
4dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * this work for additional information regarding copyright ownership.
5dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * The ASF licenses this file to You under the Apache License, Version 2.0
6dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * (the "License"); you may not use this file except in compliance with
7dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * the License.  You may obtain a copy of the License at
8dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
9dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *      http://www.apache.org/licenses/LICENSE-2.0
10dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
11dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Unless required by applicable law or agreed to in writing, software
12dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * distributed under the License is distributed on an "AS IS" BASIS,
13dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * See the License for the specific language governing permissions and
15dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * limitations under the License.
16dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */
17dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpackage org.apache.commons.math.exception;
18dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
19dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondimport org.apache.commons.math.exception.util.Localizable;
20dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondimport org.apache.commons.math.exception.util.LocalizedFormats;
21dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
22dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond/**
23dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * All conditions checks that fail due to a {@code null} argument must throw
24dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * this exception.
25dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * This class is meant to signal a precondition violation ("null is an illegal
26dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * argument") and so does not extend the standard {@code NullPointerException}.
27dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * Proagation of {@code NullPointerException} from within Commons-Math is
28dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * construed to be a bug.
29dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond *
30dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @since 2.2
31dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond * @version $Revision$ $Date$
32dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond */
33dee0849a9704d532af0b550146cbafbaa6ee1d19Raymondpublic class NullArgumentException extends MathIllegalArgumentException {
34dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /** Serializable version Id. */
35dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    private static final long serialVersionUID = -6024911025449780478L;
36dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond
37dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /**
38dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * Default constructor.
39dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
40dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    public NullArgumentException() {
41dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond        super(LocalizedFormats.NULL_NOT_ALLOWED);
42dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    }
43dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    /**
44dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * @param specific Message pattern providing the specific context of
45dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     * the error.
46dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond     */
47dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    public NullArgumentException(Localizable specific) {
48dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond        super(specific, LocalizedFormats.NULL_NOT_ALLOWED);
49dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond    }
50dee0849a9704d532af0b550146cbafbaa6ee1d19Raymond}
51