Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8067026 Dead Code Cleanup Umbrella Bug
  3. JDK-8008347

Cleanup deploy code related to CreateProcess

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 9
    • Component/s: deploy
    • Resolved In Build:
      b52

      Backports

        Description

        1. remove unused functions in deploy code

        for example - ExecuteProgram in src/common/windows/native/RegCommon.cpp

        2. use common pattern to create process where possible

        there's a lot of places with duplicated code:

         - creating STARTUPINFO, PROCESS_INFORMATION structures
         - calling CreateProcess, WaitForSingleObject
         - closing handles

        and actually there are several existing functions in deploy code

         - ExecuteProgram in src/common/windows/native/RegCommon.cpp
         - ExecCommand/ExecCommandEx in src/common/windows/native/common.h
         - StartProcess in src/common/windows/native/UpdateConf.cpp

        it should be one function in common.h and we should use it in deploy code consistently

        3. consider getting rid of CreateProcess and use "safe" ShellExecuteEx where possible

        4. Runtime.exec(String) isn't recommended way to execute command - consider using ProcessBuilder

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  dcherepanov Dmitry Cherepanov
                  Reporter:
                  dcherepanov Dmitry Cherepanov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: