diff --git a/pom.xml b/pom.xml
index d9349877..34e7b30f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
- * The variant is an arbitrary value to allow a variation of a UnitFormat
, for example case sensitive
vs. case insensitive
UCUM format.
+ * The variant is an arbitrary value to allow a variation of a UnitFormat
, for example case sensitive
vs. case insensitive
UCUM format.
+ *
If no variant is applicable, the UnitFormat
matching the name only is returned.
UnitFormat
.
+ * @param variant any arbitrary value used to indicate a variation of a UnitFormat
.
* @return the corresponding unit format.
*/
UnitFormat getUnitFormat(String name, String variant);
diff --git a/src/main/jdk9/javax/measure/format/ParserException.java b/src/main/jdk9/javax/measure/format/ParserException.java
deleted file mode 100644
index d967e77a..00000000
--- a/src/main/jdk9/javax/measure/format/ParserException.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Units of Measurement API
- * Copyright (c) 2014-2020, Jean-Marie Dautelle, Werner Keil, Otavio Santana.
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
- * and the following disclaimer in the documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of JSR-385 nor the names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package javax.measure.format;
-
-/**
- * Signals that an error has been reached unexpectedly while parsing.
- *
- * @author Werner Keil
- * @version 2.0, March 29, 2020
- * @since 1.0
- * @deprecated Use {@link MeasurementParseException}, this exception will be removed in a future version, it is here for backward compatibility only.
- */
-@Deprecated(forRemoval=true, since="2.0")
-public class ParserException extends MeasurementParseException {
-
- private static final long serialVersionUID = -3179553925611520368L;
-
- /**
- * Constructs a ParserException with the specified detail message, parsed text and index. A detail message is a String that describes this
- * particular exception.
- *
- * @param message
- * the detail message
- * @param parsedData
- * the parsed text, should not be null
- * @param position
- * the position where the error was found while parsing.
- */
- public ParserException(String message, CharSequence parsedData, int position) {
- super(message, parsedData, position);
- }
-
- /**
- * Constructs a ParserException with the parsed text and offset. A detail message is a String that describes this particular exception.
- *
- * @param parsedData
- * the parsed text, should not be null
- * @param position
- * the position where the error is found while parsing.
- */
- public ParserException(CharSequence parsedData, int position) {
- super(parsedData, position);
- }
-
- /**
- * Constructs a ParserException with the specified cause.
- *
- * @param cause
- * the root cause
- */
- public ParserException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/src/test/java/javax/measure/test/format/MeasurementParseTest.java b/src/test/java/javax/measure/test/format/MeasurementParseTest.java
index a02ba233..05c0af9d 100644
--- a/src/test/java/javax/measure/test/format/MeasurementParseTest.java
+++ b/src/test/java/javax/measure/test/format/MeasurementParseTest.java
@@ -30,7 +30,6 @@
package javax.measure.test.format;
import javax.measure.format.MeasurementParseException;
-import javax.measure.format.ParserException;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
@@ -49,22 +48,22 @@ public void testExceptionWithMessage() {
@Test
public void testOldExceptionWithMessageDataAndPos() {
- assertThrows(ParserException.class, () -> {
- throw new ParserException("Error", " ", 0);
+ assertThrows(MeasurementParseException.class, () -> {
+ throw new MeasurementParseException("Error", " ", 0);
});
}
@Test
public void testOldExceptionWithMessageAndPos() {
- assertThrows(ParserException.class, () -> {
- throw new ParserException("Error", 0);
+ assertThrows(MeasurementParseException.class, () -> {
+ throw new MeasurementParseException("Error", 0);
});
}
@Test
public void testOldExceptionWithCause() {
- assertThrows(ParserException.class, () -> {
- throw new ParserException(new IllegalArgumentException("Error"));
+ assertThrows(MeasurementParseException.class, () -> {
+ throw new MeasurementParseException(new IllegalArgumentException("Error"));
});
}
}