Author: michiel
Date: 2010-02-26 12:43:53 +0100 (Fri, 26 Feb 2010)
New Revision: 41178

Modified:
   
mmbase/trunk/applications/media/src/main/java/org/mmbase/applications/media/FragmentTypeFixer.java
Log:
assertions, logging

Modified: 
mmbase/trunk/applications/media/src/main/java/org/mmbase/applications/media/FragmentTypeFixer.java
===================================================================
--- 
mmbase/trunk/applications/media/src/main/java/org/mmbase/applications/media/FragmentTypeFixer.java
  2010-02-26 11:37:19 UTC (rev 41177)
+++ 
mmbase/trunk/applications/media/src/main/java/org/mmbase/applications/media/FragmentTypeFixer.java
  2010-02-26 11:43:53 UTC (rev 41178)
@@ -15,22 +15,28 @@
 import org.mmbase.util.logging.Logging;
 
 /**
- * Makes sure a mediasources node has its equivalent mediafragments, 
+ * Makes sure a mediasources node has its equivalent mediafragments,
  * a videosources needs a videofragments etc.
  *
  * @author Michiel Meeuwissen
  * @version $Id$
  */
 public class FragmentTypeFixer implements CommitProcessor {
-    private static Logger log = 
Logging.getLoggerInstance(FragmentTypeFixer.class);
+    private static final Logger log = 
Logging.getLoggerInstance(FragmentTypeFixer.class);
     public final static String NOT = FragmentTypeFixer.class + ".NOT";
     private static final long serialVersionUID = 1L;
 
     public void commit(Node node, Field field) {
-        if (node.getCloud().getProperty(NOT) != null) return;
+        if (node.getCloud().getProperty(NOT) != null) {
+            log.info("Skipping because of " + NOT);
+            return;
+        }
+        assert node.getValue("number") != null;
         Node fragment = node.getNodeValue("mediafragment");
+        assert node.getValue("number") != null;
         if (fragment == null) {
-            log.debug("No fragment yet");
+            log.info("No fragment yet " + node);
+            //System.out.println("No fragment yet " + node);
             return;
         }
         if (fragment.getNumber() > 0) {
@@ -47,6 +53,8 @@
             } else {
                 log.debug("Fragment of " + node.getNumber() + " has correct 
fragment already");
             }
+        } else {
+            log.warn("Fragment negative number" + fragment);
         }
     }
 

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to