Commits

Sebastian Sdorra committed 09c0da4

fix bug in jaxb implementation of data store api

Comments (0)

Files changed (1)

scm-dao-xml/src/main/java/sonia/scm/store/JAXBDataStore.java

 
     File file = getFile(id);
 
-    if (file.exists())
+    try
     {
-      try
-      {
-        Marshaller marshaller = context.createMarshaller();
+      Marshaller marshaller = context.createMarshaller();
 
-        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
-        marshaller.marshal(item, file);
-      }
-      catch (JAXBException ex)
-      {
-        throw new StoreException("could not write object with id ".concat(id),
-          ex);
-      }
+      marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+      marshaller.marshal(item, file);
+    }
+    catch (JAXBException ex)
+    {
+      throw new StoreException("could not write object with id ".concat(id),
+        ex);
     }
   }