Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2003-10-15 13:57:01 +0000
committerMichael Valenta2003-10-15 13:57:01 +0000
commite23a8bddd1b2da27973842bcd936b6e21afb250d (patch)
tree71b452cd4e2ccf3f285b46edc061d5a0a00ff878
parent82193596c80be9eebb23c440ea609f24b69d0e2c (diff)
downloadeclipse.platform.team-e23a8bddd1b2da27973842bcd936b6e21afb250d.tar.gz
eclipse.platform.team-e23a8bddd1b2da27973842bcd936b6e21afb250d.tar.xz
eclipse.platform.team-e23a8bddd1b2da27973842bcd936b6e21afb250d.zip
44446: NPE in setCachedSyncBytes() while running Override and Update
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java24
1 files changed, 5 insertions, 19 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
index 15bca6e99..e515d4e9c 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache.java
@@ -372,29 +372,15 @@ import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter;
* @see org.eclipse.team.internal.ccvs.core.resources.SyncInfoCache#setCachedSyncBytes(org.eclipse.core.resources.IResource, byte[])
*/
void setCachedSyncBytes(IResource resource, byte[] syncBytes, boolean canModifyWorkspace) throws CVSException {
+ // Ensure that the sync bytes do not indicate a deletion
if (syncBytes != null && ResourceSyncInfo.isDeletion(syncBytes)) {
- // Ensue that the sync bytes do not indicate a deletion
syncBytes = ResourceSyncInfo.convertFromDeletion(syncBytes);
}
+ // Put the sync bytes into the cache
safeSetSessionProperty(resource, RESOURCE_SYNC_KEY, syncBytes);
- if (resource.exists()) {
- // Ensure the synchronizer is clear for exiting resources
- if (canModifyWorkspace) {
- byte[] oldBytes = synchronizerCache.getCachedSyncBytes(resource);
- if (oldBytes != null && canModifyWorkspace) {
- synchronizerCache.setCachedSyncBytes(resource, null, canModifyWorkspace);
- if (ResourceSyncInfo.isFolder(syncBytes)) {
- // Handle gender changes
- IContainer container;
- if (resource.getType() == IResource.FILE) {
- container = resource.getParent().getFolder(new Path(resource.getName()));
- } else {
- container = (IContainer)resource;
- }
- synchronizerCache.setCachedFolderSync(container, null, canModifyWorkspace);
- }
- }
- }
+ // Ensure the synchronizer is clear
+ if (canModifyWorkspace && synchronizerCache.getCachedSyncBytes(resource) != null) {
+ synchronizerCache.setCachedSyncBytes(resource, null, canModifyWorkspace);
}
}

Back to the top