Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8211335

Fix up spaces after ( and before ) in an if statement for vmTestbase/.*cpp

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 12
    • Component/s: hotspot
    • Labels:
      None

      Description

      There are cases where there is a useless space after ( and before )

      if ( something ) {
      }

      Let's clean those up by removing the spaces.

      This can be done with an awk script:

        {
              open_paren = gensub(/\([ ]*/, "(", "g", $0)
              close_paren = gensub(/[ ]*\)/, "\\1)", "g", open_paren)

              if (close_paren ~ "^)") {
                      # Problem is the line is of type [ ]+)<other things>
                      # Do some replacement to get it to replace subsequent " )".
                      remove_first_spaces = gensub(/ )/, "#MARKER#)", 1, open_paren)
                      remaining = gensub(/[ ]*\)/, "\\1)", "g", remove_first_spaces)
                      close_paren = gensub(/#MARKER#/, " ", 1, remaining)
              }

              exclamation = gensub(/\![ ]*/, "!", "g", close_paren)
              print exclamation
        }

        Attachments

          Activity

            People

            • Assignee:
              jcbeyler Jean Christophe Beyler
              Reporter:
              jcbeyler Jean Christophe Beyler
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: