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

Bad initialisation of StringBuffer in RequestHedgingProxyProvider.java

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: ha
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      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

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: