From: <ga...@us...> - 2010-02-19 13:08:05
|
Revision: 5728 http://jnode.svn.sourceforge.net/jnode/?rev=5728&view=rev Author: galatnm Date: 2010-02-19 12:35:53 +0000 (Fri, 19 Feb 2010) Log Message: ----------- Correct behaviour for equals method of Key class. Modified Paths: -------------- trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java Modified: trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java =================================================================== --- trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2010-02-19 07:21:51 UTC (rev 5727) +++ trunk/core/src/core/org/jnode/assembler/x86/X86BinaryAssembler.java 2010-02-19 12:35:53 UTC (rev 5728) @@ -81,8 +81,9 @@ * @return Return {@code true} if obj is 'equal to' this, {@code false} otherwise. */ public final boolean equals(Object obj) { - // FIXME ... this method will throw exceptions where a well-behaved implementation - // of 'equals' should return false; i.e. if obj is null or not a Key. + if(obj==null || !(obj instanceof Key)){ + return false; + } obj = ((Key) obj).key; if (this.key instanceof Label) { return key.equals(obj); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |