MATH-566
Removed "MathThrowable". git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1166646 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7de255581c
commit
6b9cf3c1ec
|
@ -22,7 +22,6 @@ import java.text.MessageFormat;
|
|||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.math.exception.MathThrowable;
|
||||
import org.apache.commons.math.exception.util.Localizable;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
|
||||
|
@ -36,7 +35,7 @@ import org.apache.commons.math.exception.util.LocalizedFormats;
|
|||
*
|
||||
* @version $Id$
|
||||
*/
|
||||
public class MathException extends Exception implements MathThrowable {
|
||||
public class MathException extends Exception {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 7428019509644517071L;
|
||||
|
@ -105,23 +104,45 @@ public class MathException extends Exception implements MathThrowable {
|
|||
this.arguments = (arguments == null) ? new Object[0] : arguments.clone();
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/**
|
||||
* Sets a message.
|
||||
*
|
||||
* @param pat Message pattern.
|
||||
* @param args Values for replacing the placeholders in the message
|
||||
* pattern.
|
||||
*/
|
||||
public void addMessage(Localizable pat,
|
||||
Object ... args) {
|
||||
throw new UnsupportedOperationException(DEPRECATION_MESSAGE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/**
|
||||
* Sets the context (key, value) pair.
|
||||
* Keys are assumed to be unique within an instance. If the same key is
|
||||
* assigned a new value, the previous one will be lost.
|
||||
*
|
||||
* @param key Context key (not null).
|
||||
* @param value Context value.
|
||||
*/
|
||||
public void setContext(String key, Object value) {
|
||||
throw new UnsupportedOperationException(DEPRECATION_MESSAGE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/**
|
||||
* Gets the value associated to the given context key.
|
||||
*
|
||||
* @param key Context key.
|
||||
* @return the context value or {@code null} if the key does not exist.
|
||||
*/
|
||||
public Object getContext(String key) {
|
||||
throw new UnsupportedOperationException(DEPRECATION_MESSAGE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/**
|
||||
* Gets all the keys stored in the exception
|
||||
*
|
||||
* @return the set of keys.
|
||||
*/
|
||||
public Set<String> getContextKeys() {
|
||||
throw new UnsupportedOperationException(DEPRECATION_MESSAGE);
|
||||
}
|
||||
|
@ -140,13 +161,21 @@ public class MathException extends Exception implements MathThrowable {
|
|||
return "";
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/**
|
||||
* Gets the message in a conventional US locale.
|
||||
*
|
||||
* @return localized message
|
||||
*/
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return getMessage(Locale.US);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/**
|
||||
* Gets the message in the system default locale.
|
||||
*
|
||||
* @return localized message
|
||||
*/
|
||||
@Override
|
||||
public String getLocalizedMessage() {
|
||||
return getMessage(Locale.getDefault());
|
||||
|
|
|
@ -27,7 +27,6 @@ import java.util.Locale;
|
|||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.math.exception.MathThrowable;
|
||||
import org.apache.commons.math.exception.util.Localizable;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
|
||||
|
@ -37,7 +36,7 @@ import org.apache.commons.math.exception.util.LocalizedFormats;
|
|||
* @version $Id$
|
||||
* @since 2.0
|
||||
*/
|
||||
public class MathRuntimeException extends RuntimeException implements MathThrowable {
|
||||
public class MathRuntimeException extends RuntimeException {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = 9058794795027570002L;
|
||||
|
@ -98,23 +97,45 @@ public class MathRuntimeException extends RuntimeException implements MathThrowa
|
|||
this.arguments = (arguments == null) ? new Object[0] : arguments.clone();
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/**
|
||||
* Sets a message.
|
||||
*
|
||||
* @param pat Message pattern.
|
||||
* @param args Values for replacing the placeholders in the message
|
||||
* pattern.
|
||||
*/
|
||||
public void addMessage(Localizable pat,
|
||||
Object ... args) {
|
||||
throw new UnsupportedOperationException(DEPRECATION_MESSAGE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/**
|
||||
* Sets the context (key, value) pair.
|
||||
* Keys are assumed to be unique within an instance. If the same key is
|
||||
* assigned a new value, the previous one will be lost.
|
||||
*
|
||||
* @param key Context key (not null).
|
||||
* @param value Context value.
|
||||
*/
|
||||
public void setContext(String key, Object value) {
|
||||
throw new UnsupportedOperationException(DEPRECATION_MESSAGE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/**
|
||||
* Gets the value associated to the given context key.
|
||||
*
|
||||
* @param key Context key.
|
||||
* @return the context value or {@code null} if the key does not exist.
|
||||
*/
|
||||
public Object getContext(String key) {
|
||||
throw new UnsupportedOperationException(DEPRECATION_MESSAGE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/**
|
||||
* Gets all the keys stored in the exception
|
||||
*
|
||||
* @return the set of keys.
|
||||
*/
|
||||
public Set<String> getContextKeys() {
|
||||
throw new UnsupportedOperationException(DEPRECATION_MESSAGE);
|
||||
}
|
||||
|
@ -145,13 +166,21 @@ public class MathRuntimeException extends RuntimeException implements MathThrowa
|
|||
return "";
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/**
|
||||
* Gets the message in a conventional US locale.
|
||||
*
|
||||
* @return localized message
|
||||
*/
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return getMessage(Locale.US);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
/**
|
||||
* Gets the message in the system default locale.
|
||||
*
|
||||
* @return localized message
|
||||
*/
|
||||
@Override
|
||||
public String getLocalizedMessage() {
|
||||
return getMessage(Locale.getDefault());
|
||||
|
|
|
@ -1,90 +0,0 @@
|
|||
/*
|
||||
* 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 org.apache.commons.math.exception;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.math.exception.util.Localizable;
|
||||
|
||||
/**
|
||||
* Interface for commons-math throwables.
|
||||
*
|
||||
* @version $Id$
|
||||
* @since 2.2
|
||||
* @deprecated To be removed in 3.0. Not deleted right-away because
|
||||
* the Javadoc is inherited in old "o.a.c.math.MathException" and
|
||||
* "o.a.c.math.MathRuntimeException" classes.
|
||||
*/
|
||||
public interface MathThrowable {
|
||||
/**
|
||||
* Sets a message.
|
||||
*
|
||||
* @param pattern Message pattern.
|
||||
* @param arguments Values for replacing the placeholders in the message
|
||||
* pattern.
|
||||
*/
|
||||
void addMessage(Localizable pattern,
|
||||
Object ... arguments);
|
||||
|
||||
/**
|
||||
* Sets the context (key, value) pair.
|
||||
* Keys are assumed to be unique within an instance. If the same key is
|
||||
* assigned a new value, the previous one will be lost.
|
||||
*
|
||||
* @param key Context key (not null).
|
||||
* @param value Context value.
|
||||
*/
|
||||
void setContext(String key, Object value);
|
||||
|
||||
/**
|
||||
* Gets the value associated to the given context key.
|
||||
*
|
||||
* @param key Context key.
|
||||
* @return the context value or {@code null} if the key does not exist.
|
||||
*/
|
||||
Object getContext(String key);
|
||||
|
||||
/**
|
||||
* Gets all the keys stored in the exception
|
||||
*
|
||||
* @return the set of keys.
|
||||
*/
|
||||
Set<String> getContextKeys();
|
||||
|
||||
/**
|
||||
* Gets the message in a specified locale.
|
||||
*
|
||||
* @param locale Locale in which the message should be translated
|
||||
* @return localized message
|
||||
*/
|
||||
String getMessage(final Locale locale);
|
||||
|
||||
/**
|
||||
* Gets the message in a conventional US locale.
|
||||
*
|
||||
* @return localized message
|
||||
*/
|
||||
String getMessage();
|
||||
|
||||
/**
|
||||
* Gets the message in the system default locale.
|
||||
*
|
||||
* @return localized message
|
||||
*/
|
||||
String getLocalizedMessage();
|
||||
}
|
Loading…
Reference in New Issue