Java 10 allows us to use a proper constant for charset.
Change-Id: Ie7706356bf5bcbde05e7632b099901d226f40cf1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
import java.util.List;
import org.junit.Test;
throws UnsupportedEncodingException {
final PrintStream stdout = System.out;
final ByteArrayOutputStream output = new ByteArrayOutputStream();
- System.setOut(new PrintStream(output, true, "UTF-8"));
+ System.setOut(new PrintStream(output, true, StandardCharsets.UTF_8));
RegexUtils.getJavaRegexFromXSD(xsdRegex);
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
+import java.nio.charset.StandardCharsets;
import org.junit.Test;
import org.opendaylight.yangtools.yang.stmt.StmtTestUtils;
final PrintStream stdout = System.out;
final ByteArrayOutputStream output = new ByteArrayOutputStream();
- try (PrintStream out = new PrintStream(output, true, "UTF-8")) {
+ try (PrintStream out = new PrintStream(output, true, StandardCharsets.UTF_8)) {
System.setOut(out);
StmtTestUtils.parseYangSource(yangFile);
} finally {
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.yangtools.yang.stmt;
import static org.junit.Assert.assertNotNull;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@Before
public void setUp() throws UnsupportedEncodingException {
- System.setOut(new PrintStream(output, true, "UTF-8"));
+ System.setOut(new PrintStream(output, true, StandardCharsets.UTF_8));
}
@After
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
import java.util.Collection;
import org.junit.After;
import org.junit.Before;
@Before
public void setUp() throws UnsupportedEncodingException {
- System.setOut(new PrintStream(output, true, "UTF-8"));
+ System.setOut(new PrintStream(output, true, StandardCharsets.UTF_8));
}
@After
import java.io.IOException;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@Before
public void setUp() throws UnsupportedEncodingException {
- System.setOut(new PrintStream(output, true, "UTF-8"));
+ System.setOut(new PrintStream(output, true, StandardCharsets.UTF_8));
}
@After