From cb7fa23952a10795215eda50848530828b92895e Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Mon, 19 Oct 2009 19:26:15 +0200 Subject: initial import of CLBuffer and CLKernel. added hashCode(), equals() and toString() methods. updated JUnit test to test new classes. --- src/com/mbien/opencl/CLDevice.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/com/mbien/opencl/CLDevice.java') diff --git a/src/com/mbien/opencl/CLDevice.java b/src/com/mbien/opencl/CLDevice.java index d9f643ce..dcc9ee97 100644 --- a/src/com/mbien/opencl/CLDevice.java +++ b/src/com/mbien/opencl/CLDevice.java @@ -191,9 +191,17 @@ public final class CLDevice { @Override public boolean equals(Object obj) { - if(obj != null && obj instanceof CLDevice) - return ((CLDevice)obj).deviceID == deviceID; - return false; + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final CLDevice other = (CLDevice) obj; + if (this.deviceID != other.deviceID) { + return false; + } + return true; } @Override -- cgit v1.2.3