Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Create new managed C++ Project crashes with new tool definition (see bug 100572)

 
Hello folks,

I tried to define a new project type which contains an additional new
tool (which does not have a superclass). When trying a new project from
the type I get error messages (see details and samples to reproduce the
problem in bugzilla 100572).

I tracked the problem and I think I found the cause and the solution in
the fact that the code of
org.eclipse.cdt.managedbuilder.internal.core.ToolChain.getTools()
assumes that the call to
org.eclipse.cdt.managedbuilder.internal.core.Tool.getSuperClass() never
returns null. (Which is the case with my newly defined tool). See the
code snippet from getTools():

getTools()
702: 				for (j = 0; j < tools.length; j++) {
					if
(tool.getSuperClass().getId().equals(tools[j].getId())) {
						tools[j] = tool;
						break;
					}

The problem is easily fixed by guarding the call to getId() with another
condition in the if statement:

getTools()
702: 				for (j = 0; j < tools.length; j++) {
					if ((tool.getSuperClass()!=null)
&&
	
(tool.getSuperClass().getId().equals(tools[j].getId()))) {
						tools[j] = tool;
						break;
					}

With this fix my new tool also works. I have posted more details and the
patches in bugzilla 100572. What I would like to know is:

- Is this fix acceptable? Who will evaluate my patch? Can I go ahead and
publish my patches in cdt-patch? 
- Is there a chance that this fix will be included in the CDT 3.0
release? (need not be RC1).

Regards


Norbert



Back to the top