Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-11-21 10:32:52 -0500
committerDoug Schaefer2013-01-24 16:46:18 -0500
commitae5472cf2792a392c1b6fdd2f40b2a4a855981b0 (patch)
treef1c1e33b3b1af4616a260e01dcad708d721de78a
parentc855cf684d37a5b3537b71b7c60c9d5b385abfc6 (diff)
downloadorg.eclipse.cdt-cdt_8_0.tar.gz
org.eclipse.cdt-cdt_8_0.tar.xz
org.eclipse.cdt-cdt_8_0.zip
Bug 394735: NPE when parallelizationNumber is missing, modified patch from Mohamed Hussein <mohamed_hussein@mentor.com>cdt_8_0
Change-Id: I4cb60f33f6fc405ab9110668d30e18bd708532d7 Reviewed-on: https://git.eclipse.org/r/9887 Reviewed-by: Doug Schaefer <dschaefer@qnx.com> IP-Clean: Doug Schaefer <dschaefer@qnx.com> Tested-by: Doug Schaefer <dschaefer@qnx.com>
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java
index 009f7293d1..d695a839d7 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Builder.java
@@ -632,26 +632,27 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
private int decodeParallelizationNumber(String value) {
int parallelNumber = -1;
- if (VALUE_OPTIMAL.equals(value)) {
+ if (value == null || VALUE_OPTIMAL.equals(value)) {
parallelNumber = -getOptimalParallelJobNum();
} else if (VALUE_UNLIMITED.equals(value)) {
parallelNumber = UNLIMITED_JOBS;
} else {
try {
parallelNumber = Integer.decode(value);
+ if (parallelNumber <= 0) {
+ // compatibility with legacy representation - it was that inconsistent
+ if (isInternalBuilder()) {
+ // "optimal" for Internal Builder
+ parallelNumber = -getOptimalParallelJobNum();
+ } else {
+ // unlimited for External Builder
+ parallelNumber = UNLIMITED_JOBS;
+ }
+ }
} catch (NumberFormatException e) {
ManagedBuilderCorePlugin.log(e);
- parallelNumber = getOptimalParallelJobNum();
- }
- if (parallelNumber <= 0) {
- // compatibility with legacy representation - it was that inconsistent
- if (isInternalBuilder()) {
- // "optimal" for Internal Builder
- parallelNumber = -getOptimalParallelJobNum();
- } else {
- // unlimited for External Builder
- parallelNumber = UNLIMITED_JOBS;
- }
+ // default to "optimal" if not recognized
+ parallelNumber = -getOptimalParallelJobNum();
}
}
return parallelNumber;

Back to the top