Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2025, 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
Expand Down Expand Up @@ -28,6 +28,7 @@
import sun.jvm.hotspot.debugger.*;

import java.io.*;
import java.nio.charset.Charset;
import java.util.*;

public class CLHSDB {
Expand Down Expand Up @@ -106,8 +107,8 @@ public void reattach() {
};


BufferedReader in =
new BufferedReader(new InputStreamReader(System.in));
Charset charset = Charset.forName(System.getProperty("stdin.encoding"), Charset.defaultCharset());
BufferedReader in = new BufferedReader(new InputStreamReader(System.in, charset));
CommandProcessor cp = new CommandProcessor(di, in, System.out, System.err);
cp.run(true);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2025, 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
Expand Down Expand Up @@ -27,6 +27,7 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;

public final class UserInterface {

Expand All @@ -40,7 +41,8 @@ public void println(String text) {

public String readLine() throws AbortException {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Charset charset = Charset.forName(System.getProperty("stdin.encoding"), Charset.defaultCharset());
BufferedReader br = new BufferedReader(new InputStreamReader(System.in, charset));
String line = br.readLine();
if (line == null || line.equalsIgnoreCase("Q")) {
println();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2025, 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
Expand Down Expand Up @@ -60,7 +60,8 @@ protected void agentActions() throws Throwable {
FileInputStream newInputStream = new FileInputStream(inStreamFileName);
System.setIn(newInputStream);

BufferedReader inputStreamReader = new BufferedReader(new InputStreamReader(System.in));
BufferedReader inputStreamReader = new BufferedReader(new InputStreamReader(
System.in, System.getProperty("stdin.encoding")));
int readValue = Integer.parseInt(inputStreamReader.readLine());

if (readValue != valueToWrite) {
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/vmTestbase/nsk/share/jpda/BindServer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2025, 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
Expand Down Expand Up @@ -173,7 +173,7 @@ private int runIt(String argv[], PrintStream out) {
}

BufferedReader stdIn = new BufferedReader(
new InputStreamReader(System.in));
new InputStreamReader(System.in, System.getProperty("stdin.encoding")));
try (ListeningThread listeningThread = new ListeningThread(this)) {
listeningThread.bind();
listeningThread.start();
Expand Down