use of com.ibm.uma.UMAException in project openj9 by eclipse.
the class PredicateList method evalutePredicate.
boolean evalutePredicate(String predicate) throws UMAException {
String[] preds = predicate.split("\\s");
boolean result = true;
boolean predicateFound = false;
boolean andOp = false;
boolean orOp = false;
boolean xorOp = false;
boolean notOp = false;
for (String pred : preds) {
if (pred.equalsIgnoreCase("and")) {
if (orOp || xorOp || notOp || !predicateFound) {
throw new UMAException("Error: badly formed predicate [" + predicate + "] in " + containingFile);
}
andOp = true;
continue;
} else if (pred.equalsIgnoreCase("or")) {
if (andOp || xorOp || notOp || !predicateFound) {
throw new UMAException("Error: badly formed predicate [" + predicate + "] in " + containingFile);
}
orOp = true;
continue;
} else if (pred.equalsIgnoreCase("xor")) {
if (andOp || orOp || notOp || !predicateFound) {
throw new UMAException("Error: badly formed predicate [" + predicate + "] in " + containingFile);
}
xorOp = true;
continue;
} else if (pred.equalsIgnoreCase("not")) {
notOp = true;
continue;
} else {
predicateFound = true;
}
if (andOp) {
result = result && (notOp ? !evaluateSinglePredicate(pred) : evaluateSinglePredicate(pred));
} else if (orOp) {
result = result || (notOp ? !evaluateSinglePredicate(pred) : evaluateSinglePredicate(pred));
} else if (xorOp) {
result = result ^ (notOp ? !evaluateSinglePredicate(pred) : evaluateSinglePredicate(pred));
} else {
result = notOp ? !evaluateSinglePredicate(pred) : evaluateSinglePredicate(pred);
}
notOp = false;
orOp = false;
andOp = false;
xorOp = false;
}
return result;
}
use of com.ibm.uma.UMAException in project openj9 by eclipse.
the class PlatformWindows method writeTopLevelTargets.
@Override
public void writeTopLevelTargets(StringBuffer buffer) throws UMAException {
super.writeTopLevelTargets(buffer);
if (!configuration.isFlagSet("uma_windowsRebase")) {
// No rebase in openj9 builds
// ReBase.exe has been removed since Windows SDK 8. It could be replaced with "editbin /REBASE":
// e.g.
// editbin /REBASE:BASE=0x7FFFF750000,DOWN /DYNAMICBASE:NO /NOLOGO <list of *.ddl files>
buffer.append("\n");
buffer.append("export UMA_SINGLE_REBASE=1\n");
buffer.append("\n\n");
} else {
try {
// Add the rebase targets
writeRebaseTargets(buffer);
writeTweakedPhaseTargets(buffer);
} catch (IOException e) {
throw new UMAException(e);
}
}
}
use of com.ibm.uma.UMAException in project openj9 by eclipse.
the class Spec method get.
public TemplateModel get(String arg0) throws TemplateModelException {
if (arg0.equals("flags")) {
return new Flags();
}
if (arg0.equals("tools")) {
return new Tools();
}
if (arg0.equals("properties")) {
return new Properties();
}
if (arg0.equals("artifacts")) {
return new Artifacts(UMA.getUma().getArtifacts());
}
if (arg0.equals("type")) {
return new Type();
}
if (arg0.equals("processor")) {
return new Processor();
}
try {
TemplateModel platformExtension = com.ibm.uma.UMA.getUma().getPlatform().getDataModelExtension("uma.spec", arg0);
if (platformExtension != null)
return platformExtension;
TemplateModel configurationExtension = com.ibm.uma.UMA.getUma().getConfiguration().getDataModelExtension("uma.spec", arg0);
if (configurationExtension != null)
return configurationExtension;
} catch (UMAException e) {
throw new TemplateModelException(e);
}
return null;
}
use of com.ibm.uma.UMAException in project openj9 by eclipse.
the class Flag method get.
public TemplateModel get(String arg0) throws TemplateModelException {
if (arg0.equals("name")) {
return new SimpleScalar(flag);
}
if (arg0.equals("enabled")) {
return new BooleanModel(UMA.getUma().getConfiguration().isFlagSet(flag), new BeansWrapper());
}
try {
TemplateModel platformExtension = com.ibm.uma.UMA.getUma().getPlatform().getDataModelExtension("uma.spec.flags." + flag, arg0);
if (platformExtension != null)
return platformExtension;
TemplateModel configurationExtension = com.ibm.uma.UMA.getUma().getConfiguration().getDataModelExtension("uma.spec.flags." + flag, arg0);
if (configurationExtension != null)
return configurationExtension;
} catch (UMAException e) {
throw new TemplateModelException(e);
}
return null;
}
use of com.ibm.uma.UMAException in project openj9 by eclipse.
the class Artifact method get.
public TemplateModel get(String arg0) throws TemplateModelException {
try {
if (arg0.equals("name")) {
return new ArtifactName(artifact);
}
if (arg0.equals("data")) {
return new ArtifactData(artifact);
}
if (arg0.equals("targetNameWithRelease")) {
return new SimpleScalar(UMA.getUma().getPlatform().getTargetNameWithRelease(artifact));
}
if (arg0.equals("exportNames")) {
return new ExportNames(artifact);
}
if (arg0.equals("bundledArtifacts")) {
return new Artifacts(artifact.getAllArtifactsInThisBundleInHashtable());
}
TemplateModel platformExtension = com.ibm.uma.UMA.getUma().getPlatform().getDataModelExtension("uma.spec.flags." + artifact.getTargetName(), arg0);
if (platformExtension != null)
return platformExtension;
TemplateModel configurationExtension = com.ibm.uma.UMA.getUma().getConfiguration().getDataModelExtension("uma.spec.flags." + artifact.getTargetName(), arg0);
if (configurationExtension != null)
return configurationExtension;
return null;
} catch (UMAException e) {
throw new TemplateModelException(e);
}
}
Aggregations