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

[windows] browsers.cpp: isInstalled(BrowserId browser, bool is32bit) has a typo for checking Chrome browser

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 9
    • 9
    • install
    • None
    • b105
    • windows
    • Not verified

    Description

      [15:18:30] johnny:~/projects/jdk9/install/install $ hg diff -U 20 src/windows/common/browsers.cpp
      diff --git a/src/windows/common/browsers.cpp b/src/windows/common/browsers.cpp
      --- a/src/windows/common/browsers.cpp
      +++ b/src/windows/common/browsers.cpp
      @@ -57,36 +57,36 @@
       
       // check if specific browser is installed
       bool isInstalled(BrowserId browser, bool is32bit) throw()
       {
           JDS_TRY;
       
           Registry reg(is32bit ? Registry::LocalMachineWow64_32 : Registry::LocalMachineWow64_64,
                        StartMenuInternetKey, Registry::ReadOnly);
       
           switch (browser) {
           case IE:
               return reg.keyExists(subkeyIE);
           case FF:
               return reg.keyExists(subkeyFF);
           case Chrome:
               {
                   // Google Chrome can be represented as something like "Google Chrome.LZVLRLLWNuD7JRCTX"
                   Registry::Names subkeys = reg.getSubkeyNames();
                   for (Registry::Names::const_iterator it = subkeys.begin(); it != subkeys.end(); ++it) {
                       // check is the name start with subkeyChrome (ignoring case)
      - if (tstrings::equals(subkeyChrome, (*it).substr(0, subkeyChrome.size()), tstrings::IGNORE_CASE) == 0) {
      + if (tstrings::equals(subkeyChrome, (*it).substr(0, subkeyChrome.size()), tstrings::IGNORE_CASE)) {
                           return true;
                       }
                   }
                   return false;
               }
           default:
               // unreachable
               JDS_THROW(std::logic_error("unexpected browserId"));
           }
       
           JDS_CATCH_ALL;
           // report "not installed" if an error occurs
           return false;
       }
       } // namespace browsers
      [15:18:40] johnny:~/projects/jdk9/install/install $

      Attachments

        Activity

          People

            jchen Johnny Chen (Inactive)
            jchen Johnny Chen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: