jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Bocanegra (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (JCR-2601) NullPointerException when removing more than one version from history
Date Wed, 21 Apr 2010 20:15:51 GMT

     [ https://issues.apache.org/jira/browse/JCR-2601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tobias Bocanegra reassigned JCR-2601:
-------------------------------------

    Assignee: Tobias Bocanegra

> NullPointerException when removing more than one version from history
> ---------------------------------------------------------------------
>
>                 Key: JCR-2601
>                 URL: https://issues.apache.org/jira/browse/JCR-2601
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: versioning
>    Affects Versions: 2.0.0
>            Reporter: Dirk Feufel
>            Assignee: Tobias Bocanegra
>
> When removing more than one version from the history, a NullPointerException occurres.
If I delete the version in the order the VersionIterator provides, I get:
>         at org.apache.jackrabbit.core.version.InternalVersionImpl.internalDetach(InternalVersionImpl.java:280)
>         at org.apache.jackrabbit.core.version.InternalVersionHistoryImpl.removeVersion(InternalVersionHistoryImpl.java:389)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerBase.internalRemoveVersion(InternalVersionManagerBase.java:684)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$5.run(InternalVersionManagerImpl.java:495)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$DynamicESCFactory.doSourced(InternalVersionManagerImpl.java:760)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.removeVersion(InternalVersionManagerImpl.java:493)
>         at org.apache.jackrabbit.core.version.InternalXAVersionManager.removeVersion(InternalXAVersionManager.java:264)
>         at org.apache.jackrabbit.core.version.VersionHistoryImpl.removeVersion(VersionHistoryImpl.java:253)
> If I delete in the other direction I get:
> java.lang.NullPointerException
>         at org.apache.jackrabbit.core.version.InternalVersionImpl.internalDetach(InternalVersionImpl.java:286)
>         at org.apache.jackrabbit.core.version.InternalVersionHistoryImpl.removeVersion(InternalVersionHistoryImpl.java:389)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerBase.internalRemoveVersion(InternalVersionManagerBase.java:684)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$5.run(InternalVersionManagerImpl.java:495)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl$DynamicESCFactory.doSourced(InternalVersionManagerImpl.java:760)
>         at org.apache.jackrabbit.core.version.InternalVersionManagerImpl.removeVersion(InternalVersionManagerImpl.java:493)
>         at org.apache.jackrabbit.core.version.InternalXAVersionManager.removeVersion(InternalXAVersionManager.java:264)
>         at org.apache.jackrabbit.core.version.VersionHistoryImpl.removeVersion(VersionHistoryImpl.java:253)
> The code is:
> Node toDelete = session.getNode(path);
> VersionHistory vh = session.getWorkspace().getVersionManager().getVersionHistory(path);
> toRemove.remove();
> session.save();
> VersionIterator vit = vh.getAllVersions();
> while (vit.hasNext()) {
> 	Version v = vit.nextVersion();
> 	if (!v.getName().equals("jcr:rootVersion")) {
> 		versionRemove.add(v.getName());
> 	}
> }
> for (int i=0; i<versionRemove.size(); i++) {
> 	vh.removeVersion(versionRemove.get(i));
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message