Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2017-02-20 02:50:01 +0000
committerMarc-Andre Laperle2017-02-20 02:51:36 +0000
commit00b30bb03a9af2543754bf5537bd0e890cb7d9ae (patch)
tree016c848e4c0d80dd1c33fdfa674fb38213e30779 /build/org.eclipse.cdt.managedbuilder.core
parent5a384894c6272a9d0c9f2f3ceef8ce1f0622b133 (diff)
downloadorg.eclipse.cdt-00b30bb03a9af2543754bf5537bd0e890cb7d9ae.tar.gz
org.eclipse.cdt-00b30bb03a9af2543754bf5537bd0e890cb7d9ae.tar.xz
org.eclipse.cdt-00b30bb03a9af2543754bf5537bd0e890cb7d9ae.zip
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>
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java
index bdccea7cd26..d60c832c8c4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java
@@ -103,7 +103,12 @@ public class ConfigurationModification extends FolderInfoModification implements
@Override
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(){

Back to the top