< prev index next >

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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2012, 2019, 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) 2012, 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
*** 59,70 **** return serverNames; } int size = serverNames.size(); List<SNIServerName> sniList = (size != 0) ? ! new ArrayList<>(serverNames) : ! new ArrayList<>(1); boolean reset = false; for (int i = 0; i < size; i++) { SNIServerName serverName = sniList.get(i); if (serverName.getType() == StandardConstants.SNI_HOST_NAME) { --- 59,70 ---- return serverNames; } int size = serverNames.size(); List<SNIServerName> sniList = (size != 0) ? ! new ArrayList<SNIServerName>(serverNames) : ! new ArrayList<SNIServerName>(1); boolean reset = false; for (int i = 0; i < size; i++) { SNIServerName serverName = sniList.get(i); if (serverName.getType() == StandardConstants.SNI_HOST_NAME) {
*** 145,155 **** } static String indent(String source, String prefix) { StringBuilder builder = new StringBuilder(); if (source == null) { ! builder.append("\n").append(prefix).append("<blank message>"); } else { String[] lines = lineBreakPatern.split(source); boolean isFirst = true; for (String line : lines) { if (isFirst) { --- 145,155 ---- } static String indent(String source, String prefix) { StringBuilder builder = new StringBuilder(); if (source == null) { ! builder.append("\n" + prefix + "<blank message>"); } else { String[] lines = lineBreakPatern.split(source); boolean isFirst = true; for (String line : lines) { if (isFirst) {
*** 230,252 **** System.arraycopy(b, 1, newarray, 0, n); b = newarray; } return b; } - - static void reverseBytes(byte[] arr) { - int i = 0; - int j = arr.length - 1; - - while (i < j) { - swap(arr, i, j); - i++; - j--; - } - } - - private static void swap(byte[] arr, int i, int j) { - byte tmp = arr[i]; - arr[i] = arr[j]; - arr[j] = tmp; - } } --- 230,235 ----
< prev index next >