GP-4874: AskDialog now uses Integer.decode() and Long.decode() to parse

better
This commit is contained in:
Ryan Kurtz 2024-08-26 13:46:55 -04:00
parent aac3e5ad1c
commit 3633443007

View File

@ -4,9 +4,9 @@
* Licensed 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.
@ -246,21 +246,12 @@ public class AskDialog<T> extends DialogComponentProvider {
protected Integer getValueAsInt() {
String text = getValueAsString();
if (text == null) {
return null;
}
if (text.startsWith("0x")) {
return (int) NumericUtilities.parseHexLong(text);
}
return (int) NumericUtilities.parseLong(text);
return text != null ? Integer.decode(text) : null;
}
protected Long getValueAsLong() {
String text = getValueAsString();
if (text == null) {
return null;
}
return NumericUtilities.parseLong(text);
return text != null ? Long.decode(text) : null;
}
protected Double getValueAsDouble() {