src/jdk.jcmd/share/classes/sun/tools/jstat/ColumnFormat.java
changeset 49891 61b0342b5711
parent 47216 71c04702a3d5
--- a/src/jdk.jcmd/share/classes/sun/tools/jstat/ColumnFormat.java	Wed Apr 25 17:50:32 2018 -0400
+++ b/src/jdk.jcmd/share/classes/sun/tools/jstat/ColumnFormat.java	Thu Apr 26 09:45:47 2018 +0900
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2013, 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
@@ -41,6 +41,7 @@
     private String format;
     private String header;
     private Expression expression;
+    private boolean required = false;
     private Object previousValue;
 
     public ColumnFormat(int number) {
@@ -71,6 +72,9 @@
             // the raw data.
             format="0";
         }
+
+        // Adjust required flag
+        expression.setRequired(required);
     }
 
     public void setWidth(int width) {
@@ -121,6 +125,14 @@
         this.expression = e;
     }
 
+    public void setRequired(boolean r) {
+        this.required = r;
+    }
+
+    public boolean isRequired() {
+        return this.required;
+    }
+
     public void setPreviousValue(Object o) {
         this.previousValue = o;
     }
@@ -141,7 +153,8 @@
         System.out.println(indent + indentAmount + "name=" + name
                 + ";data=" + expression.toString() + ";header=" + header
                 + ";format=" + format + ";width=" + width
-                + ";scale=" + scale.toString() + ";align=" + align.toString());
+                + ";scale=" + scale.toString() + ";align=" + align.toString()
+                + ";required=" + required);
 
         for (Iterator<OptionFormat> i = children.iterator();  i.hasNext(); /* empty */) {
             OptionFormat of = i.next();