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

The checkstyle plugin assumes java files have UTF-8 encoding

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: checkstyle-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      The hudson.plugins.check​style.util.JavaPacka​geDetector.detectPac​kageName()
      hard-codes UTF-8 encoding when it creates the LineIterator object.

      This should be amended to at least use the platform default encoding
      (java.nio.charset.Charset.defaultCharset().name()). The ideal solution would be
      for the user to be able to specify the encoding on the Hudson Build
      configuration page.

      I came across this when I ran Hudson with version 1.5 of the IBM JDK on Linux
      (defect 1827). This throws an exception trying to decode UTF-8, even though the
      SUN JDKs work fine. I have verified that there are no invalid UTF-8 code
      sequences in any of our java files.

        Attachments

          Issue Links

            Activity

            Hide
            srbrown1 srbrown1 added a comment -

            Set the palform as "all"

            Show
            srbrown1 srbrown1 added a comment - Set the palform as "all"
            Hide
            drulli Ulli Hafner added a comment -

            Now the default encoding is used. In the long term I will add a configurable
            source encoding (see issue 1739)

            Show
            drulli Ulli Hafner added a comment - Now the default encoding is used. In the long term I will add a configurable source encoding (see issue 1739)
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in hudson
            User: : drulli
            Path:
            trunk/hudson/plugins/checkstyle/src/main/java/hudson/plugins/checkstyle/util/JavaPackageDetector.java
            http://fisheye4.cenqua.com/changelog/hudson/?cs=10209
            Log:
            [Fixed JENKINS-1829]: use default encoding to parse files.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : drulli Path: trunk/hudson/plugins/checkstyle/src/main/java/hudson/plugins/checkstyle/util/JavaPackageDetector.java http://fisheye4.cenqua.com/changelog/hudson/?cs=10209 Log: [Fixed JENKINS-1829] : use default encoding to parse files.

              People

              • Assignee:
                drulli Ulli Hafner
                Reporter:
                srbrown1 srbrown1
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: