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

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8
    • deploy
    • b52

        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

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

                Created:
                Updated:
                Resolved: