< prev index next >

src/jdk.jcmd/share/classes/sun/tools/jstat/ExpressionExecuter.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2004, 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. */ ! public Object evaluate(Expression e) { if (e == null) { return null; } if (debug) { --- 46,57 ---- } /* * evaluate the given expression. */ ! @Override ! public Object evaluate(Expression e, boolean isForcibly) { if (e == null) { return null; } if (debug) {
*** 79,92 **** Expression r = e.getRight(); Operator op = e.getOperator(); if (op == null) { ! return evaluate(l); } else { ! double lval = ((Number)evaluate(l)).doubleValue(); ! double rval = ((Number)evaluate(r)).doubleValue(); double result = op.eval(lval, rval); if (debug) { System.out.println("Performed Operation: " + lval + op + rval + " = " + result); } --- 80,93 ---- Expression r = e.getRight(); Operator op = e.getOperator(); if (op == null) { ! return evaluate(l, isForcibly); } else { ! 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 >