dirkv 01/10/12 13:37:45
Modified: src/webdav/client/src/org/apache/webdav/lib/properties
AclProperty.java LockDiscoveryProperty.java
PrincipalCollectionSetProperty.java
SupportedLockProperty.java
Log:
fix 4131 - NullPointerException with empty supportedlock or lockdiscovery
Aclproperty and PrincipalCollectionSet property is now also guarded against
empty elements
Revision Changes Path
1.6 +6 -6
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/AclProperty.java
Index: AclProperty.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/AclProperty.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AclProperty.java 2001/10/03 02:03:32 1.5
+++ AclProperty.java 2001/10/12 20:37:44 1.6
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/AclProperty.java,v
1.5 2001/10/03 02:03:32 remm Exp $
- * $Revision: 1.5 $
- * $Date: 2001/10/03 02:03:32 $
+ * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/AclProperty.java,v
1.6 2001/10/12 20:37:44 dirkv Exp $
+ * $Revision: 1.6 $
+ * $Date: 2001/10/12 20:37:44 $
*
* ====================================================================
*
@@ -85,7 +85,7 @@
*
* @author Remy Maucherat
* @author Dirk Verbeeck
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class AclProperty extends BaseProperty {
@@ -116,7 +116,7 @@
/**
* Returns the Aces present in this acl property.
*
- * @return Ace[] An Ace array.
+ * @return Ace[] An ace array or null when there is no ace.
*/
public Ace[] getAces() {
NodeList children = element.getChildNodes();
@@ -235,7 +235,7 @@
public String getPropertyAsString() {
Ace[] aces = getAces();
- if (aces.length==0)
+ if ((aces==null) || (aces.length==0))
return "";
StringBuffer tmp = new StringBuffer(aces[0].toString());
1.11 +6 -6
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/LockDiscoveryProperty.java
Index: LockDiscoveryProperty.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/LockDiscoveryProperty.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- LockDiscoveryProperty.java 2001/09/23 13:15:20 1.10
+++ LockDiscoveryProperty.java 2001/10/12 20:37:44 1.11
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/LockDiscoveryProperty.java,v
1.10 2001/09/23 13:15:20 dirkv Exp $
- * $Revision: 1.10 $
- * $Date: 2001/09/23 13:15:20 $
+ * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/LockDiscoveryProperty.java,v
1.11 2001/10/12 20:37:44 dirkv Exp $
+ * $Revision: 1.11 $
+ * $Date: 2001/10/12 20:37:44 $
*
* ====================================================================
*
@@ -89,7 +89,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Park, Sung-Gu</a>
* @author Remy Maucherat
* @author Dirk Verbeeck
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
*/
public class LockDiscoveryProperty extends BaseProperty {
@@ -120,7 +120,7 @@
/**
* Get the activelock in this lockdiscovery property.
*
- * @return Lock[] A lock array.
+ * @return Lock[] A lock array or null when there is no lock.
*/
public Lock[] getActiveLocks() {
NodeList children = element.getChildNodes();
@@ -233,7 +233,7 @@
public String getPropertyAsString() {
Lock[] locks = getActiveLocks();
- if (locks.length==0)
+ if ((locks==null) || (locks.length==0))
return "";
StringBuffer tmp = new StringBuffer(locks[0].toString());
1.4 +6 -6
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/PrincipalCollectionSetProperty.java
Index: PrincipalCollectionSetProperty.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/PrincipalCollectionSetProperty.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PrincipalCollectionSetProperty.java 2001/09/23 13:15:20 1.3
+++ PrincipalCollectionSetProperty.java 2001/10/12 20:37:44 1.4
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/PrincipalCollectionSetProperty.java,v
1.3 2001/09/23 13:15:20 dirkv Exp $
- * $Revision: 1.3 $
- * $Date: 2001/09/23 13:15:20 $
+ * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/PrincipalCollectionSetProperty.java,v
1.4 2001/10/12 20:37:44 dirkv Exp $
+ * $Revision: 1.4 $
+ * $Date: 2001/10/12 20:37:44 $
*
* ====================================================================
*
@@ -81,7 +81,7 @@
* defined in the WebDAV Access Control Protocol specification.
*
* @author Dirk Verbeeck
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class PrincipalCollectionSetProperty extends BaseProperty {
@@ -129,7 +129,7 @@
/**
* Returns the Hrefs present in this principal-collection-set property.
*
- * @return String[] A Href array.
+ * @return String[] A href array or null when there are no href.
*/
public String[] getHrefs()
{
@@ -140,7 +140,7 @@
public String getPropertyAsString() {
String[] hrefs = getHrefs();
- if (hrefs.length==0)
+ if ((hrefs==null) || (hrefs.length==0))
return "";
StringBuffer tmp = new StringBuffer(hrefs[0]);
1.5 +6 -6
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/SupportedLockProperty.java
Index: SupportedLockProperty.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/SupportedLockProperty.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SupportedLockProperty.java 2001/09/23 13:15:20 1.4
+++ SupportedLockProperty.java 2001/10/12 20:37:44 1.5
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/SupportedLockProperty.java,v
1.4 2001/09/23 13:15:20 dirkv Exp $
- * $Revision: 1.4 $
- * $Date: 2001/09/23 13:15:20 $
+ * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/properties/SupportedLockProperty.java,v
1.5 2001/10/12 20:37:44 dirkv Exp $
+ * $Revision: 1.5 $
+ * $Date: 2001/10/12 20:37:44 $
*
* ====================================================================
*
@@ -79,7 +79,7 @@
/**
* @author BC Holmes
* @author <a href="mailto:[EMAIL PROTECTED]">Park, Sung-Gu</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class SupportedLockProperty extends BaseProperty {
@@ -111,7 +111,7 @@
/**
* Get the lockentry in this supportedlock property.
*
- * @return Lock[] A lock array.
+ * @return Lock[] A lock array or null when there is no lock.
*/
public Lock[] getLockEntries() {
NodeList children = element.getChildNodes();
@@ -173,7 +173,7 @@
public String getPropertyAsString() {
Lock[] locks = getLockEntries();
- if (locks.length==0)
+ if ((locks==null) || (locks.length==0))
return "";
StringBuffer tmp = new StringBuffer(locks[0].toString());