matchingFound = true;
//then check if they are different (tags,description)
//if they are different then we have a change in bookmarking
if(!storedPost.equals(remotePost))
diffResult.add(new ResourceDifference(storedPost,remotePost, BookmarkingSource.DEL_ICIO_US));
//else there was no change in this bookmark
break;
}
}
//if not matching was found, then this is a new resource
//that comes from the stored bookmarks
if(!matchingFound){
diffResult.add(new ResourceDifference(storedPost,null,BookmarkingSource.DEL_ICIO_US));
}
}
//then run again to check for new imported posts
//that don't have a matching in stored posts
//SECOND RUN
for(SynchronizationPost remotePost : remotePosts){
boolean matchingFound = false;
for(SynchronizationPost storedPost : storedPosts){
if(remotePost.getHref().equals(storedPost.getHref())){
//just break as we created the diff result in the first run
matchingFound = true;
break;
}
}
if(!matchingFound){
diffResult.add(new ResourceDifference(null,remotePost,BookmarkingSource.DEL_ICIO_US));
}
}
return diffResult;
}