Bug 467326 - NullPointerException in IOConsolePartition.delete (85)
Summary: NullPointerException in IOConsolePartition.delete (85)
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.7 M6   Edit
Assignee: Victor Rubezhny CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2015-05-14 08:28 EDT by EPP Error Reports CLA
Modified: 2017-07-20 08:16 EDT (History)
2 users (show)

See Also:
sarika.sinha: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description EPP Error Reports CLA 2015-05-14 08:28:18 EDT
The following incident was reported via the automated error reporting:


    code:                   2
    plugin:                 org.eclipse.e4.ui.workbench_1.2.1.v20140901-1244
    message:                Problems occurred when invoking code from plug-in: "org.eclipse.e4.ui.workbench".
    fingerprint:            93cecf73
    exception class:        java.lang.NullPointerException
    exception message:      -
    number of children:     0
    
    java.lang.NullPointerException: null
    at org.eclipse.ui.internal.console.IOConsolePartition.delete(IOConsolePartition.java:85)
    at org.eclipse.ui.internal.console.IOConsolePartitioner.documentChanged2(IOConsolePartitioner.java:383)
    at org.eclipse.jface.text.AbstractDocument.updateDocumentStructures(AbstractDocument.java:696)
    at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged(AbstractDocument.java:793)
    at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1191)
    at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1210)
    at org.eclipse.ui.internal.console.ConsoleDocument.replace(ConsoleDocument.java:92)
    at org.eclipse.ui.internal.console.ConsoleDocumentAdapter.replaceTextRange(ConsoleDocumentAdapter.java:266)
    at org.eclipse.swt.custom.StyledText.handleCompositionChanged(StyledText.java:5827)
    at org.eclipse.swt.custom.StyledText$8.handleEvent(StyledText.java:5689)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4188)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
    at org.eclipse.swt.widgets.IME.setMarkedText_selectedRange(IME.java:486)
    at org.eclipse.swt.widgets.Canvas.setMarkedText_selectedRange(Canvas.java:573)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5868)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(OS.java:-2)
    at org.eclipse.swt.internal.cocoa.NSView.removeFromSuperview(NSView.java:227)
    at org.eclipse.swt.widgets.Control.setZOrder(Control.java:4323)
    at org.eclipse.swt.widgets.Control.moveAbove(Control.java:2637)
    at org.eclipse.jface.action.StatusLine$StatusLineLayout.layout(StatusLine.java:187)
    at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1201)
    at org.eclipse.swt.widgets.Composite.layout(Composite.java:710)
    at org.eclipse.swt.widgets.Composite.layout(Composite.java:668)
    at org.eclipse.swt.widgets.Composite.layout(Composite.java:631)
    at org.eclipse.jface.action.StatusLineManager.update(StatusLineManager.java:357)
    at org.eclipse.ui.internal.WorkbenchPage.updateActivations(WorkbenchPage.java:309)
    at org.eclipse.ui.internal.WorkbenchPage.access$17(WorkbenchPage.java:287)
    at org.eclipse.ui.internal.WorkbenchPage$E4PartListener.partActivated(WorkbenchPage.java:209)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$3.run(PartServiceImpl.java:236)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.firePartActivated(PartServiceImpl.java:233)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:684)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:615)
    at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:106)
    at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$1.handleEvent(ContributedPartRenderer.java:61)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4188)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
    at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1577)
    at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1540)
    at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:3334)
    at org.eclipse.swt.widgets.Canvas.sendFocusEvent(Canvas.java:74)
    at org.eclipse.swt.widgets.Display.checkFocus(Display.java:664)
    at org.eclipse.swt.widgets.Shell.makeFirstResponder(Shell.java:1273)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5737)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(OS.java:-2)
    at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:221)
    at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2105)
    at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2329)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5691)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(OS.java:-2)
    at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:5128)
    at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5277)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(OS.java:-2)
    at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
   
  

General Information:

    reported-by:      
    anonymous-id:     f91f32fb-72a8-4d24-bd7e-5b7256f23556
    eclipse-build-id: 4.4.1.M20140925-0400
    eclipse-product:  org.eclipse.epp.package.standard.product
    operating system: MacOSX 10.10.1 (x86_64) - cocoa
    jre-version:      1.8.0_25-b17

The following plug-ins were present on the execution stack (*):
    1. org.eclipse.core.databinding.observable_1.4.1.v20140210-1835
    2. org.eclipse.core.databinding_1.4.2.v20140729-1044
    3. org.eclipse.core.runtime_3.10.0.v20140318-2214
    4. org.eclipse.e4.ui.workbench_1.2.1.v20140901-1244
    5. org.eclipse.e4.ui.workbench.renderers.swt_0.12.1.v20140903-1023
    6. org.eclipse.e4.ui.workbench.swt_0.12.100.v20140530-1436
    7. org.eclipse.equinox.app_1.3.200.v20130910-1609
    8. org.eclipse.equinox.launcher_1.3.0.v20140415-2008
    9. org.eclipse.jface_3.10.1.v20140813-1009
    10. org.eclipse.jface.text_3.9.1.v20140827-1810
    11. org.eclipse.swt_3.103.1.v20140903-1938
    12. org.eclipse.ui_3.106.0.v20140812-1751
    13. org.eclipse.ui.console_3.5.300.v20140424-1437
    14. org.eclipse.ui.ide.application_1.0.500.v20140514-2033
    15. org.eclipse.ui.ide_3.10.1.v20140828-0944

Please note that:
* Messages, stacktraces, and nested status objects may be shortened.
* Bug fields like status, resolution, and whiteboard are sent
  back to reporters.
* The list of present bundles and their respective versions was
  calculated by package naming heuristics. This may or may not reflect reality.

Other Resources:
* Report: https://dev.eclipse.org/recommenders/committers/confess/#/problems/54c5424de4b05f12e6fbe129  
* Manual: https://dev.eclipse.org/recommenders/community/confess/#/guide


Thank you for your assistance.
Your friendly error-reports-inbox.
Comment 1 Eclipse Genie CLA 2015-05-14 08:47:56 EDT
New Gerrit change created: https://git.eclipse.org/r/47916
Comment 2 Sarika Sinha CLA 2015-05-21 04:57:36 EDT
(In reply to Eclipse Genie from comment #1)
> New Gerrit change created: https://git.eclipse.org/r/47916

Victor, Do you have steps to verify that adding this condition works ?

I will also suggest to add isReadOnly call  before delete of partition.
Comment 3 Victor Rubezhny CLA 2015-05-21 09:07:12 EDT
Sarika,

(In reply to Sarika Sinha from comment #2)
> Victor, Do you have steps to verify that adding this condition works ?

The failure came from Error Reporting System, so I have no steps to reproduce (and I had no luck in trying to reproduce it by myself). It looks like failure came from some 3rd-party console adaptation but I can't see any 3rd-party classes in the stacktrace provided to be sure in this opinion.

> I will also suggest to add isReadOnly call  before delete of partition.

I wouldn't use isReadonly() and here is the reason:
The check for (IOConsolePartition.INPUT_PARTITION_TYPE.equals(partition.getType())) does practically the same (since both, the type and the read-only flag, are private and are set in constructor. 
When an output-type partition is created - there is no a buffer created for such partition and there is no way to create such a buffer 'from outside'. So the check like 'type == IOConsolePartition.INPUT_PARTITION_TYPE' guaranties that delete() call is enabled on a partition.
The read-only flag value may be used for the same purpose, but it's possible to change it by calling setReadOnly(false) on a partition 'from outside'. So, this won't give you a guarantee that the buffer is created. As such we couldn't be sure that we can use delete() call on such a partition.
That's why I've not used isReadOnly() in the check before delete() call.
Comment 4 Sarika Sinha CLA 2016-05-09 03:02:20 EDT
I think we can push this in 4.7 M1.
Comment 5 Sarika Sinha CLA 2017-01-19 01:53:41 EST
@Victor, the gerrit patch has id  	
vrubezhny <vrubezhny@exadel.com> which is not registered, can you please do the needful ?
Comment 6 Sarika Sinha CLA 2017-01-20 01:42:39 EST
Moving to M6, as can't release the changes without id resolution in gerrit.
Comment 7 Victor Rubezhny CLA 2017-01-23 18:48:36 EST
(In reply to Sarika Sinha from comment #5)
> @Victor, the gerrit patch has id  	
> vrubezhny <vrubezhny@exadel.com> which is not registered, can you please do
> the needful ?

Sarika, I have updated my patch. 

Thanks.
Comment 8 Sarika Sinha CLA 2017-02-03 00:19:28 EST
(In reply to Victor Rubezhny from comment #7)
> (In reply to Sarika Sinha from comment #5)
> > @Victor, the gerrit patch has id  	
> > vrubezhny <vrubezhny@exadel.com> which is not registered, can you please do
> > the needful ?
> 
> Sarika, I have updated my patch. 
> 
> Thanks.

Please sign the ECA with email id - vrubezhny@redhat.com
https://dev.eclipse.org/site_login/myaccount.php#open_tab_cla
Comment 9 Victor Rubezhny CLA 2017-02-03 08:20:17 EST
(In reply to Sarika Sinha from comment #8)
> (In reply to Victor Rubezhny from comment #7)
> 
> Please sign the ECA with email id - vrubezhny@redhat.com
> https://dev.eclipse.org/site_login/myaccount.php#open_tab_cla

Done.
Comment 11 Sarika Sinha CLA 2017-02-06 04:12:51 EST
Thanks Victor!!
Comment 12 Sarika Sinha CLA 2017-03-07 01:32:26 EST
Verified by code inspection using
Eclipse SDK

Version: Oxygen (4.7)
Build id: I20170305-2000