Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-11661

Content consistency checker: maybe could be more optimized

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • 4.LATER
    • None
    • None
    • None
    • 2 - Long term
    • 2 - Normal

      In the code of org.ametys.cms.transformation.ConsistencyChecker._checkHTTPLink(String, boolean), we have:

      try
      {
          CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL));
          [... some code ...]
      }
      finally
      {
          ((CookieManager) CookieHandler.getDefault()).getCookieStore().removeAll();
      }

      Several problems:

      1. CookieHandler is set to a default cookie manager but never restored to its old value, also it means that if other APIs call the CookieHandler, the cookie manager can be modified.
      2. The cookie manager is reinstanciate each time it is used (so as many there are links)
      3. Cookie store is emptied:
        1. Not through its initial implementation: I think URL check is threaded so we can have conflicts between all instanciations.
        2. Maybe we could kept the cookie store for all links to check and restore it at the end.

            Unassigned Unassigned
            bmaurel Bérénice Maurel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: