[jbosstools-issues] [JBoss JIRA] (JBIDE-23182) NullPointerException in PodLogsHandler.handleEvent

Viacheslav Kabanovich (JIRA) issues at jboss.org
Wed Sep 21 09:54:00 EDT 2016


    [ https://issues.jboss.org/browse/JBIDE-23182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13296446#comment-13296446 ] 

Viacheslav Kabanovich commented on JBIDE-23182:
-----------------------------------------------

The line
{code}
		ISelection selection = HandlerUtil.getActivePart(event).getSite().getWorkbenchWindow().getSelectionService().getSelection();
{code}
is used in 14 handlers in Openshift 3. It can fail at Eclipse closing.
In Openshift 2, another call is used
{code}
		ISelection selection = HandlerUtil.getCurrentSelection(event);
{code}
[~adietish], [~fbricon], was there some reason for not using HandlerUtil.getCurrentSelection(event) in Openshift 3 handlers?
If the current way is preferable, we have to add a safe helper that checks for null active part, site, window and service; and call that helper from all Openshift 3 handlers.



> NullPointerException in PodLogsHandler.handleEvent
> --------------------------------------------------
>
>                 Key: JBIDE-23182
>                 URL: https://issues.jboss.org/browse/JBIDE-23182
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: openshift
>            Reporter: Automated Error Reporting Bot
>
> The following problem was reported via the automated error reporting:
> Message: Unhandled event loop exception
> {noformat}
> java.lang.NullPointerException: null
>     at org.jboss.tools.openshift.internal.ui.handler.PodLogsHandler.handleEvent(PodLogsHandler.java:46)
>     at org.jboss.tools.openshift.internal.ui.handler.AbstractOpenShiftCliHandler.execute(AbstractOpenShiftCliHandler.java:70)
>     at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
>     at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(null:-2)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(null:-1)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(null:-1)
>     at java.lang.reflect.Method.invoke(null:-1)
>     at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:54)
> {noformat}
> Bundles:
> | org.eclipse.e4.core.di | 1.6.0.v20160319-0612 | 1.6.0.v20160319-0612 |
> | org.eclipse.ui | 3.108.0.v20160518-1929 | 3.108.0.v20160518-1929 |
> | org.jboss.tools.openshift.ui | 3.3.0.v20160831-0703 | 3.3.0.v20160831-0703 |
> Operating Systems:
> | Windows | 10.0.0 | 10.0.0 |
> The above information is a snapshot of the collected data. Visit [this page|https://redhat.ctrlflow.com/reviewers/#!/problems/57d6df25e4b0fd7621ccfde9] for the latest data.
> Thank you for your assistance.
>  Your friendly error-reports-inbox.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jbosstools-issues mailing list