readYaml parses numerical strings as Double.Infinity

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      I have the following YAML:

      this:
        is:
          a:
            string: "44e6696"
      

      I would expect that when I call readYaml in a Jenkins pipeline, the value of "44e6696" will be preserved as a String. Instead, it appears to be parsed as a Double and ends up with the value of Infinity:

      def yaml = readYaml(file: "myFile.yaml")
      echo "Class info: ${yaml.this.is.a.string.getClass().dump()}"
      echo "Value: ${yaml.this.is.a.string}"
      
      Class info: <java.lang.Class@78e67e0a cachedConstructor=null newInstanceCallerCache=null name=java.lang.Double reflectionData=java.lang.ref.SoftReference@2f922ce0 classRedefinedCount=0 genericInfo=sun.reflect.generics.repository.ClassRepository@51a80565 enumConstants=null enumConstantDirectory=null annotationData=null annotationType=null classValueMap=null>
      Value: Infinity
      

      I have not been able to identify a workaround.

            Assignee:
            Unassigned
            Reporter:
            Spencer Small
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: