JAVA-5948 Reduce size of core-java. Remove input.txt (unused).

This commit is contained in:
mikr
2021-08-17 10:36:59 +02:00
parent 7bc5920895
commit f8afea88a1
2 changed files with 2 additions and 3353 deletions

View File

@@ -189,21 +189,8 @@ public class StopExecution {
longRunningSort(); longRunningSort();
} }
private void longRunningOperation() {
LOG.info("long Running operation started");
try {
//Thread.sleep(500);
longFileRead();
LOG.info("long running operation finished");
} catch (InterruptedException e) {
LOG.info("long Running operation interrupted");
}
}
private void longRunningSort() { private void longRunningSort() {
LOG.info("long Running task started"); LOG.info("Long running task started");
// Do you long running calculation here
int len = 100000; int len = 100000;
List<Integer> numbers = new ArrayList<>(); List<Integer> numbers = new ArrayList<>();
try { try {
@@ -229,25 +216,7 @@ public class StopExecution {
LOG.info("Index position: " + i); LOG.info("Index position: " + i);
LOG.info("Long running task finished"); LOG.info("Long running task finished");
} catch (InterruptedException e) { } catch (InterruptedException e) {
LOG.info("long Running operation interrupted"); LOG.info("Long running operation interrupted");
}
}
private void longFileRead() throws InterruptedException {
String file = "input.txt";
ClassLoader classloader = getClass().getClassLoader();
try (InputStream inputStream = classloader.getResourceAsStream(file)) {
Reader inputStreamReader = new InputStreamReader(inputStream);
int data = inputStreamReader.read();
while (data != -1) {
char theChar = (char) data;
data = inputStreamReader.read();
throwExceptionOnThreadInterrupt();
}
} catch (IOException e) {
LOG.error("Exception: ", e);
} }
} }

File diff suppressed because one or more lines are too long