Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjphillips2009-08-13 21:54:55 +0000
committerjphillips2009-08-13 21:54:55 +0000
commit5fc4d8705642c72e2c9445a0fa9d086b2096b291 (patch)
treec27d7de7a40cb667baa90da94c3b999d6d61e699
parentda8c45d15d65e882dae09b13cce76dca50039ef4 (diff)
downloadorg.eclipse.osee-5fc4d8705642c72e2c9445a0fa9d086b2096b291.tar.gz
org.eclipse.osee-5fc4d8705642c72e2c9445a0fa9d086b2096b291.tar.xz
org.eclipse.osee-5fc4d8705642c72e2c9445a0fa9d086b2096b291.zip
QD5GH - "Error when merging native editor artifacts"
-rw-r--r--org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/AttributeConflict.java29
-rw-r--r--org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ConflictManagerInternal.java4
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java19
-rw-r--r--org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/XMergeViewer.java2
4 files changed, 42 insertions, 12 deletions
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/AttributeConflict.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/AttributeConflict.java
index 491fdc46694..e58cab719d7 100644
--- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/AttributeConflict.java
+++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/conflict/AttributeConflict.java
@@ -11,6 +11,9 @@
package org.eclipse.osee.framework.skynet.core.conflict;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
import java.util.Collection;
import java.util.TreeSet;
import java.util.logging.Level;
@@ -21,6 +24,7 @@ import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.core.exception.AttributeDoesNotExist;
import org.eclipse.osee.framework.core.exception.MergeChangesInArtifactException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.io.Streams;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
@@ -388,20 +392,39 @@ public class AttributeConflict extends Conflict {
if (getMergeObject() == null || getSourceObject() == null) {
mergeEqualsSource = false;
} else {
- mergeEqualsSource = getMergeObject().equals(getSourceObject());
+ mergeEqualsSource = compareObjects(getMergeObject(), getSourceObject());
}
if (getMergeObject() == null || getDestObject() == null) {
mergeEqualsDest = false;
} else {
- mergeEqualsDest = getMergeObject().equals(getDestObject());
+ mergeEqualsDest = compareObjects(getMergeObject(), getDestObject());
}
if (getSourceObject() == null || getDestObject() == null) {
sourceEqualsDest = false;
} else {
- sourceEqualsDest = getSourceObject().equals(getDestObject());
+ sourceEqualsDest = compareObjects(getSourceObject(), getDestObject());
}
}
+
+ private boolean compareObjects(Object obj1, Object obj2)throws OseeCoreException{
+ if(obj1 instanceof InputStream && obj2 instanceof InputStream){
+ InputStream inputStream1 = (InputStream)(obj1);
+ InputStream inputStream2 = (InputStream)(obj2);
+
+ boolean equals = Arrays.equals(Streams.getByteArray(inputStream1), Streams.getByteArray(inputStream2));
+
+ try {
+ inputStream1.reset();
+ inputStream2.reset();
+ } catch (IOException ex) {
+ throw new OseeCoreException(ex);
+ }
+
+ return equals;
+ }
+ return obj1.equals(obj2);
+ }
public void markStatusToReflectEdit() throws OseeCoreException {
computeEqualsValues();
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ConflictManagerInternal.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ConflictManagerInternal.java
index df9d3c471f2..df7220410c1 100644
--- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ConflictManagerInternal.java
+++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ConflictManagerInternal.java
@@ -409,7 +409,7 @@ public class ConflictManagerInternal {
return destinationBranches;
}
- public static int getCommitTransaction(Branch sourceBranch, Branch destBranch) throws OseeCoreException {
+ private static int getCommitTransaction(Branch sourceBranch, Branch destBranch) throws OseeCoreException {
int transactionId = 0;
ConnectionHandlerStatement chStmt = new ConnectionHandlerStatement();
try {
@@ -451,7 +451,7 @@ public class ConflictManagerInternal {
* branches that share a common history. If two branches share the same history than the point at which they diverged
* should provide the reference for detecting conflicts based on the gamma at that point.
*/
- public static int findCommonTransaction(Branch sourceBranch, Branch destBranch) throws OseeCoreException {
+ private static int findCommonTransaction(Branch sourceBranch, Branch destBranch) throws OseeCoreException {
List<Branch> sourceBranches = sourceBranch.getBranchHierarchy();
List<Branch> destBranches = destBranch.getBranchHierarchy();
Branch commonBranch = null;
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java
index 69169268a07..c8d448f7e20 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeXViewer.java
@@ -23,6 +23,7 @@ import org.eclipse.osee.framework.core.exception.MergeChangesInArtifactException
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.HttpBranchCreation;
+import org.eclipse.osee.framework.skynet.core.attribute.CoreAttributes;
import org.eclipse.osee.framework.skynet.core.attribute.EnumeratedAttribute;
import org.eclipse.osee.framework.skynet.core.attribute.StringAttribute;
import org.eclipse.osee.framework.skynet.core.conflict.AttributeConflict;
@@ -188,11 +189,19 @@ public class MergeXViewer extends XViewer {
CompareHandler compareHandler = new CompareHandler(leftContributionItem, rightContributionItem, null);
compareHandler.compare();
} else{
- conWizard = new ConflictResolutionWizard(conflict);
- WizardDialog dialog = new WizardDialog(shell, conWizard);
- dialog.create();
- if (dialog.open() == 0) {
- conWizard.getResolved();
+ if (attributeConflict.getArtifact().isAttributeTypeValid(CoreAttributes.NATIVE_CONTENT.getName())) {
+ MessageDialog dialog =
+ new MessageDialog(shell, "Artifact type not supported", null, "Native artifact types are not currently supported for the merge wizzard.\n" +
+ "You will need to populate the merge value with the source or destination values" +
+ " and then merge by hand by righ-clicking edit merge artifact.", 2, new String[] {"OK"}, 1);
+ dialog.open();
+ }else{
+ conWizard = new ConflictResolutionWizard(conflict);
+ WizardDialog dialog = new WizardDialog(shell, conWizard);
+ dialog.create();
+ if (dialog.open() == 0) {
+ conWizard.getResolved();
+ }
}
}
}
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/XMergeViewer.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/XMergeViewer.java
index 4ce1e8aefc9..914f23ba35b 100644
--- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/XMergeViewer.java
+++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/XMergeViewer.java
@@ -676,8 +676,6 @@ public class XMergeViewer extends XWidget implements IAdaptable {
public void run() {
if (conflicts.length != 0) {
if (conflicts[0].getSourceBranch() != null) {
- //(Object[] choose, Shell parentShell, String dialogTitle, Image dialogTitleImage,
- //String dialogMessage, int dialogImageType, String[] dialogButtonLabels, int defaultIndex)
ArrayList<String> selections = new ArrayList<String>();
ArrayList<Integer> branchIds = new ArrayList<Integer>();
try {

Back to the top