Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan G. Rader2014-12-04 21:37:52 +0000
committerRyan G. Rader2014-12-05 20:25:41 +0000
commitcec6011e32610d74f588bff3c798d0f30213ec79 (patch)
tree8b5114063d8f4a41af792e983f417230ef2f96f3
parent215f841f7666ddaaff9394737655d1629a4b0c6b (diff)
downloadorg.eclipse.osee-cec6011e32610d74f588bff3c798d0f30213ec79.tar.gz
org.eclipse.osee-cec6011e32610d74f588bff3c798d0f30213ec79.tar.xz
org.eclipse.osee-cec6011e32610d74f588bff3c798d0f30213ec79.zip
bug[ats_ATS139610]: Fix performance for Publish With Specified Template0.19.0.v201412052144_RC
Change-Id: If473d4a9f269ef2b5615342790f4a90486e5a92d Signed-off-by: Ryan G. Rader <ryan.rader@boeing.com>
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/compare/AbstractWordCompare.java21
1 files changed, 19 insertions, 2 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 2868d475427..c62955edad4 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
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.render.compare;
+import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -22,6 +24,8 @@ import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.Pair;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.plugin.core.util.AIFile;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
@@ -133,11 +137,24 @@ public abstract class AbstractWordCompare implements IComparator {
if (artifactDelta.getStartArtifact() == artifactDelta.getBaseArtifact()) {
compareFiles = converter.convertToFile(presentationType, artifactDelta);
} else {
- // The artifactDelta should be a 3 Way Merge
+ // The artifactDelta is a 3 Way Merge
List<IFile> outputFiles = new ArrayList<IFile>();
converter.convertToFileForMerge(outputFiles, artifactDelta.getBaseArtifact(), artifactDelta.getStartArtifact());
converter.convertToFileForMerge(outputFiles, artifactDelta.getBaseArtifact(), artifactDelta.getEndArtifact());
-
+ // this is where we are getting the exception that the length of outputFiles is 1
+ // This happens because the artifact did not exist on the previous branch or was removed on the current branch
+ if (outputFiles.size() == 1) {
+ String outputFileName = outputFiles.get(0).getRawLocation().toOSString();
+ try {
+ String tempFileName = Lib.removeExtension(outputFileName);
+ File tempFile = new File(tempFileName + ".temp.xml");
+ Lib.writeStringToFile("", tempFile);
+ IFile constructIFile = AIFile.constructIFile(tempFile.getPath());
+ outputFiles.add(constructIFile);
+ } catch (IOException ex) {
+ throw new OseeCoreException(ex, "Empty file for comparison could not be created, [%s]", outputFileName);
+ }
+ }
compareFiles = new Pair<IFile, IFile>(outputFiles.get(0), outputFiles.get(1));
data.addMerge(outputFiles.get(0).getLocation().toOSString());
}

Back to the top