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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 12
    • None
    • hotspot
    • None

      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
        }

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

              Created:
              Updated:
              Resolved: