Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/compare/BugzillaCompareNode.java9
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java26
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/ToolTipHandler.java4
4 files changed, 26 insertions, 15 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/compare/BugzillaCompareNode.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/compare/BugzillaCompareNode.java
index 0461d42fd..ebcf463cc 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/compare/BugzillaCompareNode.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/compare/BugzillaCompareNode.java
@@ -13,6 +13,8 @@ package org.eclipse.mylar.bugzilla.core.compare;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
import java.util.Iterator;
import org.eclipse.compare.IStreamContentAccessor;
@@ -183,7 +185,12 @@ public class BugzillaCompareNode implements IStreamContentAccessor, IStructureCo
public static BugzillaCompareNode parseBugReport(BugReport bug) {
Image defaultImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEF_VIEW);
BugzillaCompareNode topNode = new BugzillaCompareNode("Bug #" + bug.getId(), null, defaultImage);
- topNode.addChild(new BugzillaCompareNode("Creation Date", bug.getCreated().toString(), defaultImage));
+ Date creationDate = bug.getCreated();
+ if (creationDate == null) {
+ creationDate = Calendar.getInstance().getTime(); // XXX: this could be backwards
+ }
+ BugzillaCompareNode child = new BugzillaCompareNode("Creation Date", creationDate.toString(), defaultImage);
+ topNode.addChild(child);
String keywords = "";
if (bug.getKeywords() != null) {
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java
index 38931b7ba..c764da702 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java
@@ -55,6 +55,7 @@ import org.eclipse.mylar.bugzilla.ui.outline.BugzillaOutlineNode;
import org.eclipse.mylar.bugzilla.ui.outline.BugzillaOutlinePage;
import org.eclipse.mylar.bugzilla.ui.outline.BugzillaReportSelection;
import org.eclipse.mylar.bugzilla.ui.tasklist.BugzillaTaskEditor;
+import org.eclipse.mylar.core.MylarPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.custom.ScrolledComposite;
@@ -1290,18 +1291,21 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
* offline. Otherwise, any changes are updated in the file.
*/
public void saveBug() {
- updateBug();
-
- IBugzillaBug bug = getBug();
-
- if(bug.hasChanges()){
- BugzillaPlugin.getDefault().fireOfflineStatusChanged(bug, BugzillaOfflineStaus.SAVED_WITH_OUTGOING_CHANGES);
- } else {
- BugzillaPlugin.getDefault().fireOfflineStatusChanged(bug, BugzillaOfflineStaus.SAVED);
+ try {
+ updateBug();
+ IBugzillaBug bug = getBug();
+
+ if(bug.hasChanges()){
+ BugzillaPlugin.getDefault().fireOfflineStatusChanged(bug, BugzillaOfflineStaus.SAVED_WITH_OUTGOING_CHANGES);
+ } else {
+ BugzillaPlugin.getDefault().fireOfflineStatusChanged(bug, BugzillaOfflineStaus.SAVED);
+ }
+
+ changeDirtyStatus(false);
+ OfflineView.saveOffline(getBug(), true);
+ } catch (Exception e) {
+ MylarPlugin.fail(e, "bug save offline failed", true);
}
-
- changeDirtyStatus(false);
- OfflineView.saveOffline(getBug(), true);
// OfflineView.checkWindow();
// OfflineView.refreshView();
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java
index dbe817a22..9f118ead4 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java
@@ -705,7 +705,7 @@ public class ExistingBugEditor extends AbstractBugEditor
// go through all of the attributes and update the main values to the new ones
for (Iterator<Attribute> it = bug.getAttributes().iterator(); it.hasNext(); ) {
Attribute a = it.next();
- if(a.getNewValue().compareTo(a.getValue()) != 0){
+ if(a.getNewValue() != null && a.getNewValue().compareTo(a.getValue()) != 0){
bug.setHasChanged(true);
}
a.setValue(a.getNewValue());
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/ToolTipHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/ToolTipHandler.java
index 99fdbd501..495abad58 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/ToolTipHandler.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/ToolTipHandler.java
@@ -52,6 +52,7 @@ public class ToolTipHandler {
protected Point widgetPosition; // the position hovered over in the Widget;
public ToolTipHandler(Shell parentShell) {
+ if (parentShell == null) return;
tipShell = createTipShell(parentShell);
}
@@ -62,8 +63,7 @@ public class ToolTipHandler {
gridLayout.marginWidth = 2;
gridLayout.marginHeight = 2;
tipShell.setLayout(gridLayout);
- tipShell.setBackground(parent.getDisplay()
- .getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+ tipShell.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
tipLabelImage = new Label(tipShell, SWT.NONE);
tipLabelImage.setForeground(parent.getDisplay()

Back to the top