1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Bug 512096 - Fix NPE selecting an LLVM toolchain in toolchain editor

When a toolchain is selected along with its builder, the builder gets
matched to a “real builder” (ManagedBuildManager.getRealBuilder). If the
builder is abstract, the builder is not in the possible list of matches,
as implemented in Builder.getMatchKey. This causes
getCurrentBuilderCompatibilityInfo to return null which is not handled.

This patch changes the base LLVM builder to a non-abstract one, which
solves this specific NPE.
Also, in order to be more helpful to the user in case it happens to
another toolchain, a null check was added with an error message that the
builder is incompatible. Then at least, it is more clear that something
is wrong and the user can pick a different builder. 

Change-Id: I4d26c568dfe6307b496719c10908a36933fd3ab8
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
This commit is contained in:
Marc-Andre Laperle 2017-02-19 21:50:01 -05:00
parent 5a384894c6
commit 00b30bb03a
2 changed files with 7 additions and 2 deletions

View file

@ -103,7 +103,12 @@ public class ConfigurationModification extends FolderInfoModification implements
@Override @Override
public CompatibilityStatus getBuilderCompatibilityStatus() { public CompatibilityStatus getBuilderCompatibilityStatus() {
return getCurrentBuilderCompatibilityInfo().getCompatibilityStatus(); BuilderCompatibilityInfoElement currentBuilderCompatibilityInfo = getCurrentBuilderCompatibilityInfo();
if (currentBuilderCompatibilityInfo == null) {
return new CompatibilityStatus(IStatus.ERROR, Messages.getString("ConfigurationModification.0"), null); //$NON-NLS-1$
}
return currentBuilderCompatibilityInfo.getCompatibilityStatus();
} }
private ConflictMatchSet getParentConflictMatchSet(){ private ConflictMatchSet getParentConflictMatchSet(){

View file

@ -1092,7 +1092,7 @@
targetTool="cdt.managedbuild.tool.llvm.archiver"> targetTool="cdt.managedbuild.tool.llvm.archiver">
<builder <builder
id="cdt.managedbuild.target.llvm.builder.base" id="cdt.managedbuild.target.llvm.builder.base"
isAbstract="true" isAbstract="false"
superClass="org.eclipse.cdt.build.core.internal.builder"> superClass="org.eclipse.cdt.build.core.internal.builder">
</builder> </builder>
<tool <tool