[ https://issues.apache.org/jira/browse/FELIX-6773 ]
James Roome deleted comment on FELIX-6773: ------------------------------------ was (Author: JIRAUSER309564): I ran into slight wrinkle, which is if deploy is called with the START flag. When the local bundle is updated or installed, it is added to the startList. Whereas if localResource.equals(deployResource) then it's not added to the startList, which I think is a little inconsistent. So I'm thinking of adding a codepath for the case where if localResource.equals(deployResource) which is: {noformat} boolean doStartBundle = (flags & START) != 0; if (!localResource.equals(deployResource)) { // unchanged } else if (doStartBundle) { // Start the local bundle if we're able to int state = localResource.getBundle().getState(); if (state == Bundle.INSTALLED || state == Bundle.RESOLVED) { startList.add(localResource.getBundle()); } } {noformat} So then if the bundle is downloaded or updated or local, if it is deployed with the START flag, it will be started. Let me know what you think. > ResolverImpl downloading bundles it doesn't need to > --------------------------------------------------- > > Key: FELIX-6773 > URL: https://issues.apache.org/jira/browse/FELIX-6773 > Project: Felix > Issue Type: Bug > Components: Bundle Repository (OBR) > Affects Versions: bundlerepository-2.0.10 > Reporter: James Roome > Priority: Minor > > LazyLocalResourceImpl doesn't implement the equals method. Due to this when > it is compared to another Resource with the same symbolic name and version is > returns false. > Impacts: ResolverImpl, which will do an unneeded download and update, due to > this check failing: > {code:java} > if (!localResource.equals(deployResource)){code} > Fix: Implement equals in LazyLocalResourceImpl: > {code:java} > public boolean equals(Object o) { return getResource().equals(o); }{code} > I'll submit the above fix as a pull request on the apache-dev github repo. -- This message was sent by Atlassian Jira (v8.20.10#820010)