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

Bug 321228

Summary: problem with syntax highlighting resulting in BadLocationException
Product: z_Archived Reporter: michel kollenhoven <eclipse>
Component: PDTAssignee: Dawid Pakula <zulus>
Status: REOPENED --- QA Contact:
Severity: major    
Priority: P3 CC: eclipse, silver.zachara, tbl0605, thatnitind, thierryblind, wywrzal, zulus
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 429951, 445185    
Bug Blocks: 433557    
Attachments:
Description Flags
screen shot of markup none

Description michel kollenhoven CLA 2010-07-29 10:02:50 EDT
i get the following error,
note syntax highlight is not working correct(colors shift 2/3 chars from where it should be)
also keyword expantion is not working eigther

What steps will reproduce the problem?
nothing happands all the time 

if you need more info (other errors, traces, stacks, my php code, a list of my plugins anything) contact me(i might be still here)

if i did somthing wrog point me to the doc's
-- Error Details --
Date: Thu Jul 29 15:47:33 CEST 2010
Message: null
Severity: Error
Product: Eclipse 1.3.0.20100617-0520 (org.eclipse.epp.package.php.product)
Plugin: org.eclipse.wst.sse.ui
Session Data:
eclipse.buildId=I20100608-0911
java.version=1.6.0_21
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=nl_NL
Framework arguments:  -product org.eclipse.epp.package.php.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.php.product


Exception Stack Trace:
org.eclipse.jface.text.BadLocationException
	at org.eclipse.wst.sse.core.internal.text.GenericPositionManager.addPosition(GenericPositionManager.java:84)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.addPosition(BasicStructuredDocument.java:870)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter.updatePresentation(SemanticHighlightingPresenter.java:471)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter$1.run(SemanticHighlightingPresenter.java:404)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Comment 1 Nitin Dahyabhai CLA 2010-08-01 22:56:20 EDT
Does it only happen in the PHP Editor?
Comment 2 michel kollenhoven CLA 2010-08-02 06:04:05 EDT
(In reply to comment #1)
> Does it only happen in the PHP Editor?
yes i think it does, 
html, css, javascript looks fine


maybe this trace(also result of problem i think) will help you:

GL


---------8<--------
eclipse.buildId=I20100608-0911
java.version=1.6.0_21
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=nl_NL
Framework arguments:  -product org.eclipse.epp.package.php.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.php.product


Error
Fri Jul 30 14:31:21 CEST 2010
Index out of bounds

org.eclipse.dltk.core.ModelException: Index out of bounds
at org.eclipse.dltk.internal.core.Openable.codeSelect(Openable.java:564)
at org.eclipse.dltk.internal.core.AbstractSourceModule.codeSelect(AbstractSourceModule.java:85)
at org.eclipse.dltk.internal.core.AbstractSourceModule.codeSelect(AbstractSourceModule.java:76)
at org.eclipse.php.internal.ui.actions.PHPEditorResolvingAction.getSelectedElement(PHPEditorResolvingAction.java:101)
at org.eclipse.php.internal.ui.actions.PHPEditorResolvingAction.run(PHPEditorResolvingAction.java:42)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Comment 3 michel kollenhoven CLA 2010-08-03 06:55:54 EDT
Created attachment 175765 [details]
screen shot of markup

hi i have attached a screen shot of the invalid markup
including the stack traces form this session

this happed after restating eclipse(from file)

good luck and let me know if any debugging is required
-----------------8<------
!SESSION 2010-08-03 12:19:38.101 -----------------------------------------------
eclipse.buildId=I20100608-0911
java.version=1.6.0_21
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=nl_NL
Framework arguments:  -product org.eclipse.epp.package.php.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.php.product

!ENTRY org.eclipse.wst.sse.ui 4 4 2010-08-03 12:44:58.241
!MESSAGE null
!STACK 0
org.eclipse.jface.text.BadLocationException
	at org.eclipse.wst.sse.core.internal.text.GenericPositionManager.addPosition(GenericPositionManager.java:84)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.addPosition(BasicStructuredDocument.java:870)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter.updatePresentation(SemanticHighlightingPresenter.java:471)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter$1.run(SemanticHighlightingPresenter.java:404)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

!ENTRY org.eclipse.wst.sse.ui 4 4 2010-08-03 12:45:13.898
!MESSAGE null
!STACK 0
org.eclipse.jface.text.BadLocationException
	at org.eclipse.wst.sse.core.internal.text.GenericPositionManager.addPosition(GenericPositionManager.java:84)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.addPosition(BasicStructuredDocument.java:870)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter.updatePresentation(SemanticHighlightingPresenter.java:471)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter$1.run(SemanticHighlightingPresenter.java:404)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

!ENTRY org.eclipse.wst.sse.ui 4 4 2010-08-03 12:45:21.024
!MESSAGE null
!STACK 0
org.eclipse.jface.text.BadLocationException
	at org.eclipse.wst.sse.core.internal.text.GenericPositionManager.addPosition(GenericPositionManager.java:84)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.addPosition(BasicStructuredDocument.java:870)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter.updatePresentation(SemanticHighlightingPresenter.java:471)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter$1.run(SemanticHighlightingPresenter.java:404)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

!ENTRY org.eclipse.jface.text 2 0 2010-08-03 12:46:00.526
!MESSAGE 
!STACK 0
java.lang.NullPointerException
	at org.eclipse.dltk.ui.text.completion.ProposalInfo.extractScriptdoc(ProposalInfo.java:106)
	at org.eclipse.dltk.ui.text.completion.ProposalInfo.computeInfo(ProposalInfo.java:84)
	at org.eclipse.dltk.ui.text.completion.ProposalInfo.getInfo(ProposalInfo.java:67)
	at org.eclipse.dltk.ui.text.completion.AbstractScriptCompletionProposal.getAdditionalProposalInfo(AbstractScriptCompletionProposal.java:440)
	at org.eclipse.jface.text.contentassist.AdditionalInfoController$3.run(AdditionalInfoController.java:106)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

!ENTRY org.eclipse.jface.text 2 0 2010-08-03 12:46:01.463
!MESSAGE 
!STACK 0
java.lang.NullPointerException
	at org.eclipse.dltk.ui.text.completion.ProposalInfo.extractScriptdoc(ProposalInfo.java:106)
	at org.eclipse.dltk.ui.text.completion.ProposalInfo.computeInfo(ProposalInfo.java:84)
	at org.eclipse.dltk.ui.text.completion.ProposalInfo.getInfo(ProposalInfo.java:67)
	at org.eclipse.dltk.ui.text.completion.AbstractScriptCompletionProposal.getAdditionalProposalInfo(AbstractScriptCompletionProposal.java:440)
	at org.eclipse.jface.text.contentassist.AdditionalInfoController$3.run(AdditionalInfoController.java:106)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

!ENTRY org.eclipse.jface.text 2 0 2010-08-03 12:46:10.182
!MESSAGE 
!STACK 0
java.lang.NullPointerException
	at org.eclipse.dltk.ui.text.completion.ProposalInfo.extractScriptdoc(ProposalInfo.java:106)
	at org.eclipse.dltk.ui.text.completion.ProposalInfo.computeInfo(ProposalInfo.java:84)
	at org.eclipse.dltk.ui.text.completion.ProposalInfo.getInfo(ProposalInfo.java:67)
	at org.eclipse.dltk.ui.text.completion.AbstractScriptCompletionProposal.getAdditionalProposalInfo(AbstractScriptCompletionProposal.java:440)
	at org.eclipse.jface.text.contentassist.AdditionalInfoController$3.run(AdditionalInfoController.java:106)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 4 Silver Zachara CLA 2010-08-05 10:33:29 EDT
*** Bug 321180 has been marked as a duplicate of this bug. ***
Comment 5 michel kollenhoven CLA 2010-08-06 11:02:01 EDT
this might also be of interest 

might happen when the same file is open twice(is possible, is this correct behavior?)

(it its a separate bug et me know)

----------------8<-----------
java.lang.ArrayIndexOutOfBoundsException
	at java.lang.System.arraycopy(Native Method)
	at java.lang.AbstractStringBuilder.append(Unknown Source)
	at java.lang.StringBuffer.append(Unknown Source)
	at org.eclipse.jface.text.GapTextStore.get(GapTextStore.java:164)
	at org.eclipse.wst.sse.core.internal.text.StructuredDocumentTextStore.get(StructuredDocumentTextStore.java:66)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.get(BasicStructuredDocument.java:1210)
	at org.eclipse.dltk.internal.ui.editor.DocumentAdapter.getContents(DocumentAdapter.java:303)
	at org.eclipse.dltk.internal.core.AbstractSourceModule.getSource(AbstractSourceModule.java:301)
	at org.eclipse.php.internal.core.codeassist.PHPSelectionEngine.internalASTResolve(PHPSelectionEngine.java:155)
	at org.eclipse.php.internal.core.codeassist.PHPSelectionEngine.select(PHPSelectionEngine.java:97)
	at org.eclipse.dltk.internal.core.Openable.codeSelect(Openable.java:578)
	at org.eclipse.dltk.internal.core.AbstractSourceModule.codeSelect(AbstractSourceModule.java:85)
	at org.eclipse.dltk.internal.core.AbstractSourceModule.codeSelect(AbstractSourceModule.java:76)
	at org.eclipse.php.internal.ui.editor.highlighters.InternalClassHighlighting.isInternalClass(InternalClassHighlighting.java:60)
	at org.eclipse.php.internal.ui.editor.highlighters.InternalClassHighlighting.access$0(InternalClassHighlighting.java:57)
	at org.eclipse.php.internal.ui.editor.highlighters.InternalClassHighlighting$InternalClassApply.visit(InternalClassHighlighting.java:29)
	at org.eclipse.php.internal.core.ast.nodes.Identifier.accept0(Identifier.java:66)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.core.ast.nodes.Variable.childrenAccept(Variable.java:120)
	at org.eclipse.php.internal.core.ast.nodes.Variable.accept0(Variable.java:114)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.core.ast.nodes.FunctionName.childrenAccept(FunctionName.java:74)
	at org.eclipse.php.internal.core.ast.nodes.FunctionName.accept0(FunctionName.java:68)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.core.ast.nodes.FunctionInvocation.childrenAccept(FunctionInvocation.java:86)
	at org.eclipse.php.internal.core.ast.nodes.FunctionInvocation.accept0(FunctionInvocation.java:80)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.core.ast.nodes.MethodInvocation.childrenAccept(MethodInvocation.java:82)
	at org.eclipse.php.internal.core.ast.nodes.MethodInvocation.accept0(MethodInvocation.java:75)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.core.ast.nodes.ExpressionStatement.childrenAccept(ExpressionStatement.java:73)
	at org.eclipse.php.internal.core.ast.nodes.ExpressionStatement.accept0(ExpressionStatement.java:67)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.core.ast.nodes.Block.childrenAccept(Block.java:97)
	at org.eclipse.php.internal.core.ast.nodes.Block.accept0(Block.java:90)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.core.ast.nodes.IfStatement.childrenAccept(IfStatement.java:98)
	at org.eclipse.php.internal.core.ast.nodes.IfStatement.accept0(IfStatement.java:89)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.core.ast.nodes.Block.childrenAccept(Block.java:97)
	at org.eclipse.php.internal.core.ast.nodes.Block.accept0(Block.java:90)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.core.ast.nodes.FunctionDeclaration.childrenAccept(FunctionDeclaration.java:108)
	at org.eclipse.php.internal.core.ast.nodes.FunctionDeclaration.accept0(FunctionDeclaration.java:97)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.core.ast.nodes.MethodDeclaration.childrenAccept(MethodDeclaration.java:90)
	at org.eclipse.php.internal.core.ast.nodes.MethodDeclaration.accept0(MethodDeclaration.java:82)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.core.ast.nodes.Block.childrenAccept(Block.java:97)
	at org.eclipse.php.internal.core.ast.nodes.Block.accept0(Block.java:90)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.core.ast.nodes.ClassDeclaration.childrenAccept(ClassDeclaration.java:118)
	at org.eclipse.php.internal.core.ast.nodes.ClassDeclaration.accept0(ClassDeclaration.java:104)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.core.ast.nodes.Program.childrenAccept(Program.java:195)
	at org.eclipse.php.internal.core.ast.nodes.Program.accept0(Program.java:188)
	at org.eclipse.php.internal.core.ast.nodes.ASTNode.accept(ASTNode.java:275)
	at org.eclipse.php.internal.ui.editor.highlighter.AbstractSemanticHighlighting.consumes(AbstractSemanticHighlighting.java:93)
	at org.eclipse.php.internal.ui.editor.highlighter.AbstractSemanticHighlighting.consumes(AbstractSemanticHighlighting.java:102)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingReconciler.reconcile(SemanticHighlightingReconciler.java:127)
	at org.eclipse.wst.sse.ui.internal.reconcile.DocumentRegionProcessor.endProcessing(DocumentRegionProcessor.java:119)
	at org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor.run(DirtyRegionProcessor.java:682)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 6 michel kollenhoven CLA 2010-08-31 06:17:13 EDT
b.t.w. are the NullPointerExceptions the same bug or a seperate one?
Comment 7 Nitin Dahyabhai CLA 2011-04-28 00:02:00 EDT
(In reply to comment #6)
> b.t.w. are the NullPointerExceptions the same bug or a seperate one?

I would think separate, but only the PDT team would know for sure.

I'm not sure what circumstances bring about the trace from comment 5.
Comment 8 Dawid Pakula CLA 2014-03-07 14:09:48 EST
This problem still exists (from screen and logs).

It produce invalid highlighting, sometimes invalid selection.

Stack:
org.eclipse.jface.text.BadLocationException
	at org.eclipse.wst.sse.core.internal.text.GenericPositionManager.addPosition(GenericPositionManager.java:84)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.addPosition(BasicStructuredDocument.java:870)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter.updatePresentation(SemanticHighlightingPresenter.java:476)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter$1.run(SemanticHighlightingPresenter.java:409)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3976)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3653)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Comment 9 Dawid Pakula CLA 2014-03-10 17:22:48 EDT
This patch resolves syntax coloring problem:
http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=2da229ab265126c4f7211e33cd52ae48ad8b9e6c

BadLocationException is still actual.
Comment 10 Thierry BLIND CLA 2014-04-15 16:13:55 EDT
Hello,
it seems that patch 2da229ab265126c4f7211e33cd52ae48ad8b9e6c introduced a regression and is the culprit for bug 432592.
When I remove the following code added to the class PHPStructuredEditor, bug 432592 vanishes :

// XXX hide bad locations (invalid sync)
if (offset + length > getDocument().getLength()) {
	length = length - offset + length
			- getDocument().getLength();
}
setHighlightRange(offset, length, moveCursor);

It's just a workaround, as I don't understand much to this class.
Dawid, could you have a look please ?

Thank you !
Comment 11 Dawid Pakula CLA 2014-04-16 06:03:48 EDT
You have right. Please wait for #430049
Comment 12 Thierry BLIND CLA 2014-04-16 10:57:28 EDT
Ok, thank you Dawid ! Will redo some tests when you're ready ;)
Comment 13 Dawid Pakula CLA 2014-04-26 18:47:59 EDT
I sliced patch from 430049 and moved to gerrit [1]

Be aware, this patch require wtp source editing plugin from Luna (latest snapshot or M7)

[1] https://git.eclipse.org/r/25619
Comment 15 Michal Niewrzal CLA 2015-06-10 03:11:32 EDT
Closing.
Comment 16 Thierry BLIND CLA 2015-06-18 13:20:54 EDT
I reopen.
Happened to me today, with latest PDT snapshot :

eclipse.buildId=4.4.2.M20150204-1700
java.version=1.6.0_43
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_FR
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product

org.eclipse.wst.sse.ui
Error
Thu Jun 18 16:23:10 CEST 2015
null

org.eclipse.jface.text.BadLocationException
	at org.eclipse.wst.sse.core.internal.text.GenericPositionManager.addPosition(GenericPositionManager.java:84)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.addPosition(BasicStructuredDocument.java:870)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter.updatePresentation(SemanticHighlightingPresenter.java:476)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter$1.run(SemanticHighlightingPresenter.java:409)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
	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(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	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)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

Thierry.
Comment 17 Thierry BLIND CLA 2016-07-01 15:33:11 EDT
I haven't seen this bug for a while now. My comment in this bug report was one of my first contribution to pdt :) 
I close this bug report.
Comment 18 Thierry BLIND CLA 2016-11-10 07:07:31 EST
Sadly still not solved, but now I found an easier way to reproduce the bug (see my comment at bug 445185).

Thierry.
Comment 19 Thierry BLIND CLA 2016-11-10 09:28:34 EST
With up-to-date error log:

eclipse.buildId=4.6.1.M20160907-1200
java.version=1.8.0_66
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_FR
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product

org.eclipse.wst.sse.ui
Error
Thu Nov 10 15:27:43 CET 2016
null

org.eclipse.jface.text.BadLocationException
	at org.eclipse.wst.sse.core.internal.text.GenericPositionManager.addPosition(GenericPositionManager.java:84)
	at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.addPosition(BasicStructuredDocument.java:870)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter.updatePresentation(SemanticHighlightingPresenter.java:476)
	at org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter$1.run(SemanticHighlightingPresenter.java:409)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4203)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3819)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	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:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1492)