Помогите, пожалуйста, не могу понять, из-за чего ошибка.
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
File file = new File("/Users/daryabushik/JAVA/Blinov/src/main/java/chapter10/variantC/task4/Student.java");
File changedFile = new File("/Users/daryabushik/JAVA/Blinov/src/main/java/chapter10/variantC/task4/ChangedStudent.java");
if (file.exists()) {
try (BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(changedFile))) {
String line;
StringBuilder builder = new StringBuilder();
while ((line = bufferedReader.readLine()) != null) {
String[] split = line.split("[\\s\\d.,?!{}:;]+");
for (int i = 0; i < split.length; i++) {
if (split[i].length() > 2) {
for (int j = 0; j < split[i].length(); j++) {
if (Character.isLowerCase(split[i].charAt(j))) {
builder.setCharAt(i, Character.toUpperCase(split[i].charAt(j)));
}
}
bufferedWriter.write(String.valueOf(builder));
bufferedWriter.write(System.lineSeparator());
}
}
}
}
}
}
}