|
From: Christopher W. <caw...@us...> - 2006-04-13 23:14:28
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12075/src/org/rubypeople/rdt/internal/core Modified Files: RubyScript.java Log Message: Fix ticket #806 from RadRails trac site. When two class with the same base name are created in separate files, editing the files and attempting to save would fail with a mysterious Update conflict message. The problem was that we stole the hashcode implementation from JDT, but we don't have the same model structure. So we hashed only on the classname (minus namespace). I changed it so that RubyScripts hash on the underlyingFile's hashCode (hopefully this won't introduce other errors where we somehow have a RubyScript without an underlying IFile.). Index: RubyScript.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScript.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** RubyScript.java 28 Mar 2006 23:15:43 -0000 1.20 --- RubyScript.java 13 Apr 2006 23:14:23 -0000 1.21 *************** *** 468,471 **** --- 468,475 ---- return this.owner.equals(other.owner) && super.equals(obj); } + + public int hashCode() { + return this.underlyingFile.hashCode(); + } public boolean exists() { |