luetzkendorf    2005/02/21 00:54:36

  Modified:    src/webdav/server/org/apache/slide/webdav/method/report
                        PrincipalMatchReport.java
  Log:
  fix for bug 33575 (i.e. principal-match without prop throws NPE)
  
  Revision  Changes    Path
  1.13      +6 -5      
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/report/PrincipalMatchReport.java
  
  Index: PrincipalMatchReport.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/report/PrincipalMatchReport.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- PrincipalMatchReport.java 15 Feb 2005 15:04:56 -0000      1.12
  +++ PrincipalMatchReport.java 21 Feb 2005 08:54:36 -0000      1.13
  @@ -112,6 +112,7 @@
           else {
               matchSubjectNode = SubjectNode.SELF;
           }
  +        
           List propElmL = principalMatchElm.getChildren(E_PROP, DNSP);
           if (propElmL.size() > 1) {
               throw new PreconditionViolationException(
  @@ -120,10 +121,10 @@
                                            "DAV:principal-match element must 
have at most one DAV:prop child"),
                   resourcePath
               );
  -        }
  -        
  -        // TODO: handle requests without <prop> properly
  -        if (propElmL.size() == 1) {
  +        } else if (propElmL.size() == 0) {
  +            this.requestedProperties = new RequestedPropertiesImpl();
  +        } else {
  +            // == 1
               Element propElm = (Element)propElmL.get(0);
               try {
                   this.requestedProperties = new 
RequestedPropertiesImpl(propElm);
  @@ -152,7 +153,7 @@
       public void execute(String resourcePath, Element multistatusElm, int 
depth) throws SlideException, IOException {
           SubjectNode currentUserNode = 
(SubjectNode)security.getPrincipal(slideToken);
           Element queryElm = getQueryElement(resourcePath, currentUserNode);
  -        new 
XMLOutputter(org.jdom.output.Format.getPrettyFormat()).output(queryElm, 
System.out);
  +        //new 
XMLOutputter(org.jdom.output.Format.getPrettyFormat()).output(queryElm, 
System.out);
           
           String absUri = WebdavUtils.getAbsolutePath (resourcePath, 
slideContextPath, config);
           
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to