//# 0 errors, 55 messages
//#
package net.sourceforge.pebble.util;
    //#upgradeutilities.java:1:1: class: net.sourceforge.pebble.util.UpgradeUtilities

import net.sourceforge.pebble.domain.Blog;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Utilities for upgrading blogs.
 *
 * @author    Simon Brown
 */
public class UpgradeUtilities {
    //#upgradeutilities.java:12: method: void net.sourceforge.pebble.util.UpgradeUtilities.net.sourceforge.pebble.util.UpgradeUtilities()
    //#upgradeutilities.java:12: end of method: void net.sourceforge.pebble.util.UpgradeUtilities.net.sourceforge.pebble.util.UpgradeUtilities()

  /** the logger used by this action */
  private static final Log log = LogFactory.getLog(UpgradeUtilities.class);
    //#upgradeutilities.java:15: method: net.sourceforge.pebble.util.UpgradeUtilities.net.sourceforge.pebble.util.UpgradeUtilities__static_init
    //#upgradeutilities.java:15: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.UpgradeUtilities
    //#    method: net.sourceforge.pebble.util.UpgradeUtilities__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(net.sourceforge.pebble.util.UpgradeUtilities__static_init): __Descendant_Table[net/sourceforge/pebble/util/UpgradeUtilities]
    //#output(net.sourceforge.pebble.util.UpgradeUtilities__static_init): log
    //#post(net.sourceforge.pebble.util.UpgradeUtilities__static_init): __Descendant_Table[net/sourceforge/pebble/util/UpgradeUtilities] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.util.UpgradeUtilities__static_init): init'ed(log)
    //#upgradeutilities.java:15: end of method: net.sourceforge.pebble.util.UpgradeUtilities.net.sourceforge.pebble.util.UpgradeUtilities__static_init

  public static void upgradeBlog(Blog blog, String fromVersion, String toVersion) throws Exception {
    log.info("Upgrading blog from " + fromVersion + " to " + toVersion);
    //#upgradeutilities.java:18: method: void net.sourceforge.pebble.util.UpgradeUtilities.upgradeBlog(Blog, String, String)
    //#upgradeutilities.java:18: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.UpgradeUtilities
    //#    method: void upgradeBlog(Blog, String, String)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
    //#input(void upgradeBlog(Blog, String, String)): blog
    //#input(void upgradeBlog(Blog, String, String)): fromVersion
    //#input(void upgradeBlog(Blog, String, String)): log
    //#input(void upgradeBlog(Blog, String, String)): net/sourceforge/pebble/util/Utilities.log
    //#input(void upgradeBlog(Blog, String, String)): toVersion
    //#pre[1] (void upgradeBlog(Blog, String, String)): (soft) blog != null
    //#presumption(void upgradeBlog(Blog, String, String)): org.apache.commons.logging.LogFactory:getLog(...)@15 != null
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:org.apache.commons.logging.Log:info
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:getRoot
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.io.File
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.io.File:listFiles
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.io.File:getName
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.lang.String:substring
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.io.File:getAbsolutePath
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.io.File:renameTo
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.io.File:isDirectory
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.io.File:mkdir
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.lang.String:endsWith
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.lang.String:indexOf
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.io.File:exists
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.text.SimpleDateFormat
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:getTimeZone
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.text.SimpleDateFormat:setTimeZone
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.lang.String:length
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.lang.String:valueOf
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.io.File:lastModified
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.util.Date
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:java.text.SimpleDateFormat:format
    //#unanalyzed(void upgradeBlog(Blog, String, String)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:reindex
    //#test_vector(void upgradeBlog(Blog, String, String)): fromVersion: Addr_Set{null}, Inverse{null}
    //#test_vector(void upgradeBlog(Blog, String, String)): java.lang.String:startsWith(...)@20: {1}, {0}
    //#test_vector(void upgradeBlog(Blog, String, String)): java.lang.String:startsWith(...)@21: {1}, {0}
    //#test_vector(void upgradeBlog(Blog, String, String)): java.lang.String:startsWith(...)@22: {1}, {0}
    //#test_vector(void upgradeBlog(Blog, String, String)): java.lang.String:startsWith(...)@23: {0}, {1}
    if (fromVersion == null 
        || fromVersion.startsWith("2.3") 
        || fromVersion.startsWith("2.2") 
        || fromVersion.startsWith("2.1") 
        || fromVersion.startsWith("2.0")) {
      log.info("restructuring static pages");
    //#upgradeutilities.java:24: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.UpgradeUtilities
    //#    method: void upgradeBlog(Blog, String, String)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
      Utilities.restructureStaticPages(blog);
      log.info("building indizes");
    //#upgradeutilities.java:26: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.UpgradeUtilities
    //#    method: void upgradeBlog(Blog, String, String)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
      Utilities.buildIndexes(blog);
      log.info("upgrade done");
    //#upgradeutilities.java:28: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.UpgradeUtilities
    //#    method: void upgradeBlog(Blog, String, String)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
    } else {
      log.info("No upgrade required");
    //#upgradeutilities.java:30: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:info(Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.util.UpgradeUtilities
    //#    method: void upgradeBlog(Blog, String, String)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:info(Object)
    }
  }
    //#upgradeutilities.java:32: end of method: void net.sourceforge.pebble.util.UpgradeUtilities.upgradeBlog(Blog, String, String)

}
    //#upgradeutilities.java:: end of class: net.sourceforge.pebble.util.UpgradeUtilities
