| Summary: | NPE when activating a task having another task open with same invisible context elements | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Jan Mauersberger <mauersberger> | ||||
| Component: | Mylyn | Assignee: | Steffen Pingel <steffen.pingel> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | ||||||
| Version: | unspecified | ||||||
| Target Milestone: | 3.7 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Thanks for the bug report! I have committed a simple fix: http://review.mylyn.org/300. Shawn, please reopen if we need to make adjustments. Created attachment 211167 [details]
mylyn/context/zip
|
Build Identifier: M20100909-0800 Well, I have no reproduction scenario yet but I can outline the code parts of MyLyn that are affected. The NPW stack: java.lang.NullPointerException at org.eclipse.mylyn.internal.context.ui.editors.ContextWrapper.isForSameTaskAs(ContextWrapper.java:23) at org.eclipse.mylyn.internal.context.ui.editors.InvisibleContextElementsPart.isActiveTask(InvisibleContextElementsPart.java:320) at org.eclipse.mylyn.internal.context.ui.editors.InvisibleContextElementsPart.access$0(InvisibleContextElementsPart.java:317) at org.eclipse.mylyn.internal.context.ui.editors.InvisibleContextElementsPart$1.contextChanged(InvisibleContextElementsPart.java:124) The code executed is public boolean isForSameTaskAs(IInteractionContext context) { return context != null && context.getHandleIdentifier().equals(task.getHandleIdentifier()); } where as the call to "context.getHandleIdentifier()" returns null. The context implementation class is a CompositeInteractionContext, thus the code is: public String getHandleIdentifier() { if (contexts.values().size() == 1) { return contexts.keySet().iterator().next(); } else { return null; } } In my case the contexts hashmap contains several keys, thus null is returned. Reproducible: Always