Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2013-08-19 18:31:58 +0000
committerSteffen Pingel2013-08-23 17:02:35 +0000
commit4cc3cd156adc19eb5947537fd48bbf07a8b88d6f (patch)
treeeefb0a4d2a2bf13fa05025f4039e669377fe724f
parenta792989dcda6d3d2fdb175024d31579f6702dc65 (diff)
downloadorg.eclipse.mylyn.tasks-4cc3cd156adc19eb5947537fd48bbf07a8b88d6f.tar.gz
org.eclipse.mylyn.tasks-4cc3cd156adc19eb5947537fd48bbf07a8b88d6f.tar.xz
org.eclipse.mylyn.tasks-4cc3cd156adc19eb5947537fd48bbf07a8b88d6f.zip
415263: Null Pointer Exception initializing Bugzilla 4.x task data with
product absent from local configuration Change-Id: I6e9cd732f63c057be297ea95ffa0db67c2926cd5 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=415263
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java15
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java6
2 files changed, 10 insertions, 11 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
index 0868c5019..000f1c1b7 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
@@ -743,16 +743,15 @@ public class RepositoryConfiguration implements Serializable {
} else {
TaskAttribute everConfirmed = bugReport.getRoot().getAttribute(BugzillaAttribute.EVERCONFIRMED.getKey());
TaskAttribute product = bugReport.getRoot().getMappedAttribute(TaskAttribute.PRODUCT);
- Boolean unconfirmedAllowed = products.get(product.getValue()).getUnconfirmedAllowed();
-
+ boolean unconfirmedAllowed = getUnconfirmedAllowed(product.getValue());
switch (status) {
case START:
addOperation(bugReport, BugzillaOperation.new_default);
addOperation(bugReport, BugzillaOperation.unconfirmed);
TaskAttribute unconfirmedAttribute = bugReport.getRoot().getAttribute(
TaskAttribute.PREFIX_OPERATION + BugzillaOperation.unconfirmed.toString());
- if (unconfirmedAttribute != null && unconfirmedAllowed != null) {
- unconfirmedAttribute.getMetaData().setDisabled(!unconfirmedAllowed.booleanValue());
+ if (unconfirmedAttribute != null) {
+ unconfirmedAttribute.getMetaData().setDisabled(!unconfirmedAllowed);
}
addOperation(bugReport, BugzillaOperation.confirmed);
addOperation(bugReport, BugzillaOperation.in_progress);
@@ -1269,12 +1268,12 @@ public class RepositoryConfiguration implements Serializable {
this.lastModifiedHeader = lastModifiedHeader;
}
- public Boolean getUnconfirmedAllowed(String product) {
+ public boolean getUnconfirmedAllowed(String product) {
ProductEntry entry = products.get(product);
- if (entry != null) {
- return entry.getUnconfirmedAllowed();
+ if (entry != null && entry.getUnconfirmedAllowed() != null) {
+ return entry.getUnconfirmedAllowed().booleanValue();
} else {
- return null;
+ return false;
}
}
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
index 9323d6982..b5f271100 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
@@ -531,13 +531,13 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
}
if (bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) >= 0) {
AbstractTaskEditorPart part = getPart(ID_PART_ACTIONS);
- Boolean unconfirmedAllowed = repositoryConfiguration.getUnconfirmedAllowed(taskAttribute.getValue());
+ boolean unconfirmedAllowed = repositoryConfiguration.getUnconfirmedAllowed(taskAttribute.getValue());
TaskAttribute unconfirmedAttribute = taskAttribute.getTaskData()
.getRoot()
.getAttribute(
TaskAttribute.PREFIX_OPERATION + BugzillaOperation.unconfirmed.toString());
- if (unconfirmedAttribute != null && unconfirmedAllowed != null) {
- unconfirmedAttribute.getMetaData().setReadOnly(!unconfirmedAllowed.booleanValue());
+ if (unconfirmedAttribute != null) {
+ unconfirmedAttribute.getMetaData().setReadOnly(!unconfirmedAllowed);
}
if (part != null) {
TaskEditorActionPart actionPart = (TaskEditorActionPart) part;

Back to the top