src/java.base/share/classes/sun/security/ssl/Debug.java

Print this page
8167680 DTLS implementation bugs
   1 /*
   2  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 128                         || option.equals("plaintext"))) {
 129                         return true;
 130                     }
 131                 }
 132             }
 133             return (args.indexOf(option) != -1);
 134         }
 135     }
 136 
 137     /**
 138      * print a message to stderr that is prefixed with the prefix
 139      * created from the call to getInstance.
 140      */
 141 
 142     public void println(String message)
 143     {
 144         System.err.println(prefix + ": "+message);
 145     }
 146 
 147     /**







 148      * print a blank line to stderr that is prefixed with the prefix.
 149      */
 150 
 151     public void println()
 152     {
 153         System.err.println(prefix + ":");
 154     }
 155 
 156     /**
 157      * print a message to stderr that is prefixed with the prefix.
 158      */
 159 
 160     public static void println(String prefix, String message)
 161     {
 162         System.err.println(prefix + ": "+message);
 163     }
 164 
 165     public static void println(PrintStream s, String name, byte[] data) {
 166         s.print(name + ":  { ");
 167         if (data == null) {
 168             s.print("null");
 169         } else {
 170             for (int i = 0; i < data.length; i++) {
 171                 if (i != 0) s.print(", ");
 172                 s.print(data[i] & 0x0ff);
 173             }
 174         }
 175         s.println(" }");
 176     }
 177 
 178     /**
 179      * Return the value of the boolean System property propName.


   1 /*
   2  * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 128                         || option.equals("plaintext"))) {
 129                         return true;
 130                     }
 131                 }
 132             }
 133             return (args.indexOf(option) != -1);
 134         }
 135     }
 136 
 137     /**
 138      * print a message to stderr that is prefixed with the prefix
 139      * created from the call to getInstance.
 140      */
 141 
 142     public void println(String message)
 143     {
 144         System.err.println(prefix + ": "+message);
 145     }
 146 
 147     /**
 148      * Print a message to stdout.
 149      */
 150     static void log(String message) {
 151         System.out.println(Thread.currentThread().getName() + ": " + message);
 152     }
 153 
 154     /**
 155      * print a blank line to stderr that is prefixed with the prefix.
 156      */
 157 
 158     public void println()
 159     {
 160         System.err.println(prefix + ":");
 161     }
 162 
 163     /**
 164      * print a message to stderr that is prefixed with the prefix.
 165      */

 166     public static void println(String prefix, String message)
 167     {
 168         System.err.println(prefix + ": "+message);
 169     }
 170 
 171     public static void println(PrintStream s, String name, byte[] data) {
 172         s.print(name + ":  { ");
 173         if (data == null) {
 174             s.print("null");
 175         } else {
 176             for (int i = 0; i < data.length; i++) {
 177                 if (i != 0) s.print(", ");
 178                 s.print(data[i] & 0x0ff);
 179             }
 180         }
 181         s.println(" }");
 182     }
 183 
 184     /**
 185      * Return the value of the boolean System property propName.