Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.9.2
-
None
-
None
Description
Create a BlobStoreContext, call the equals method on it and pass in itself, the result should be true but it is false.
Get the BlobStore from a context and call the equals method on it and pass in itself, the result should be true but is false with certain providers e.g. "transient", "azureBlob".
From the javadoc
Indicates whether some other object is "equal to" this one.
The equals method implements an equivalence relation on non-null object references:
It is reflexive: for any non-null reference value x, x.equals(x) should return true.
import org.jclouds.ContextBuilder; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.BlobStoreContext; //Test for equals behavior public class ReflexiveTest { public static void main(String[] args) { BlobStoreContext context = ContextBuilder.newBuilder("azureblob") .credentials("someId", "someKey") .build(BlobStoreContext.class); System.out.println("Context should equal itself " + context.equals(context)); BlobStore store = context.getBlobStore(); System.out.println("Store should equal itself " + store.equals(store)); } }
From my tests azureBlob and transient never equals itself, yet somehow aws-s3 BlobStores equal themselves, but not BlobStoreContext.