Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Applied Re: ALAIN :Re: [cdt-patch] Dep Tree Patch

> 
> While this patch looks OK to me, and the suite runs as it did before on 
> Linux and Windows, I'm not sure how exactly how to reproduce the error.
> Without the patch, I updated a binary and did not see the 
> NullPointerException. 
> 

The first part:
	It was for binaries and files with no extensions for example,
	 gcc(no *.exe), or "cstdio" (no .h).

The second part:
	Trace log for the DeltaProcessor, looks fine to me

> Alain, can you please look into validating and applying this for Bogdan? 

Patch applied, thanks bogdan.

Index: .options
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/.options,v
retrieving revision 1.2
diff -u -r1.2 .options
--- .options	26 Aug 2003 19:15:58 -0000	1.2
+++ .options	12 Sep 2003 18:50:16 -0000
@@ -19,4 +19,7 @@
 org.eclipse.cdt.core/debug/matchlocator=false
 
 # Reports background dependency tree activity
-org.eclipse.cdt.core/debug/dependency=false
\ No newline at end of file
+org.eclipse.cdt.core/debug/dependency=false
+
+# Reports delta processor tree activity
+org.eclipse.cdt.core/debug/deltaprocessor=false
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/ChangeLog,v
retrieving revision 1.146
diff -u -r1.146 ChangeLog
--- ChangeLog	12 Sep 2003 18:19:05 -0000	1.146
+++ ChangeLog	12 Sep 2003 18:50:16 -0000
@@ -1,3 +1,14 @@
+2003-09-12 Alain Magloire
+	Patch from Bogdan Gheorghe, it corrected a NPE, when dealing with file extensions.
+	In a Unix enviroment binaries do not have extensions also some C++ headers
+	do not have extension, for example "cstdio" etc .. The patch guard agains null.
+	
+	Second part added debug loggin trace
+
+	* .options
+	* model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java
+	* src/org/eclipse/cdt/core/CCorePlugin.java
+
 2003-09-12 Keith Campbell
     Added missing dependency on org.eclipse.team.core (this plugin defines extensions
     to org.eclipse.team.core.fileTypes and org.eclipse.team.core.ignore).
Index: model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java,v
retrieving revision 1.14
diff -u -r1.14 DeltaProcessor.java
--- model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java	9 Sep 2003 17:53:51 -0000	1.14
+++ model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java	12 Sep 2003 18:50:16 -0000
@@ -520,10 +520,16 @@
 	
 	private void updateDependencies(ICElement element){
 		//Update table
-		String fileExtension = element.getResource().getFileExtension();
-		if (fileExtension.equals("h") ||
+		IResource resource = element.getResource();
+		if (resource == null)
+		 return;
+		 
+		String fileExtension = resource.getFileExtension();
+		
+		if ((fileExtension != null) &&
+			(fileExtension.equals("h") ||
 			fileExtension.equals("hh") ||
-			fileExtension.equals("hpp")){
+			fileExtension.equals("hpp"))){
 		
 			if (sourceDependencyManager.getProjectDependsForFile(element.getResource().getLocation().toOSString()) == null){
 				//retrigger dep trees
Index: src/org/eclipse/cdt/core/CCorePlugin.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java,v
retrieving revision 1.30
diff -u -r1.30 CCorePlugin.java
--- src/org/eclipse/cdt/core/CCorePlugin.java	10 Sep 2003 14:26:00 -0000	1.30
+++ src/org/eclipse/cdt/core/CCorePlugin.java	12 Sep 2003 18:50:16 -0000
@@ -25,6 +25,7 @@
 import org.eclipse.cdt.internal.core.CPathEntry;
 import org.eclipse.cdt.internal.core.model.BufferManager;
 import org.eclipse.cdt.internal.core.model.CModelManager;
+import org.eclipse.cdt.internal.core.model.DeltaProcessor;
 import org.eclipse.cdt.internal.core.model.IBufferFactory;
 import org.eclipse.cdt.internal.core.model.IWorkingCopy;
 import org.eclipse.cdt.internal.core.model.Util;
@@ -827,6 +828,7 @@
 	private static final String MATCH_LOCATOR  = CCorePlugin.PLUGIN_ID + "/debug/matchlocator" ; //$NON-NLS-1$
 	private static final String PARSER = CCorePlugin.PLUGIN_ID + "/debug/parser" ; //$NON-NLS-1$
 	private static final String DEPENDENCY = CCorePlugin.PLUGIN_ID + "/debug/dependency" ; //$NON-NLS-1$
+	private static final String DELTA = CCorePlugin.PLUGIN_ID + "/debug/deltaprocessor" ;
 	/**
 	 * Configure the plugin with respect to option settings defined in ".options" file
 	 */
@@ -858,6 +860,9 @@
 		
 			option = Platform.getDebugOption(SEARCH);
 			if(option != null) SearchEngine.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
+			
+			option = Platform.getDebugOption(DELTA);
+			if(option != null) DeltaProcessor.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
 			
 			option = Platform.getDebugOption(MATCH_LOCATOR);
 			if(option != null) MatchLocator.VERBOSE = option.equalsIgnoreCase("true") ; //$NON-NLS-1$



Back to the top