commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r755317 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/ram/RamFileData.java
Date Tue, 17 Mar 2009 16:49:46 GMT
Author: sebb
Date: Tue Mar 17 16:49:45 2009
New Revision: 755317

URL: http://svn.apache.org/viewvc?rev=755317&view=rev
Log:
Fix possible NPE / ClassCastException in RamFileData.equals()

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/ram/RamFileData.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/ram/RamFileData.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/ram/RamFileData.java?rev=755317&r1=755316&r2=755317&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/ram/RamFileData.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/ram/RamFileData.java
Tue Mar 17 16:49:45 2009
@@ -222,6 +222,12 @@
 	 */
 	public boolean equals(Object o)
 	{
+	    if (this == o) {
+	        return true;
+	    }
+	    if (!(o instanceof RamFileData)){
+	        return false;
+	    }
 		RamFileData data = (RamFileData) o;
 		return this.getName().equals(data.getName());
 	}



Mime
View raw message