Skip to content

Commit 316783c

Browse files
committed
validation fixes
1 parent 11d5437 commit 316783c

File tree

16 files changed

+23
-20
lines changed

16 files changed

+23
-20
lines changed

concurrency/AtomicIntegerTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ public static void main(String[] args) {
1717
new Timer().schedule(new TimerTask() {
1818
@Override
1919
public void run() {
20-
System.err.println("Aborting");
20+
System.out.println("Aborting");
2121
System.exit(0);
2222
}
2323
}, 5000); // Terminate after 5 seconds
24-
ExecutorService exec = Executors.newCachedThreadPool();
24+
ExecutorService exec =
25+
Executors.newCachedThreadPool();
2526
AtomicIntegerTest ait = new AtomicIntegerTest();
2627
exec.execute(ait);
2728
while(true) {

concurrency/ExceptionThread.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//: concurrency/ExceptionThread.java
22
// ©2015 MindView LLC: see Copyright.txt
3-
// {RunByHand}
3+
// {ValidateByHand}
44
// {ThrowsException}
55
import java.util.concurrent.*;
66

concurrency/ExplicitCriticalSection.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
//: concurrency/ExplicitCriticalSection.java
22
// ©2015 MindView LLC: see Copyright.txt
33
// {ThrowsException} on a multiprocessor machine
4-
// Using explicit Lock objects to create critical sections.
4+
// Using explicit Lock objects to create
5+
// critical sections.
56
package concurrency;
67
import java.util.concurrent.locks.*;
78

@@ -40,7 +41,8 @@ public void increment() {
4041
}
4142

4243
public class ExplicitCriticalSection {
43-
public static void main(String[] args) throws Exception {
44+
public static void
45+
main(String[] args) throws Exception {
4446
PairManager
4547
pman1 = new ExplicitPairManager1(),
4648
pman2 = new ExplicitPairManager2();

concurrency/build.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<jrun cls="MoreBasicThreads" />
4545
<jrun cls="MultiLock" />
4646
<jrun cls="MutexEvenGenerator" failOnError='false' timeOut='4000' msg='* Timeout for Testing *' />
47+
<jrun cls="NaiveExceptionHandling" failOnError='false' msg='* Exception was Expected *' />
4748
<jrun cls="NIOInterruption" />
4849
<jrun cls="NotifyVsNotifyAll" />
4950
<jrun cls="OrnamentalGarden" />

exceptions/DynamicFields.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//: exceptions/DynamicFields.java
22
// ©2015 MindView LLC: see Copyright.txt
3-
// {ThrowsException}
43
// A Class that dynamically adds fields to itself.
54
// Demonstrates exception chaining.
65
import static net.mindview.util.Print.*;
@@ -94,7 +93,7 @@ public static void main(String[] args) {
9493
print("df: " + df);
9594
print("df.getField(\"d\") : " + df.getField("d"));
9695
Object field = df.setField("d", null); // Exception
97-
} catch(NoSuchFieldException |
96+
} catch(NoSuchFieldException |
9897
DynamicFieldsException e) {
9998
e.printStackTrace(System.out);
10099
}

exceptions/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<jrun cls="AlwaysFinally" />
1111
<jrun cls="Cleanup" />
1212
<jrun cls="CleanupIdiom" />
13-
<jrun cls="DynamicFields" failOnError='false' msg='* Exception was Expected *' />
13+
<jrun cls="DynamicFields" />
1414
<jrun cls="ExceptionMethods" />
1515
<jrun cls="ExceptionSilencer" />
1616
<jrun cls="ExtraFeatures" />

io/FormattedMemoryInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static void main(String[] args)
1313
while(true)
1414
System.out.write((char)in.readByte());
1515
} catch(EOFException e) {
16-
System.err.println("End of stream");
16+
System.out.println("End of stream");
1717
}
1818
}
1919
} /* (Execute to see output) *///:~

network/ChatterServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public ChatterServer() {
3838
System.err.println("Can't open socket");
3939
System.exit(1);
4040
} catch(IOException e) {
41-
System.err.println("Communication error");
41+
System.out.println("Communication error");
4242
e.printStackTrace();
4343
}
4444
}

network/SimpleClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Very simple client that just sends
44
// lines to the server and reads lines
55
// that the server sends.
6-
// {RunByHand}
6+
// {ValidateByHand}
77
import java.net.*;
88
import java.io.*;
99

references/CheckCloneable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Ordinary tryToClone(Ordinary ord) {
6666
x= (Ordinary)((IsCloneable)ord).clone();
6767
System.out.println("Cloned " + id);
6868
} catch(CloneNotSupportedException e) {
69-
System.err.println(
69+
System.out.println(
7070
"Could not clone " + id);
7171
}
7272
} else {

0 commit comments

Comments
 (0)