juergen     01/08/30 07:41:02

  Modified:    src/share/org/apache/slide/macro MacroImpl.java
  Log:
  Do not do a second delete. In case of multi user, the second delete may be 
successfull and no exception is thrown. Remy, do you want to have a review on this?
  
  Revision  Changes    Path
  1.19      +15 -16    jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java
  
  Index: MacroImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- MacroImpl.java    2001/07/03 04:54:14     1.18
  +++ MacroImpl.java    2001/08/30 14:41:02     1.19
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v 1.18 
2001/07/03 04:54:14 remm Exp $
  - * $Revision: 1.18 $
  - * $Date: 2001/07/03 04:54:14 $
  + * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/macro/MacroImpl.java,v 1.19 
2001/08/30 14:41:02 juergen Exp $
  + * $Revision: 1.19 $
  + * $Date: 2001/08/30 14:41:02 $
    *
    * ====================================================================
    *
  @@ -77,7 +77,7 @@
    * Macro helper class.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Remy Maucherat</a>
  - * @version $Revision: 1.18 $
  + * @version $Revision: 1.19 $
    */
   public final class MacroImpl implements Macro {
       
  @@ -194,11 +194,10 @@
                   delete(token, destinationUri);
               } catch(ObjectNotFoundException e) {
                   // Silent catch, the target doesn't exist
  -            } catch(SlideException e) {
  -                // We try to delete the target anyway.
  -                // It will probably fail again, but we will get a properly
  -                // packaged exception
  -                delete(token, destinationUri);
  +            } catch(SlideException s) {
  +                CopyMacroException e = new CopyMacroException("Copy failed");
  +                e.addException(s);
  +                throw e;
               }
           }
           
  @@ -313,12 +312,12 @@
               Vector childrenListVector = new Vector();
               
               // Copying structure
  -            ObjectNode object = 
  +            ObjectNode object =
                   structureHelper.retrieve(token, sourceUri, false);
               
               // Creating the copy
               try {
  -                structureHelper.create(token, object.copyObject(), 
  +                structureHelper.create(token, object.copyObject(),
                                          destinationUri);
               } catch (ObjectNotFoundException s){
                   throw new ConflictException(s.getObjectUri());
  @@ -401,7 +400,7 @@
               }
               
           } catch(SlideException ex) {
  -            // ex.printStackTrace(); the exception is packed and 
  +            // ex.printStackTrace(); the exception is packed and
               // (hopefully) reported in the response
               e.addException(ex);
           }
  @@ -425,7 +424,7 @@
           
           try {
               
  -            ObjectNode currentObject = 
  +            ObjectNode currentObject =
                   structureHelper.retrieve(token, targetUri, false);
               
               // Removing children objects
  @@ -453,7 +452,7 @@
                   Enumeration permissions = securityHelper.enumeratePermissions
                       (token, currentObject);
                   while (permissions.hasMoreElements()) {
  -                    NodePermission permission = 
  +                    NodePermission permission =
                           (NodePermission) permissions.nextElement();
                       securityHelper.revokePermission(token, permission);
                   }
  @@ -474,8 +473,8 @@
               
           } catch (ObjectHasChildrenException ex) {
               // ignore, the object has children because something else failed
  -            // (one of the children is locked, for example), and the 
  -            // corresponding exception has already been added the the 
  +            // (one of the children is locked, for example), and the
  +            // corresponding exception has already been added the the
               // MacroException
           } catch (SlideException ex) {
               e.addException(ex);
  
  
  

Reply via email to