Author: sdumitriu
Date: 2008-02-08 14:05:45 +0100 (Fri, 08 Feb 2008)
New Revision: 7389

Modified:
   
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/DeleteVersionsAction.java
Log:
[cleanup] Apply codestyle


Modified: 
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/DeleteVersionsAction.java
===================================================================
--- 
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/DeleteVersionsAction.java
      2008-02-08 12:14:44 UTC (rev 7388)
+++ 
xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/DeleteVersionsAction.java
      2008-02-08 13:05:45 UTC (rev 7389)
@@ -28,6 +28,7 @@
 
 /**
  * Struts action for delete document versions.
+ * 
  * @version $Id: $
  */
 public class DeleteVersionsAction extends XWikiAction
@@ -39,7 +40,7 @@
     {
         XWikiDocument doc = context.getDoc();
         DeleteVersionsForm form = (DeleteVersionsForm) context.getForm();
-        
+
         boolean confirm = form.isConfirmed();
         Version v1;
         Version v2;
@@ -53,7 +54,7 @@
         }
         String language = form.getLanguage();
         XWikiDocument tdoc;
-        
+
         if (!confirm) {
             return true;
         }
@@ -69,14 +70,15 @@
             }
             tdoc.setTranslation(1);
         }
-        
+
         if (v1 != null && v2 != null) {
             XWikiDocumentArchive archive = tdoc.getDocumentArchive(context);
             archive.removeVersions(v1, v2, context);
             
context.getWiki().getVersioningStore().saveXWikiDocArchive(archive, true, 
context);
             tdoc.setDocumentArchive(archive);
-            // if we delete latest version then rollback to latest undeleted 
version 
-            if (archive.getLatestVersion()!=null && 
!tdoc.getRCSVersion().equals(archive.getLatestVersion())) {
+            // if we delete latest version then rollback to latest undeleted 
version
+            if (archive.getLatestVersion() != null
+                && !tdoc.getRCSVersion().equals(archive.getLatestVersion())) {
                 XWikiDocument newdoc = 
archive.loadDocument(archive.getLatestVersion(), context);
                 context.getWiki().getStore().saveXWikiDoc(newdoc, context);
                 context.setDoc(newdoc);
@@ -85,16 +87,20 @@
         sendRedirect(context);
         return false;
     }
+
     /**
      * redirect back to view history.
+     * 
      * @param context used in redirecting
      * @throws XWikiException if any error
      */
-    private void sendRedirect(XWikiContext context) throws XWikiException {
+    private void sendRedirect(XWikiContext context) throws XWikiException
+    {
         // forward to view
         String redirect = Utils.getRedirect("view", "viewer=history", context);
         sendRedirect(context.getResponse(), redirect);
     }
+
     /**
      * [EMAIL PROTECTED]
      */

_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to