SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye
Issue Details (XML | Word | Printable)

Key: CMP-738
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Shay Banon
Reporter: Louis Emmett
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Compass

NPE In Coherence FileLockKey

Created: 13/Oct/08 04:04 AM   Updated: 13/Oct/08 04:16 AM
Component/s: Compass::Needle
Affects Version/s: 2.1.0 M4
Fix Version/s: 2.1.0 RC

Environment: Coherence*Extend 3.3.1


 Description  « Hide
Currently the equals() method of org.compass.needle.coherence.FileLockKey does not check for null.
This causes an occasional NPE on line 62

public boolean equals(Object o) {
if (this == o) return true;
=====>if (((FileKey) o).getType() != getType()) return false;

Changing this to

public boolean equals(Object o) {
if (this == o) return true;
if(o==null) return false;
if (((FileKey) o).getType() != getType()) return false;

Fixes the problem.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Louis Emmett added a comment - 13/Oct/08 04:09 AM
Actually the same is true of FileHeaderKey and FileBucketKey - they all produce NPEs on equals()
(at least in my Coherence*Extend environment)

Shay Banon added a comment - 13/Oct/08 04:16 AM
Fixed on all of them. I am wondering when this might happen, as I have tests that did not reproduce it...