Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2017-02-19 21:50:01 -0500
committerGerrit Code Review @ Eclipse.org2017-02-21 09:16:31 -0500
commit848b4c4bae7b7d50648ce05e7f329c4e35dda156 (patch)
treeed107d79898676544d2b8dd0b7ed031579b24b69
parentd96eb8b4c7249d191eedb64f3a03c7d047ffdfd1 (diff)
downloadorg.eclipse.cdt-848b4c4bae7b7d50648ce05e7f329c4e35dda156.tar.gz
org.eclipse.cdt-848b4c4bae7b7d50648ce05e7f329c4e35dda156.tar.xz
org.eclipse.cdt-848b4c4bae7b7d50648ce05e7f329c4e35dda156.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> (cherry picked from commit 00b30bb03a9af2543754bf5537bd0e890cb7d9ae)
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ConfigurationModification.java7
-rwxr-xr-xllvm/org.eclipse.cdt.managedbuilder.llvm.ui/plugin.xml2
2 files changed, 7 insertions, 2 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 bdccea7cd2..d60c832c8c 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(){
diff --git a/llvm/org.eclipse.cdt.managedbuilder.llvm.ui/plugin.xml b/llvm/org.eclipse.cdt.managedbuilder.llvm.ui/plugin.xml
index e803fc869b..b5aabd8e6a 100755
--- a/llvm/org.eclipse.cdt.managedbuilder.llvm.ui/plugin.xml
+++ b/llvm/org.eclipse.cdt.managedbuilder.llvm.ui/plugin.xml
@@ -1092,7 +1092,7 @@
targetTool="cdt.managedbuild.tool.llvm.archiver">
<builder
id="cdt.managedbuild.target.llvm.builder.base"
- isAbstract="true"
+ isAbstract="false"
superClass="org.eclipse.cdt.build.core.internal.builder">
</builder>
<tool

Back to the top