Что не так с решением? Почему валидатор говорит, что я выполняю "потенциально опасную операцию"?
package com.javarush.task.task19.task1915;
import java.io.*;
import java.nio.Buffer;
/*
Дублируем текст
*/
public class Solution {
public static TestString testString = new TestString();
public static void main(String[] args) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) {
PrintStream console = System.out;
PrintStream print = new PrintStream(reader.readLine());
System.setOut(print);
testString.printSomething();
System.setOut(console);
testString.printSomething();
} catch(IOException e) {
e.printStackTrace();
}
}
public static class TestString {
public void printSomething() {
System.out.println("it's a text for testing");
}
}
}