mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8176425: Add radix indication in NumberFormatException message for Integer.decode
Reviewed-by: lancea
This commit is contained in:
parent
b71faed5df
commit
b0954bc7ab
4 changed files with 23 additions and 20 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -61,8 +61,11 @@ class NumberFormatException extends IllegalArgumentException {
|
|||
*
|
||||
* @param s the input causing the error
|
||||
*/
|
||||
static NumberFormatException forInputString(String s) {
|
||||
return new NumberFormatException("For input string: \"" + s + "\"");
|
||||
static NumberFormatException forInputString(String s, int radix) {
|
||||
return new NumberFormatException("For input string: \"" + s + "\"" +
|
||||
(radix == 10 ?
|
||||
"" :
|
||||
" under radix " + radix));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue