8198645: Use System.lineSeparator() instead of getProperty("line.separator")
Reviewed-by: lancea, xuelei, sherman
This commit is contained in:
parent
d4cf0ebee8
commit
2af1df8c10
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 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
|
||||
@ -115,7 +115,7 @@ final class BlockCipherParamsCore {
|
||||
* Returns a formatted string describing the parameters.
|
||||
*/
|
||||
public String toString() {
|
||||
String LINE_SEP = System.getProperty("line.separator");
|
||||
String LINE_SEP = System.lineSeparator();
|
||||
|
||||
String ivString = LINE_SEP + " iv:" + LINE_SEP + "[";
|
||||
HexDumpEncoder encoder = new HexDumpEncoder();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -129,7 +129,7 @@ public final class DHParameters extends AlgorithmParametersSpi {
|
||||
* Returns a formatted string describing the parameters.
|
||||
*/
|
||||
protected String engineToString() {
|
||||
String LINE_SEP = System.getProperty("line.separator");
|
||||
String LINE_SEP = System.lineSeparator();
|
||||
|
||||
StringBuilder sb
|
||||
= new StringBuilder("SunJCE Diffie-Hellman Parameters:"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
@ -43,7 +43,7 @@ import sun.security.util.*;
|
||||
*
|
||||
*
|
||||
* @see DHPrivateKey
|
||||
* @see java.security.KeyAgreement
|
||||
* @see javax.crypto.KeyAgreement
|
||||
*/
|
||||
final class DHPublicKey implements PublicKey,
|
||||
javax.crypto.interfaces.DHPublicKey, Serializable {
|
||||
@ -258,7 +258,7 @@ javax.crypto.interfaces.DHPublicKey, Serializable {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
String LINE_SEP = System.getProperty("line.separator");
|
||||
String LINE_SEP = System.lineSeparator();
|
||||
|
||||
StringBuilder sb
|
||||
= new StringBuilder("SunJCE Diffie-Hellman Public Key:"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 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
|
||||
@ -134,7 +134,7 @@ public final class GCMParameters extends AlgorithmParametersSpi {
|
||||
* Returns a formatted string describing the parameters.
|
||||
*/
|
||||
protected String engineToString() {
|
||||
String LINE_SEP = System.getProperty("line.separator");
|
||||
String LINE_SEP = System.lineSeparator();
|
||||
HexDumpEncoder encoder = new HexDumpEncoder();
|
||||
StringBuilder sb
|
||||
= new StringBuilder(LINE_SEP + " iv:" + LINE_SEP + "["
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 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
|
||||
@ -135,7 +135,7 @@ public final class PBEParameters extends AlgorithmParametersSpi {
|
||||
* Returns a formatted string describing the parameters.
|
||||
*/
|
||||
protected String engineToString() {
|
||||
String LINE_SEP = System.getProperty("line.separator");
|
||||
String LINE_SEP = System.lineSeparator();
|
||||
String saltString = LINE_SEP + " salt:" + LINE_SEP + "[";
|
||||
HexDumpEncoder encoder = new HexDumpEncoder();
|
||||
saltString += encoder.encodeBuffer(salt);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -214,7 +214,7 @@ public final class RC2Parameters extends AlgorithmParametersSpi {
|
||||
* Returns a formatted string describing the parameters.
|
||||
*/
|
||||
protected String engineToString() {
|
||||
String LINE_SEP = System.getProperty("line.separator");
|
||||
String LINE_SEP = System.lineSeparator();
|
||||
HexDumpEncoder encoder = new HexDumpEncoder();
|
||||
StringBuilder sb
|
||||
= new StringBuilder(LINE_SEP + " iv:" + LINE_SEP + "["
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 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
|
||||
@ -25,9 +25,6 @@
|
||||
|
||||
package java.util.regex;
|
||||
|
||||
import sun.security.action.GetPropertyAction;
|
||||
|
||||
|
||||
/**
|
||||
* Unchecked exception thrown to indicate a syntax error in a
|
||||
* regular-expression pattern.
|
||||
@ -93,9 +90,6 @@ public class PatternSyntaxException
|
||||
return pattern;
|
||||
}
|
||||
|
||||
private static final String nl =
|
||||
GetPropertyAction.privilegedGetProperty("line.separator");
|
||||
|
||||
/**
|
||||
* Returns a multi-line string containing the description of the syntax
|
||||
* error and its index, the erroneous regular-expression pattern, and a
|
||||
@ -110,10 +104,10 @@ public class PatternSyntaxException
|
||||
sb.append(" near index ");
|
||||
sb.append(index);
|
||||
}
|
||||
sb.append(nl);
|
||||
sb.append(System.lineSeparator());
|
||||
sb.append(pattern);
|
||||
if (index >= 0) {
|
||||
sb.append(nl);
|
||||
sb.append(System.lineSeparator());
|
||||
for (int i = 0; i < index; i++) sb.append(' ');
|
||||
sb.append('^');
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* 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
|
||||
@ -75,8 +75,7 @@ public class XMLStreamWriterImpl implements XMLStreamWriter {
|
||||
//pretty print by default
|
||||
private boolean _doIndent = true;
|
||||
//The system line separator for writing out line breaks.
|
||||
private char[] _lineSep =
|
||||
System.getProperty("line.separator").toCharArray();
|
||||
private char[] _lineSep = System.lineSeparator().toCharArray();
|
||||
|
||||
public XMLStreamWriterImpl(OutputStream os) throws XMLStreamException {
|
||||
this(os, XMLStreamWriter.DEFAULT_CHARSET);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* 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
|
||||
@ -123,7 +123,7 @@ public class XMLWriter {
|
||||
}
|
||||
|
||||
private void nl() throws XMLStreamException {
|
||||
String lineEnd = System.getProperty("line.separator");
|
||||
String lineEnd = System.lineSeparator();
|
||||
try {
|
||||
_writer.write(lineEnd);
|
||||
} catch (IOException e) {
|
||||
|
@ -138,8 +138,7 @@ abstract public class ToStream extends SerializerBase {
|
||||
* but this value can be set through the xsl:output
|
||||
* extension attribute xalan:line-separator.
|
||||
*/
|
||||
protected char[] m_lineSep =
|
||||
SecuritySupport.getSystemProperty("line.separator").toCharArray();
|
||||
protected char[] m_lineSep = System.lineSeparator().toCharArray();
|
||||
|
||||
/**
|
||||
* True if the the system line separator is to be used.
|
||||
|
@ -45,7 +45,7 @@ import java.util.ResourceBundle;
|
||||
* This class contains utility methods for reading resources in the JAXP packages
|
||||
*/
|
||||
public class SecuritySupport {
|
||||
public final static String NEWLINE = getSystemProperty("line.separator", "\n");
|
||||
public final static String NEWLINE = System.lineSeparator();
|
||||
|
||||
/**
|
||||
* Cache for properties in java.home/conf/jaxp.properties
|
||||
|
Loading…
x
Reference in New Issue
Block a user