Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369680

Summary: IllegalStateException: PhpReconcilingStrategy#lineEndTable
Product: z_Archived Reporter: Natalia Bartol <natalia.bartol>
Component: PDTAssignee: PHP UI <php.ui-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: andreix, ganoro, jacek.pospychala, kalin.a
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
BadLocationException caught in Util.lineEndTable - patch jacek.pospychala: iplog+

Description Natalia Bartol CLA 2012-01-25 10:40:46 EST
Build Identifier: 

When main thread modifies file content parallel to DirtyRegionProcessor.BackgroundThread BadLocationException may be thrown in PhpReconcilingStrategy#lineEndTable:

java.lang.IllegalStateException: PhpReconcilingStrategy#lineEndTable(document
	at org.eclipse.php.internal.core.ast.util.Util.lineEndTable(Util.java:3272)
	at org.eclipse.php.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:184)
	at org.eclipse.php.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:157)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Reproducible: Sometimes

Steps to Reproduce:
1. Add and quickly remove few lines from the end of document. If DirtyRegionProcessor.BackgroundThread is still processing first modification (added lines) then exception is thrown.
Comment 1 Natalia Bartol CLA 2012-01-25 10:49:11 EST
Created attachment 210056 [details]
BadLocationException caught in Util.lineEndTable - patch

I think it's enough to catch BadLocationException and simply return the result as is instead of throwing IllegalStateException. As we know where this BadLocationException comes from and that nothing really unusual happened (concurrent thread access) there is no need to report this issue.  Reconciling process has already been triggered anew by the next modification. Clean error log will give users and developers a peace of mind.
Comment 2 Roy Ganor CLA 2012-01-26 06:44:53 EST
thanks!
Comment 3 Kalin CLA 2012-07-06 10:30:52 EDT
No longer reproduced.
Closing...

Kalin Yanev
kalin.a@zend.com
Comment 4 Curtis Windatt CLA 2013-06-11 12:09:08 EDT
*** Bug 410502 has been marked as a duplicate of this bug. ***