< prev index next >
src/jdk.jcmd/share/classes/sun/tools/jstat/ExpressionExecuter.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -46,11 +46,12 @@
}
/*
* evaluate the given expression.
*/
- public Object evaluate(Expression e) {
+ @Override
+ public Object evaluate(Expression e, boolean isForcibly) {
if (e == null) {
return null;
}
if (debug) {
@@ -79,14 +80,14 @@
Expression r = e.getRight();
Operator op = e.getOperator();
if (op == null) {
- return evaluate(l);
+ return evaluate(l, isForcibly);
} else {
- double lval = ((Number)evaluate(l)).doubleValue();
- double rval = ((Number)evaluate(r)).doubleValue();
+ double lval = ((Number)evaluate(l, isForcibly)).doubleValue();
+ double rval = ((Number)evaluate(r, isForcibly)).doubleValue();
double result = op.eval(lval, rval);
if (debug) {
System.out.println("Performed Operation: " + lval + op + rval
+ " = " + result);
}
< prev index next >