Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2011-05-23 03:51:45 +0000
committerfbecker2011-05-23 03:51:45 +0000
commit0ac6a4ddb230533230ec21afa06125a67189d768 (patch)
tree2dcda423b1491206f7c86e50beef8468a6c06505 /org.eclipse.mylyn.bugzilla.core
parent2e5a2cc45805b58f4673a49b94679e0ef4d7fad9 (diff)
downloadorg.eclipse.mylyn.tasks-0ac6a4ddb230533230ec21afa06125a67189d768.tar.gz
org.eclipse.mylyn.tasks-0ac6a4ddb230533230ec21afa06125a67189d768.tar.xz
org.eclipse.mylyn.tasks-0ac6a4ddb230533230ec21afa06125a67189d768.zip
ASSIGNED - bug 344382: NPE when using "autodetect workflow" (XMLRPC)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=344382
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java12
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java5
2 files changed, 14 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index b17fbd6e2..478d6569c 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -2344,9 +2344,15 @@ public class BugzillaClient {
boolean useXMLRPC = Boolean.parseBoolean(configParameters.get(IBugzillaConstants.BUGZILLA_USE_XMLRPC));
if (useXMLRPC && xmlRpcClient == null) {
WebLocation webLocation = new WebLocation(this.repositoryUrl + "/xmlrpc.cgi"); //$NON-NLS-1$
- webLocation.setCredentials(AuthenticationType.REPOSITORY,
- location.getCredentials(AuthenticationType.REPOSITORY).getUserName(),
- location.getCredentials(AuthenticationType.REPOSITORY).getPassword());
+ String username = ""; //$NON-NLS-1$
+ String password = ""; //$NON-NLS-1$
+ if (location.getCredentials(AuthenticationType.REPOSITORY) != null) {
+ username = location.getCredentials(AuthenticationType.REPOSITORY).getUserName();
+ }
+ if (location.getCredentials(AuthenticationType.REPOSITORY) != null) {
+ password = location.getCredentials(AuthenticationType.REPOSITORY).getPassword();
+ }
+ webLocation.setCredentials(AuthenticationType.REPOSITORY, username, password);
xmlRpcClient = new BugzillaXmlRpcClient(webLocation);
xmlRpcClient.setContentTypeCheckingEnabled(true);
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
index abb4ea54f..7819ba520 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
@@ -165,6 +165,11 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
userID = -1;
final AuthenticationCredentials credentials = this.getLocation().getCredentials(AuthenticationType.REPOSITORY);
if (credentials != null) {
+ String user = credentials.getUserName();
+ String password = credentials.getPassword();
+ if ("".equals(user) || "".equals(password)) {
+ return userID;
+ }
userID = (new BugzillaXmlRpcOperation<Integer>(this) {
@SuppressWarnings("serial")
@Override

Back to the top