[
https://issues.apache.org/jira/browse/JCRVLT-155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15839995#comment-15839995
]
Konrad Windszus edited comment on JCRVLT-155 at 1/26/17 4:38 PM:
-----------------------------------------------------------------
Sorry, I fear I won't be able to come up with a patch, because I don't
understand why the feature of restoring the old state of the package was
introduced with JCRVLT-31 at all. Since the new state is completely overwritten
I have no easy solution at hand on how to determine that the package has been
modified in between. The naive solution would be to throw out the state
transfer from the old to the new package
(https://github.com/apache/jackrabbit-filevault/blob/938f7a2179a01342e6f367f93fc708fc064a8b08/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageManagerImpl.java#L359)
but I fear that other code is relying on exactly that behaviour.
was (Author: kwin):
Sorry, I fear I won't be able to come up with a patch, because I don't
understand why the feature of restoring the old state of the package was
introduced with JCRVLT-155 at all. Since the new state is completely
overwritten I have no easy solution at hand on how to determine that the
package has been modified in between. The naive solution would be to throw out
the state transfer from the old to the new package
(https://github.com/apache/jackrabbit-filevault/blob/938f7a2179a01342e6f367f93fc708fc064a8b08/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/JcrPackageManagerImpl.java#L359)
but I fear that other code is relying on exactly that behaviour.
> JcrPackage.isInstalled does not return false in case the package has been
> overwritten
> -------------------------------------------------------------------------------------
>
> Key: JCRVLT-155
> URL: https://issues.apache.org/jira/browse/JCRVLT-155
> Project: Jackrabbit FileVault
> Issue Type: Bug
> Components: Packaging
> Affects Versions: 3.1.28
> Reporter: Konrad Windszus
>
> Although the javadoc of {{o.a.j.v.packaging.JcrPackage#isInstalled()}} is
> stating
> bq. Checks if this package is installed. Note: the default implementation
> only checks the JcrPackageDefinition.getLastUnpacked() date. If the package
> is replaced since it was installed. this method will return false.
> this method is returning {{true}} in case the package has been reuploaded in
> between (with the same group, package name and version). This is violating
> the contract of this method.
> Please either fix implementation or javadoc description.
> That issue already lead to downstream issues in the
> {{com.adobe.granite.installer.factory.packages.impl.PackageTransformer}}
> which therefore only installs a package once.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)