Use stderr where appropriate.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 11 Mar 2018 20:19:46 +0000 (21:19 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 11 Mar 2018 20:19:46 +0000 (21:19 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
TD1/exo2/Main.java
TD1/exo2/ThreadJob.java
TD1/exo3/BufferCirc.java
TD1/exo3/Consommateur.java
TD1/exo3/Producteur.java
TD2/ClientSimplifie.java

index e97322de725a477bc812a1caf8f702102c81bb42..5ad851b78c8e0d16c9e96b889055c431b0c6a9ae 100644 (file)
@@ -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");
index 9b0f99eeba67d1954373e44eec5297c1525d8c0d..754f54ebdc4a1e704b94d8cde2a7d4bca715a97e 100644 (file)
@@ -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");
index 486951502caffd1d4925291dfa37eb1d74372f74..3c7a65efc1d554ee7c1415a4414916610d11b293 100644 (file)
@@ -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;
index 43c811ab6895e80e7f1cfac5dc092aeadadc04c3..06dd95db9dc89f2f1f46911bca0503b515c7d6ab 100644 (file)
@@ -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);
                        }
                }
        }
index f3cc123ac18ba582eba727a017023a0e29b176ee..0ad13c3e2490ffc08eee619011e8809b68d2b02b 100644 (file)
@@ -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);
                        }
                }
        }
index fd3cd7c9162dc3937d1a397b1c1cf0489ffe819e..d247a9383cc852cc6094e63953740b1b9ec09ddf 100644 (file)
@@ -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);
         }
     }