Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2011-01-26 20:44:29 +0000
committerRyan D. Brooks2011-01-26 20:44:29 +0000
commit91ff65db38edfca3f047d01f9c91822e3b8d6e7b (patch)
tree6aa64524464541c9b85465fa905ace104a4be374
parent919ec92e1050b25c9bef12d1e1837a4c1df2768a (diff)
downloadorg.eclipse.osee-91ff65db38edfca3f047d01f9c91822e3b8d6e7b.tar.gz
org.eclipse.osee-91ff65db38edfca3f047d01f9c91822e3b8d6e7b.tar.xz
org.eclipse.osee-91ff65db38edfca3f047d01f9c91822e3b8d6e7b.zip
bug[ats_R16MM]: Word Change Report on New/Deleted artifacts causes error
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/AbstractWordCompare.java18
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java4
2 files changed, 13 insertions, 9 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/AbstractWordCompare.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/AbstractWordCompare.java
index b9a5c5dea6a..97d23b88a49 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/AbstractWordCompare.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/AbstractWordCompare.java
@@ -16,6 +16,7 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -51,11 +52,16 @@ public abstract class AbstractWordCompare implements IComparator {
return renderer;
}
- @Override
- public String compare(IProgressMonitor monitor, PresentationType presentationType, ArtifactDelta artifactDelta) throws OseeCoreException {
+ protected IVbaDiffGenerator createGenerator(PresentationType presentationType) throws OseeArgumentException {
boolean show = !getRenderer().getBooleanOption(IRenderer.NO_DISPLAY);
IVbaDiffGenerator diffGenerator = WordUiUtil.createScriptGenerator();
diffGenerator.initialize(show, presentationType == PresentationType.MERGE);
+ return diffGenerator;
+ }
+
+ @Override
+ public String compare(IProgressMonitor monitor, PresentationType presentationType, ArtifactDelta artifactDelta) throws OseeCoreException {
+ IVbaDiffGenerator diffGenerator = createGenerator(presentationType);
String diffPath = addTocompare(monitor, diffGenerator, presentationType, artifactDelta);
Artifact testArtifact = artifactDelta.getStartArtifact();
@@ -68,11 +74,11 @@ public abstract class AbstractWordCompare implements IComparator {
@Override
public String compare(Artifact baseVersion, Artifact newerVersion, IFile baseFile, IFile newerFile, PresentationType presentationType) throws OseeCoreException {
- boolean show = !renderer.getBooleanOption(IRenderer.NO_DISPLAY);
- IVbaDiffGenerator diffGenerator = WordUiUtil.createScriptGenerator();
- diffGenerator.initialize(show, presentationType == PresentationType.MERGE);
+ IVbaDiffGenerator diffGenerator = createGenerator(presentationType);
String diffPath = addTocompare(diffGenerator, baseVersion, newerVersion, baseFile, newerFile, presentationType);
- finish(diffGenerator, baseVersion.getBranch(), presentationType);
+
+ Artifact testArtifact = baseVersion != null ? baseVersion : newerVersion;
+ finish(diffGenerator, testArtifact.getBranch(), presentationType);
return diffPath;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java
index 2ba4e7765e8..b57b46b90ec 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/WordTemplateCompare.java
@@ -23,7 +23,6 @@ import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.render.FileSystemRenderer;
import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
import org.eclipse.osee.framework.ui.skynet.util.IVbaDiffGenerator;
-import org.eclipse.osee.framework.ui.skynet.util.WordUiUtil;
public class WordTemplateCompare extends AbstractWordCompare {
@@ -37,8 +36,7 @@ public class WordTemplateCompare extends AbstractWordCompare {
*/
@Override
public void compareArtifacts(IProgressMonitor monitor, PresentationType presentationType, Collection<ArtifactDelta> artifactDeltas) throws OseeCoreException {
- IVbaDiffGenerator diffGenerator = WordUiUtil.createScriptGenerator();
- diffGenerator.initialize(false, false);
+ IVbaDiffGenerator diffGenerator = createGenerator(presentationType);
for (ArtifactDelta artifactDelta : artifactDeltas) {
if (monitor.isCanceled()) {

Back to the top