Closed judovana closed 2 years ago
ok it does not. Was still sleeping.
But the
while ((line = reader.readLine()) != null) {
sb.append(line).append(System.getProperty("line.separator", "\n"));
javap.waitFor(2, TimeUnit.SECONDS);
}
}
javap.destroy();
is terrible
please replace destroy by waitfor, and remove waitfor from the loop!
I think the timeout will be redundat then
The redirected stdout and err, to capture current stds and then stop capturig them is pure evil. Any subprocess, which stdout/err we are interested in, should have its own thread-based std readers. I think my AbstractSourceTestClass.java can be refactored, so its base class is just launched process with stderr/out captured. And then launch javap via that.