< prev index next >
src/jdk.jcmd/share/classes/sun/tools/jstat/ExpressionResolver.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2004, 2010, 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
--- 1,7 ----
/*
! * 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,56 ****
/*
* evaluate the given expression. evaluation in this case means
* to resolve the counter names in the expression
*/
! public Object evaluate(Expression e) throws MonitorException {
if (e == null) {
return null;
}
--- 46,57 ----
/*
* evaluate the given expression. evaluation in this case means
* to resolve the counter names in the expression
*/
! @Override
! public Object evaluate(Expression e, boolean isForcibly) throws MonitorException {
if (e == null) {
return null;
}
*** 71,81 ****
if (m == null) {
if (debug) {
System.err.println("Warning: Unresolved Symbol: "
+ id.getName() + " substituted NaN");
}
! return new Literal(Double.valueOf(Double.NaN));
}
if (m.getVariability() == Variability.CONSTANT) {
if (debug) {
System.out.println("Converting constant " + id.getName()
+ " to literal with value "
--- 72,82 ----
if (m == null) {
if (debug) {
System.err.println("Warning: Unresolved Symbol: "
+ id.getName() + " substituted NaN");
}
! return new Literal(isForcibly ? 0.0d : Double.NaN);
}
if (m.getVariability() == Variability.CONSTANT) {
if (debug) {
System.out.println("Converting constant " + id.getName()
+ " to literal with value "
*** 93,106 ****
Expression l = null;
Expression r = null;
if (e.getLeft() != null) {
! l = (Expression)evaluate(e.getLeft());
}
if (e.getRight() != null) {
! r = (Expression)evaluate(e.getRight());
}
if (l != null && r != null) {
if ((l instanceof Literal) && (r instanceof Literal)) {
Literal ll = (Literal)l;
--- 94,107 ----
Expression l = null;
Expression r = null;
if (e.getLeft() != null) {
! l = (Expression)evaluate(e.getLeft(), isForcibly);
}
if (e.getRight() != null) {
! r = (Expression)evaluate(e.getRight(), isForcibly);
}
if (l != null && r != null) {
if ((l instanceof Literal) && (r instanceof Literal)) {
Literal ll = (Literal)l;
< prev index next >