[
https://issues.apache.org/jira/browse/BROOKLYN-546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16221304#comment-16221304
]
ASF GitHub Bot commented on BROOKLYN-546:
-----------------------------------------
Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/867#discussion_r147279623
--- Diff:
core/src/main/java/org/apache/brooklyn/core/typereg/BasicManagedBundle.java ---
@@ -135,6 +145,9 @@ public boolean equals(Object obj) {
// this makes equality with other OsgiBundleWithUrl items
symmetric,
// but for two MB's we look additionally at checksum
if (!Objects.equal(checksum,
((ManagedBundle)other).getChecksum())) return false;
+
+ // only equal if have the same ManagedBundle uid; important
for persistence.changeListener().unmanage()
+ if (!Objects.equal(getId(), ((ManagedBundle)other).getId()))
return false;
--- End diff --
I don't like this: it breaks transitivity for the equals method: if
`x.equals(y) && `y.equals(z)` then `x.equals(z)` should be true. It fails if
`x` and `z` are `BasicManagedBundle` with different checksums or ids, but `y`
is a `OsgiBundleWithUrl` with the same name:version and url.
However, that was already broken because of the checksum comparison (if an
`OsgiBundleWithUrl` impl behaves in the way indicated in the pre-existing
comments).
Longer term, I lean towards not trying to have equality with
`OsgiBundleWithUrl`.
> On restart fails to install catalog bundles due to existing bundles installed
> with different location
> -----------------------------------------------------------------------------------------------------
>
> Key: BROOKLYN-546
> URL: https://issues.apache.org/jira/browse/BROOKLYN-546
> Project: Brooklyn
> Issue Type: Bug
> Reporter: Duncan Grant
> Priority: Blocker
>
> Rebind will always fail on restart due to errors like the following:
> java.lang.IllegalStateException: Bundle
> BasicManagedBundle{symbolicName=org.apache.brooklyn.software-cm-ansible,
> version=1.0.0.SNAPSHOT,
> url=mvn:org.apache.brooklyn/brooklyn-software-cm-ansible/1.0.0-SNAPSHOT}
> failed installation: BundleException: Bundle symbolic name and version are
> not unique: org.apache.brooklyn.software-cm-ansible:1.0.0.SNAPSHOT
> This seems to have been "caused" by the change:
> https://github.com/apache/brooklyn-server/pull/862/commits/c4f9d95aa2113a1a5022da17768675599e528dd4
> This can be easily tested by starting brooklyn. Stopping brooklyn. And then
> starting brooklyn.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)