Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 129459 - NPE in bugzilla.core.BugReport.decodeStringFromCharset
Summary: NPE in bugzilla.core.BugReport.decodeStringFromCharset
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 0.4   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Mik Kersten CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-25 14:01 EST by Ian Whalley CLA
Modified: 2006-03-04 10:22 EST (History)
2 users (show)

See Also:


Attachments
Trivial initial patch for BugReport.java. (959 bytes, patch)
2006-02-26 16:25 EST, Ian Whalley CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Whalley CLA 2006-02-25 14:01:48 EST
Mylar 0.4.9, Eclipse 3.2M5.  Trying to hook mylar up to an internal Bugzilla repository, that advertises itself as "Bugzilla 2.20".  I can successfully create a repository query that populates with matching bugs, but when I try to open one of those bugs, I get a dialog reading "Could not resolve the requested bug, check Bugzilla server and version".  The 'Browser' pain shows the bug, but the 'Bugzilla' pane remains blank.

The log contains the following NPE:
  !ENTRY org.eclipse.mylar.bugzilla 4 4 2006-02-25 13:46:13.087
  !MESSAGE Problem getting report
  !STACK 0
  java.lang.NullPointerException
	  at org.eclipse.mylar.bugzilla.core.BugReport.decodeStringFromCharset(BugReport.java:187)
	  at org.eclipse.mylar.bugzilla.core.BugReport.addAttribute(BugReport.java:264)
	  at org.eclipse.mylar.internal.bugzilla.core.internal.BugParser.parseSelect(BugParser.java:275)
	  at org.eclipse.mylar.internal.bugzilla.core.internal.BugParser.parseAttributeValue(BugParser.java:124)
	  at org.eclipse.mylar.internal.bugzilla.core.internal.BugParser.parseBug(BugParser.java:670)
	  at org.eclipse.mylar.internal.bugzilla.core.BugzillaRepositoryUtil.getBug(BugzillaRepositoryUtil.java:99)
	  at org.eclipse.mylar.internal.bugzilla.ui.tasklist.BugzillaRepositoryConnector.downloadReport(BugzillaRepositoryConnector.java:231)
	  at org.eclipse.mylar.internal.bugzilla.ui.tasklist.BugzillaRepositoryConnector.access$0(BugzillaRepositoryConnector.java:229)
	  at org.eclipse.mylar.internal.bugzilla.ui.tasklist.BugzillaRepositoryConnector$SynchronizeBugzillaJob.run(BugzillaRepositoryConnector.java:588)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

I have confirmed that the Bugzilla integration functions correctly against the Eclipse bugzilla, so this is a problem against our internal Bugzilla server (which is not externally accessible).  It does not, however, seem to be overtly customized.

What is the best way to debug this problem further?  I am happy to do so, but is there an intermediate stage between this one (just running Mylar and seeing what happens) and debugging -- perhaps some logging or tracing or somesuch ?
Comment 1 Ian Whalley CLA 2006-02-26 11:25:30 EST
Upon further investigation, this is happening on the 'Add CC' field of the bug.

It seems that our bugzilla has a list of email address presented for 'Add CC', instead of simply a type-in box -- specifically, we have a select.../select list with multiple option.../option entries.  Most bugzillas have a single input.../input box there.

This causes the value field of 'attribute' to be null, which casues decodeStringFromCharset() some discomfort.

The bugzilla owner says that no customisation was done -- so I'm not sure if this is a configuration option (I can't find mention of it in the documentation), or an artifact of the fact that I have certain permissions set on this bugzilla -- specifically, 'canconfirm' and 'editbugs' ?

Comment 2 Ian Whalley CLA 2006-02-26 16:25:01 EST
Created attachment 35377 [details]
Trivial initial patch for BugReport.java.

It further transpires that the simplest possible patch (see attached) causes this error to go away, and permits Mylar to view bugs, to modify the Cc: list (I tested adding and removing myself), and generally to work correctly.
Comment 3 Mik Kersten CLA 2006-03-02 15:24:45 EST
Excellent, thanks for fixing that for yourself Ian :)  

The patch has been applied, and that null check is a fine way around this and should have been there in the first place.  This and your other patch will be in tomorrow's dev build, so you'll be able to update to that version of Mylar using the dev update site: http://www.eclipse.org/mylar/dl.php
Comment 4 Ian Whalley CLA 2006-03-04 10:22:20 EST
Verified as fixed in the 2006-03-03 builds.