Spotbugs fix DM_NUMBER_CTOR (#8072)

This commit is contained in:
Fokko Driesprong 2019-07-30 19:08:27 +02:00 committed by Roman Leventov
parent e016995d1f
commit 0f8c902e94
2 changed files with 2 additions and 3 deletions

View File

@ -37,7 +37,6 @@
<Bug pattern="DC_DOUBLECHECK"/>
<Bug pattern="DM_BOXED_PRIMITIVE_FOR_PARSING"/>
<Bug pattern="DM_EXIT"/>
<Bug pattern="DM_NUMBER_CTOR"/>
<Bug pattern="DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED"/>
<Bug pattern="EI_EXPOSE_REP"/>
<Bug pattern="EI_EXPOSE_REP2"/>

View File

@ -124,7 +124,7 @@ public class InfluxParser implements Parser<String, Object>
private Object parseNumber(String raw)
{
if (raw.endsWith("i")) {
return new Long(raw.substring(0, raw.length() - 1));
return Long.valueOf(raw.substring(0, raw.length() - 1));
}
return new Double(raw);
@ -161,7 +161,7 @@ public class InfluxParser implements Parser<String, Object>
dest.put(TIMESTAMP_KEY, 0L);
} else {
timestamp = timestamp.substring(0, timestamp.length() - 6);
long timestampMillis = new Long(timestamp);
final long timestampMillis = Long.valueOf(timestamp);
dest.put(TIMESTAMP_KEY, timestampMillis);
}
}