Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10329

Bad initialisation of StringBuffer in RequestHedgingProxyProvider.java

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.8.0, 3.0.0-alpha1
    • ha
    • None
    • Reviewed

    Description

      On line 167 of RequestHedgingProxyProvider.java, a StringBuilder is initialised like this:

      StringBuilder combinedInfo = new StringBuilder('[');
      

      This won't have the (presumably) desired effect of creating a StringBuilder containing the string "["; instead, it will create a StringBuilder with capacity 91 (the character code of '['). See here for an explanation.

      To fix this, pass a string literal instead of the character literal:

      StringBuilder combinedInfo = new StringBuilder("[");
      

      Attachments

        1. HDFS-10329.001.patch
          0.9 kB
          Yiqun Lin

        Issue Links

          Activity

            People

              linyiqun Yiqun Lin
              xiemaisi Max Schaefer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: