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

Bug 355312

Summary: CA doesn't work for big php-files
Product: z_Archived Reporter: Amigo <violator>
Component: PDTAssignee: PHP Core <php.core-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P2 CC: ganoro, wywrzal, zhaozhongwei
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
example
none
patch
none
new patch
none
exception none

Description Amigo CLA 2011-08-21 07:45:46 EDT
Build Identifier: I20110613-1736

PDT build ID - 3.0.0.v20110516-1100-77--84_23JBVgSVXO7XGJz0VLa9O

In a file that consists of thousands rows CA (or Validator) it occurs error - "Unhandled event loop exception" with exception trace:

java.lang.StackOverflowError
	at org.eclipse.core.internal.resources.Resource.hashCode(Resource.java:1287)
	at org.eclipse.dltk.internal.core.ProjectFragment.hashCode(ProjectFragment.java:114)
	at org.eclipse.dltk.internal.core.ScriptFolder.hashCode(ScriptFolder.java:127)
	at org.eclipse.dltk.internal.core.ModelElement.hashCode(ModelElement.java:299)
	at org.eclipse.dltk.internal.core.ModelElement.hashCode(ModelElement.java:299)
	at java.util.HashMap.get(Unknown Source)
	at org.eclipse.dltk.internal.core.hierarchy.TypeHierarchy.getSuperclass(TypeHierarchy.java:589)
	at org.eclipse.dltk.internal.core.hierarchy.TypeHierarchy.getAllSuperclasses(TypeHierarchy.java:483)
...

If I try force CA by Ctrl+Space it show window without completion (but it must be). 

In small files it works ok.

Reproducible: Sometimes

Steps to Reproduce:
1. Occurs for big PHP files (I've got more than 5000 rows)
Comment 1 Amigo CLA 2011-08-21 09:00:58 EDT
If I disable validation there is no exception. But there is no CA too.
Comment 2 Roy Ganor CLA 2011-08-21 09:09:43 EDT
any chance you provide an live example?

Thanks
Comment 3 Amigo CLA 2011-08-21 11:58:25 EDT
Created attachment 201870 [details]
example

Here is PHP-files for example
------
Also I've founded that it occurs after typing something after keyword $this->... inside a method.
CA works fine with keyword parent::
------
I've tested my project at Linux (x86-64)
Build ID - 20110615-0604
PDT Build ID - 3.0.0 v20110516-1100
Java 1.7.0-b147
Works fine
I wonder. It seems like virtual machine for windows generates this exception at a low level...
Comment 4 Amigo CLA 2011-08-21 18:27:38 EDT
Additional searching...

I think something wrong with multiply extending classes.

--------------- Works
	require_once($_SERVER['DOCUMENT_ROOT'] . "/modules/core/class/DOM.php");
	class B  extends _Element  {
		public function m() {
			$this->
		}
	}
---------------


--------------- Occurs error
	require_once($_SERVER['DOCUMENT_ROOT'] . "/modules/core/class/DOM.php");
	class B  extends _HTMLElement  {
		public function m() {
			$this->
		}
	}
---------------

typing something after "$this->" generates exception
Comment 5 Amigo CLA 2011-08-21 18:39:27 EDT
*** Bug 355309 has been marked as a duplicate of this bug. ***
Comment 6 Zhongwei Zhao CLA 2011-08-22 02:47:53 EDT
can you paste the whole exception log?
Comment 7 Zhongwei Zhao CLA 2011-08-22 03:17:47 EDT
Created attachment 201892 [details]
patch

a patch for dltk
Comment 8 Zhongwei Zhao CLA 2011-08-22 03:21:36 EDT
Created attachment 201893 [details]
new patch

new patch for dltk
Comment 9 Amigo CLA 2011-08-22 03:24:52 EDT
Created attachment 201894 [details]
exception
Comment 10 Michal Niewrzal CLA 2016-06-13 06:28:28 EDT
Still reproducible.