Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-16630

Human readable file size method returns ",00" for files with byte length 0

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • core

      The human readable file size method hudson.Functions.humanReadableByteSize(long) returns ",00" for empty files (zero byte length)
      (see attached screenshot jenkins_fileSize_original.png).
      It should return "0" instead.

      Also bytes should not be shown in decimal format.

      The second screenshot (jenkins_fileSize_new.png) shows the file size format after implementing the proposed changes.

          [JENKINS-16630] Human readable file size method returns ",00" for files with byte length 0

          Fred G added a comment -

          Fred G added a comment - Opened pull request: https://github.com/jenkinsci/jenkins/pull/691

          Code changed in jenkins
          User: Fred G
          Path:
          core/src/main/java/hudson/Functions.java
          http://jenkins-ci.org/commit/jenkins/f19f772322ab3645d4f0784f28acdccc5b8ea582
          Log:
          [FIXED JENKINS-16630] Human readable file size method returns ",00" for
          files with byte length 0

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Fred G Path: core/src/main/java/hudson/Functions.java http://jenkins-ci.org/commit/jenkins/f19f772322ab3645d4f0784f28acdccc5b8ea582 Log: [FIXED JENKINS-16630] Human readable file size method returns ",00" for files with byte length 0

          Code changed in jenkins
          User: Fred G
          Path:
          core/src/test/java/hudson/FunctionsTest.java
          http://jenkins-ci.org/commit/jenkins/6437fe2e7804371243aab0c19283063df8f61ea9
          Log:
          Unit test for JENKINS-16630

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Fred G Path: core/src/test/java/hudson/FunctionsTest.java http://jenkins-ci.org/commit/jenkins/6437fe2e7804371243aab0c19283063df8f61ea9 Log: Unit test for JENKINS-16630

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          core/src/main/java/hudson/Functions.java
          core/src/test/java/hudson/FunctionsTest.java
          http://jenkins-ci.org/commit/jenkins/ad64bcd61201a43d850fd5e6151d8503e659cffe
          Log:
          Merge pull request #691 from fredg02/JENKINS-16630

          [FIXED JENKINS-16630] Human readable file size method returns ",00" for files with byte length 0

          Compare: https://github.com/jenkinsci/jenkins/compare/17fabea10cd9...ad64bcd61201


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: core/src/main/java/hudson/Functions.java core/src/test/java/hudson/FunctionsTest.java http://jenkins-ci.org/commit/jenkins/ad64bcd61201a43d850fd5e6151d8503e659cffe Log: Merge pull request #691 from fredg02/ JENKINS-16630 [FIXED JENKINS-16630] Human readable file size method returns ",00" for files with byte length 0 Compare: https://github.com/jenkinsci/jenkins/compare/17fabea10cd9...ad64bcd61201 – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/c98ca86b7d08f75244de0b1f209f13abd80a2002
          Log:
          Changelog for JENKINS-16630


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html http://jenkins-ci.org/commit/jenkins/c98ca86b7d08f75244de0b1f209f13abd80a2002 Log: Changelog for JENKINS-16630 – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2285
          [FIXED JENKINS-16630] Human readable file size method returns ",00" for (Revision f19f772322ab3645d4f0784f28acdccc5b8ea582)
          Unit test for JENKINS-16630 (Revision 6437fe2e7804371243aab0c19283063df8f61ea9)

          Result = SUCCESS
          Fred G : f19f772322ab3645d4f0784f28acdccc5b8ea582
          Files :

          • core/src/main/java/hudson/Functions.java

          Fred G : 6437fe2e7804371243aab0c19283063df8f61ea9
          Files :

          • core/src/test/java/hudson/FunctionsTest.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2285 [FIXED JENKINS-16630] Human readable file size method returns ",00" for (Revision f19f772322ab3645d4f0784f28acdccc5b8ea582) Unit test for JENKINS-16630 (Revision 6437fe2e7804371243aab0c19283063df8f61ea9) Result = SUCCESS Fred G : f19f772322ab3645d4f0784f28acdccc5b8ea582 Files : core/src/main/java/hudson/Functions.java Fred G : 6437fe2e7804371243aab0c19283063df8f61ea9 Files : core/src/test/java/hudson/FunctionsTest.java

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2286
          Changelog for JENKINS-16630 (Revision c98ca86b7d08f75244de0b1f209f13abd80a2002)

          Result = SUCCESS
          Christoph Kutzinski : c98ca86b7d08f75244de0b1f209f13abd80a2002
          Files :

          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #2286 Changelog for JENKINS-16630 (Revision c98ca86b7d08f75244de0b1f209f13abd80a2002) Result = SUCCESS Christoph Kutzinski : c98ca86b7d08f75244de0b1f209f13abd80a2002 Files : changelog.html

            fredg Fred G
            fredg Fred G
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: