Bug 562812

Summary: Two NPEs thorwn during save in some cases
Product: [Eclipse Project] JDT Reporter: Arthur Daussy <arthur.daussy>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 4.14   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Attachments:
Description Flags
NPE 1
none
NPE2 none

Description Arthur Daussy CLA 2020-05-05 04:31:09 EDT
Hello,

In some case I get the two following NPEs when editing java files. When I reach a particular state, it prevents me from saving the file and each time I try to save it 2 NPEs are thrown. This state can't be reproduced easily (at least I have not succeeded yet to give you more information). Last time I have encountered it, I was editing the file in "Horizontal Split" mode. I don't know if it is linked because I think I already encountered this state without it.

I'm sorry I can't give more information. I have created this bug so those NPE are traced and maybe someone will recognize them and provide a nice, "step to reproduce".

----
java.lang.NullPointerException
	at org.eclipse.jdt.internal.ui.text.LineComparator.<init>(LineComparator.java:47)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility$2.getChangedLineRegions(EditorUtility.java:833)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility$2.run(EditorUtility.java:809)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.calculateChangedLineRegions(EditorUtility.java:782)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.commitWorkingCopy(CompilationUnitDocumentProvider.java:1413)
----

----
java.lang.NullPointerException
	at org.eclipse.ui.texteditor.SelectMarkerRulerAction.includesRulerLine(SelectMarkerRulerAction.java:293)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaSelectAnnotationRulerAction.findJavaAnnotation(JavaSelectAnnotationRulerAction.java:160)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaSelectAnnotationRulerAction.update(JavaSelectAnnotationRulerAction.java:111)
	at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.update(AbstractRulerActionDelegate.java:130)
	at org.eclipse.ui.texteditor.AbstractRulerActionDelegate.setActiveEditor(AbstractRulerActionDelegate.java:90)
	at org.eclipse.ui.internal.EditorPluginAction.editorChanged(EditorPluginAction.java:69)
	at org.eclipse.ui.internal.EditorActionBuilder$EditorContribution.editorChanged(EditorActionBuilder.java:78)
----

Complete logs in attachment
Comment 1 Arthur Daussy CLA 2020-05-05 04:31:41 EDT
Created attachment 282700 [details]
NPE 1
Comment 2 Arthur Daussy CLA 2020-05-05 04:32:08 EDT
Created attachment 282701 [details]
NPE2
Comment 3 Arthur Daussy CLA 2020-05-05 04:33:40 EDT
Extra information:

eclipse.application=org.eclipse.ui.ide.workbench
eclipse.buildId=4.14.0.I20191210-0610
eclipse.commands=-os
win32
-ws
win32
-arch
x86_64
-product
org.eclipse.epp.package.dsl.product
-vm
C:/dev/java/jdk-11.0.4+11/bin\client\jvm.dll
Comment 4 Noopur Gupta CLA 2020-05-05 04:48:22 EDT

*** This bug has been marked as a duplicate of bug 560525 ***