From: Jérôme Benoit Date: Sun, 11 Mar 2018 20:19:46 +0000 (+0100) Subject: Use stderr where appropriate. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ce28a0211974450cf5df46e2065fb39350e029ec;p=TD_SR.git Use stderr where appropriate. Signed-off-by: Jérôme Benoit --- diff --git a/TD1/exo2/Main.java b/TD1/exo2/Main.java index e97322d..5ad851b 100644 --- a/TD1/exo2/Main.java +++ b/TD1/exo2/Main.java @@ -16,7 +16,7 @@ class Main { } catch (InterruptedException e) { // this part is executed when an exception (in this example InterruptedException) occurs - System.out.println("InterruptedException: " + e); + System.err.println("InterruptedException: " + e); } } System.out.println("Threads execution finished"); diff --git a/TD1/exo2/ThreadJob.java b/TD1/exo2/ThreadJob.java index 9b0f99e..754f54e 100644 --- a/TD1/exo2/ThreadJob.java +++ b/TD1/exo2/ThreadJob.java @@ -18,7 +18,7 @@ public class ThreadJob implements Runnable { } catch(InterruptedException e) { // this part is executed when an exception (in this example InterruptedException) occurs - System.out.println("InterruptedException: " + e); + System.err.println("InterruptedException: " + e); } String threadName = Thread.currentThread().getName(); System.out.println(threadName + " has slept for " + sleep_time + " ms for the " + (j + 1) + " times"); diff --git a/TD1/exo3/BufferCirc.java b/TD1/exo3/BufferCirc.java index 4869515..3c7a65e 100644 --- a/TD1/exo3/BufferCirc.java +++ b/TD1/exo3/BufferCirc.java @@ -37,7 +37,7 @@ public class BufferCirc { wait(); } catch (InterruptedException e) { - System.out.println("InterruptedException: " + e); + System.err.println("InterruptedException: " + e); } } nbObj++; @@ -56,7 +56,7 @@ public class BufferCirc { wait(); } catch (InterruptedException e) { - System.out.println("InterruptedException: " + e); + System.err.println("InterruptedException: " + e); } } Object outObj = null; diff --git a/TD1/exo3/Consommateur.java b/TD1/exo3/Consommateur.java index 43c811a..06dd95d 100644 --- a/TD1/exo3/Consommateur.java +++ b/TD1/exo3/Consommateur.java @@ -27,7 +27,7 @@ public class Consommateur implements Runnable { Thread.sleep(ThreadLocalRandom.current().nextInt(1001)); } catch (InterruptedException e) { - System.out.println("InterruptedException: " + e); + System.err.println("InterruptedException: " + e); } } } diff --git a/TD1/exo3/Producteur.java b/TD1/exo3/Producteur.java index f3cc123..0ad13c3 100644 --- a/TD1/exo3/Producteur.java +++ b/TD1/exo3/Producteur.java @@ -29,7 +29,7 @@ public class Producteur implements Runnable { Thread.sleep(ThreadLocalRandom.current().nextInt(101)); } catch (InterruptedException e) { - System.out.println("InterruptedException: " + e); + System.err.println("InterruptedException: " + e); } } } diff --git a/TD2/ClientSimplifie.java b/TD2/ClientSimplifie.java index fd3cd7c..d247a93 100644 --- a/TD2/ClientSimplifie.java +++ b/TD2/ClientSimplifie.java @@ -27,14 +27,14 @@ public class ClientSimplifie { sock = new Socket(adresseIPServeur, portServeur); } catch (IOException e) { - System.out.println("IOException: " + e); + System.err.println("IOException: " + e); } InputStream IStream = null; try { IStream = sock.getInputStream(); } catch (IOException e) { - System.out.println("IOException: " + e); + System.err.println("IOException: " + e); } InputStreamReader IMesg = new InputStreamReader(IStream); lecture = new BufferedReader(IMesg); @@ -44,7 +44,7 @@ public class ClientSimplifie { OStream = sock.getOutputStream(); } catch (IOException e) { - System.out.println("IOException: " + e); + System.err.println("IOException: " + e); } ecriture = new PrintWriter(OStream); } @@ -69,7 +69,7 @@ public class ClientSimplifie { line = lecture.readLine(); } catch (IOException e) { - System.out.println("IOException: " + e); + System.err.println("IOException: " + e); } return line; } @@ -83,7 +83,7 @@ public class ClientSimplifie { lecture.close(); } catch (IOException e) { - System.out.println("IOException: " + e); + System.err.println("IOException: " + e); } }