Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-patch] [cdt-patch]Model Builder Fixes

> 
> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
> 
> ------_=_NextPart_000_01C3035A.E47998A0
> Content-Type: text/plain
> 
> 
> The new CModelBuilder returns a map of the created elements and their infos.
> 

This will broke the old parser.

> -----Original Message-----
> From: Amer, Hoda [mailto:hamer@xxxxxxxxxxxx] 
> Sent: Monday, April 14, 2003 4:00 PM
> To: 'cdt-patch@xxxxxxxxxxx'
> Subject: [cdt-patch] [cdt-patch]
> 
> 
> This patch updates the create methods of the CModelBuilder:
> -changes visibility to protected.
> -returns the created element.
> 

This seems to create some problem with the old parser enable,
since now the Map is null.

Patch below, **Not** applied, I'll let you evaluate.

============================================================================

Index: model/org/eclipse/cdt/internal/core/model/TranslationUnit.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java,v
retrieving revision 1.5
diff -u -r1.5 TranslationUnit.java
--- model/org/eclipse/cdt/internal/core/model/TranslationUnit.java	15 Apr 2003 18:37:32 -0000	1.5
+++ model/org/eclipse/cdt/internal/core/model/TranslationUnit.java	16 Apr 2003 14:57:16 -0000
@@ -302,12 +302,14 @@
 		TranslationUnitInfo unitInfo = (TranslationUnitInfo) info;
 		
 		// generate structure
-		newElements = null;
-		newElements = this.parse();
+		Map mapping = this.parse();
 		
 		// this is temporary until the New Model Builder is implemented
-		if(newElements == null)
-			getNewElements(newElements, this);		
+		if(mapping == null) {
+			getNewElements(newElements, this);
+		} else {
+			newElements.putAll(mapping);
+		}
 		///////////////////////////////////////////////////////////////
 		
 		if (isWorkingCopy()) {



Back to the top