Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
97dd4c08
Commit
97dd4c08
authored
Dec 18, 2020
by
izeye
Committed by
Stephane Nicoll
Dec 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
See gh-24558
parent
b82f5a40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
MeterValue.java
...mework/boot/actuate/autoconfigure/metrics/MeterValue.java
+3
-2
MeterValueTests.java
...k/boot/actuate/autoconfigure/metrics/MeterValueTests.java
+2
-2
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterValue.java
View file @
97dd4c08
...
...
@@ -108,6 +108,7 @@ public final class MeterValue {
* Return a new {@link MeterValue} instance for the given double value.
* @param value the source value
* @return a {@link MeterValue} instance
* @since 2.3.0
*/
public
static
MeterValue
valueOf
(
double
value
)
{
return
new
MeterValue
(
value
);
...
...
@@ -115,9 +116,9 @@ public final class MeterValue {
private
static
Double
safeParseDouble
(
String
value
)
{
try
{
return
Double
.
parseDouble
(
value
);
return
Double
.
valueOf
(
value
);
}
catch
(
NumberFormatException
nfe
)
{
catch
(
NumberFormatException
ex
)
{
return
null
;
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterValueTests.java
View file @
97dd4c08
...
...
@@ -42,8 +42,8 @@ class MeterValueTests {
@Test
void
getValueForDistributionSummaryWhenFromNumberStringShouldReturnDoubleValue
()
{
MeterValue
meterValue
=
MeterValue
.
valueOf
(
"123"
);
assertThat
(
meterValue
.
getValue
(
Type
.
DISTRIBUTION_SUMMARY
)).
isEqualTo
(
123
);
MeterValue
meterValue
=
MeterValue
.
valueOf
(
"123
.42
"
);
assertThat
(
meterValue
.
getValue
(
Type
.
DISTRIBUTION_SUMMARY
)).
isEqualTo
(
123
.42
);
}
@Test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment