Bug 303555 - [performance] When building source type bindings check for a duplicate entry before added a "nextType"
Summary: [performance] When building source type bindings check for a duplicate entry ...
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M6   Edit
Assignee: Chris Jaun CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2010-02-22 16:44 EST by Chris Jaun CLA
Modified: 2010-02-22 17:22 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Jaun CLA 2010-02-22 16:44:56 EST
In CompilationUnitScope the buildTypeBindings method adds new types to a "nextType" filed of SourceTypeBinding if a binding of the same name has already been created.

if (existingBinding!=null && typeDecl.isNamed()  )
				{
					if (existingBinding.nextType!=null)
					{
						existingBinding.addNextType(type);
					}
					else
					{
						if (!CharOperation.equals(type.fileName, existingBinding.fileName))
							existingBinding.addNextType(type);
					}
					environment.defaultPackage.addType(existingBinding);
					fPackage.addType(existingBinding);
				}

We don't want want to be adding duplicate next types because it hurts performance.

Add some duplicate checking code in the addNextType() method.
Comment 1 Chris Jaun CLA 2010-02-22 17:22:42 EST
Code checked in.