Skip to content

NumberFormatException while parsing String as Long #79

@julioz

Description

@julioz

Just added the plugin to my project to check how it works. Followed the guidelines suggested by the documentation.

My config:
Using "net.rdrei.android.buildtimetracker:gradle-plugin:0.9.+"

buildtimetracker {
  reporters {
    csv {
      output "build/times.csv"
      append true
      header false
    }

    summary {
      ordered false
      threshold 50
      barstyle "unicode"
    }

    csvSummary {
      csv "build/times.csv"
    }
  }
}

At the first time running ./gradlew clean, the CSV file is correctly generated (with headers turned off). Turning headers on and running it again causes an exception and makes the build fail.

java.lang.NumberFormatException: For input string: "timestamp"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Long.parseLong(Long.java:589)
        at java.lang.Long.valueOf(Long.java:803)
        at java_lang_Long$valueOf$0.call(Unknown Source)
        at net.rdrei.android.buildtimetracker.reporters.CSVSummaryReporter$_printReport_closure2.doCall(CSVSummaryReporter.groovy:48)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027)
        at groovy.lang.Closure.call(Closure.java:414)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.callClosureForMapEntry(DefaultGroovyMethods.java:5226)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(DefaultGroovyMethods.java:3489)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions