Uploaded image for project: 'JSPWiki'
  1. JSPWiki
  2. JSPWIKI-649

CachingProvider.deleteVersion leaves a stale m_historyCache

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.3, 2.8.4
    • Fix Version/s: 2.8.3
    • Component/s: Core & storage
    • Labels:
      None
    • Environment:

      Ubuntu, Sun Java 1.6

      Description

      Hi JSPWiki developers,

      The function
      public void deleteVersion( String pageName, int version )
      in class CachingProvider does not always update the page history cache appropriately.
      As a result, NoSuchVersionException:s can be thrown, if it's later assumed that a page exists,
      because it's present in the (cached) history list.

      Below patch should fix the bug. (Works for me.)

      Regards, Magnus

      <pre>
      Index: src/com/ecyrd/jspwiki/providers/CachingProvider.java
      ===================================================================
      — src/com/ecyrd/jspwiki/providers/CachingProvider.java (revision 938415)
      +++ src/com/ecyrd/jspwiki/providers/CachingProvider.java (working copy)
      @@ -815,10 +815,10 @@

      { m_cache.removeEntry( pageName ); m_textCache.removeEntry( pageName ); - m_historyCache.removeEntry( pageName ); }

      m_provider.deleteVersion( pageName, version );
      + m_historyCache.removeEntry( pageName );
      }
      }
      </pre>

        Attachments

        1. jira-jspwiki-cachingprovider-patch.txt
          0.6 kB
          Magnus Lindberg

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              leomaheo Magnus Lindberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: