--- old/src/jdk.jcmd/share/classes/sun/tools/jstat/Parser.java 2018-03-22 19:27:38.618457683 +0900 +++ new/src/jdk.jcmd/share/classes/sun/tools/jstat/Parser.java 2018-03-22 19:27:38.291456884 +0900 @@ -1,5 +1,5 @@ /* - * 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 @@ -60,13 +60,15 @@ private static final String FORMAT = "format"; private static final String ALIGN = "align"; private static final String SCALE = "scale"; + private static final String FORCIBLY = "forcibly"; private static final String START = OPTION; private static final Set scaleKeyWords = Scale.keySet(); private static final Set alignKeyWords = Alignment.keySet(); + private static final Set boolKeyWords = Set.of("true", "false"); private static String[] otherKeyWords = { - OPTION, COLUMN, DATA, HEADER, WIDTH, FORMAT, ALIGN, SCALE + OPTION, COLUMN, DATA, HEADER, WIDTH, FORMAT, ALIGN, SCALE, FORCIBLY }; private static char[] infixOps = { @@ -445,6 +447,16 @@ } /** + * forciblystmt -> 'forcibly' expression + */ + private void forciblyStmt(ColumnFormat cf) throws ParserException, IOException { + match(FORCIBLY); + Token t = matchOne(boolKeyWords); + cf.setForcibly(Boolean.parseBoolean(t.sval)); + log(pdebug, "Parsed: forcibly -> " + cf.isForcibly()); + } + + /** * statementlist -> optionalstmt statementlist * optionalstmt -> 'data' expression * 'header' quotedstring @@ -452,6 +464,7 @@ * 'format' formatstring * 'align' alignspec * 'scale' scalespec + * 'forcibly' boolean */ private void statementList(ColumnFormat cf) throws ParserException, IOException { @@ -472,6 +485,8 @@ alignStmt(cf); } else if (lookahead.sval.compareTo(SCALE) == 0) { scaleStmt(cf); + } else if (lookahead.sval.compareTo(FORCIBLY) == 0) { + forciblyStmt(cf); } else { return; }