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

Remove IsLongFormModuleOption from java.c

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
      None

      Description

      The static function IsLongFormModuleOption is used only a single time here:

      http://hg.openjdk.java.net/jdk/jdk/file/1cfd2ca0b769/src/java.base/share/native/libjli/java.c#l1365

      if (!has_arg && (IsModuleOption(arg) || IsLongFormModuleOption(arg)))

      But all the strings checked by IsLongFormModuleOption are already checked in IsModuleOption

      static jboolean
      IsModuleOption(const char* name) {
          return JLI_StrCmp(name, "--module-path") == 0 ||
                 JLI_StrCmp(name, "-p") == 0 ||
                 JLI_StrCmp(name, "--upgrade-module-path") == 0 ||
                 JLI_StrCmp(name, "--add-modules") == 0 ||
                 JLI_StrCmp(name, "--limit-modules") == 0 ||
                 JLI_StrCmp(name, "--add-exports") == 0 ||
                 JLI_StrCmp(name, "--add-opens") == 0 ||
                 JLI_StrCmp(name, "--add-reads") == 0 ||
                 JLI_StrCmp(name, "--patch-module") == 0;
      }

      static jboolean
      IsLongFormModuleOption(const char* name) {
          return JLI_StrCCmp(name, "--module-path=") == 0 ||
                 JLI_StrCCmp(name, "--upgrade-module-path=") == 0 ||
                 JLI_StrCCmp(name, "--add-modules=") == 0 ||
                 JLI_StrCCmp(name, "--limit-modules=") == 0 ||
                 JLI_StrCCmp(name, "--add-exports=") == 0 ||
                 JLI_StrCCmp(name, "--add-reads=") == 0 ||
                 JLI_StrCCmp(name, "--patch-module=") == 0;
      }

        Attachments

          Activity

            People

            • Assignee:
              iklam Ioi Lam
              Reporter:
              iklam Ioi Lam
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: