You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.NumberFormatException: empty String
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1842)
at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.lang.Double.parseDouble(Double.java:538)
at java.text.DigitList.getDouble(DigitList.java:169)
at java.text.DecimalFormat.parse(DecimalFormat.java:2056)
at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1869)
at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1514)
at java.text.DateFormat.parse(DateFormat.java:364)
at com.splunk.Value.toDate(Value.java:109)
at com.splunk.Resource.load(Resource.java:166)
at com.splunk.Entity.load(Entity.java:356)
at com.splunk.Job.refresh(Job.java:940)
at com.splunk.Job.isDone(Job.java:806)
Edit: I came across this today, too. In addition to checking for an empty string, this code should check if the format is valid:
java.lang.NumberFormatException: For input string: "970197.4E4970197E4"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.lang.Double.parseDouble(Double.java:538)
at java.text.DigitList.getDouble(DigitList.java:169)
at java.text.DecimalFormat.parse(DecimalFormat.java:2056)
at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1869)
at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1514)
at java.text.DateFormat.parse(DateFormat.java:364)
at com.splunk.Value.toDate(Value.java:109)
at com.splunk.Resource.load(Resource.java:166)
at com.splunk.Entity.load(Entity.java:356)
at com.splunk.Entity.refresh(Entity.java:394)
at com.splunk.Entity.refresh(Entity.java:24)
at com.splunk.Resource.validate(Resource.java:186)
at com.splunk.Entity.validate(Entity.java:462)
at com.splunk.Entity.getContent(Entity.java:157)
at com.splunk.Entity.getString(Entity.java:279)
at com.splunk.ServiceInfo.getVersion(ServiceInfo.java:155)
at com.splunk.Service.login(Service.java:1130)
at com.splunk.Service.login(Service.java:1103)
at com.splunk.Service.connect(Service.java:189)
The text was updated successfully, but these errors were encountered:
TeresaP
changed the title
Resource.java should check if entry.updated is an empty string or handle Value.toDate throwing a NumberFormatException.
Resource.java should check if AtomEntry updated value is an empty string or handle Value.toDate throwing a NumberFormatException.
Jan 28, 2019
TeresaP
changed the title
Resource.java should check if AtomEntry updated value is an empty string or handle Value.toDate throwing a NumberFormatException.
Resource.java should check if AtomEntry updated value is a valid format or handle Value.toDate throwing a NumberFormatException.
Feb 13, 2019
@TeresaP sorry for the delay here. We're open to a PR of you're interested in making the change, unfortunately we don't have the resources to spend time on this at the moment
splunk-sdk-java/splunk/com/splunk/Resource.java
Line 160 in 308dc65
If there's a problem with the value of
entry
in https://github.com/splunk/splunk-sdk-java/blob/master/splunk/com/splunk/Job.java#L936, where the AtomEntryupdated
value is an empty string,Value.toDate(...)
will throw a java.lang.NumberFormatException.Could this be related to #108?
Edit: I came across this today, too. In addition to checking for an empty string, this code should check if the format is valid:
The text was updated successfully, but these errors were encountered: