Community
Participate
Working Groups
The current implementation delegates the comparison of two URI to the FileStore: public static boolean equals(URI one, URI two) { try { return EFS.getStore(one).equals(EFS.getStore(two)); } catch (CoreException e) { // fall back to default equality test return one.equals(two); } } However, this only works if the FileStore has a custom implementation of equals(), otherwise the Object.equals() will be called: public boolean equals(Object obj) { return (this == obj); } This will return false even if the two URI are equal! It seems that there are specific reasons for URIUtil.equals() to delegate its work to FileStore, so FileStore be specified that an equal() method must be implemented.
Darn, I thought I had written a default equals implementation for the base FileStore class. This should be fixed for the next release.
Note: this method was added because URI.equals(...) frequently does not provide the desired behaviour. The main examples: file://home/foo is not equal to file://home/foo/ (trailing slash added) file://d:\home\foo is not equal to file://D:\home\foo (device case is changed)
A default equals implementation should be added to FileStore for 3.3.
Fix released.
Moving to new M1 milestone