Output update and exclude AttemptLocking for Appveyor

This commit is contained in:
Bruce Eckel 2017-05-03 12:00:00 -06:00
parent 3febbb2722
commit 7bf05f592b
123 changed files with 692 additions and 698 deletions

View File

@ -1,10 +0,0 @@
#! py -3
# Requires Python 3.5
# Displays all the Findbugs main.html reports from "On Java 8" on Windows
# Must run "gradlew findbugsMain" first
from pathlib import Path
import os
cmds = ["start " + str(report) for report in Path(".").rglob("main.html")]
(Path(".") / "ShowFindbugs.bat").write_text("\n".join(cmds).strip() + "\n")
os.system("ShowFindbugs.bat")

View File

@ -2,6 +2,10 @@
# Requires Python 3.5
# Validates output from executable Java programs in "On Java 8."
# Use chain of responsibility to successively try strategies until one matches
'''
Intended to be copied into the ExtractedExamples directory,
thus it doesn't use config.py
'''
from pathlib import Path
import textwrap
import re

View File

@ -23,8 +23,8 @@ public class AtUnitComposition {
}
/* Output:
annotations.AtUnitComposition
. tMethodOne
. tMethodTwo This is methodTwo
. tMethodOne
OK (2 tests)
*/

View File

@ -34,15 +34,15 @@ public class AtUnitExample1 {
}
/* Output:
annotations.AtUnitExample1
. anotherDisappointment (failed)
. m2 This is methodTwo
. m3
. failureTest (failed)
. methodOneTest
. anotherDisappointment (failed)
(5 tests)
>>> 2 FAILURES <<<
annotations.AtUnitExample1: anotherDisappointment
annotations.AtUnitExample1: failureTest
annotations.AtUnitExample1: anotherDisappointment
*/

View File

@ -40,18 +40,18 @@ public class AtUnitExample2 {
}
/* Output:
annotations.AtUnitExample2
. assertFailureExample java.lang.AssertionError: What a
surprise!
(failed)
. assertExample
. exceptionExample java.io.FileNotFoundException:
nofile.txt (The system cannot find the file specified)
(failed)
. assertAndReturn This is methodTwo
. assertFailureExample java.lang.AssertionError: What a
surprise!
(failed)
(4 tests)
>>> 2 FAILURES <<<
annotations.AtUnitExample2: assertFailureExample
annotations.AtUnitExample2: exceptionExample
annotations.AtUnitExample2: assertFailureExample
*/

View File

@ -34,9 +34,9 @@ public class AtUnitExample3 {
}
/* Output:
annotations.AtUnitExample3
. m2 This is methodTwo
. methodOneTest
. initialization
. m2 This is methodTwo
OK (3 tests)
*/

View File

@ -67,16 +67,15 @@ public class AtUnitExample4 {
annotations.AtUnitExample4
. words 'All'
(failed)
. scramble1 'brontosauruses'
ntsaueorosurbs
(failed)
. scramble2 'are'
are
. scramble2 'brontosauruses'
tsaeborornussu
. scramble1 'are'
rae
(failed)
(3 tests)
>>> 3 FAILURES <<<
>>> 2 FAILURES <<<
annotations.AtUnitExample4: words
annotations.AtUnitExample4: scramble1
annotations.AtUnitExample4: scramble2
*/

View File

@ -53,11 +53,11 @@ public class AtUnitExample5 {
}
/* Output:
annotations.AtUnitExample5
. test1
Running cleanup
. test3
Running cleanup
. test2
Running cleanup
. test1
Running cleanup
OK (3 tests)
*/

View File

@ -22,8 +22,8 @@ AtUnitExternalTest extends AtUnitExample1 {
}
/* Output:
annotations.AtUnitExternalTest
. tMethodOne
. tMethodTwo This is methodTwo
. tMethodOne
OK (2 tests)
*/

View File

@ -29,8 +29,8 @@ public class HashSetTest {
}
/* Output:
annotations.HashSetTest
. tRemove
. tContains
. initialization
. tContains
. tRemove
OK (3 tests)
*/

View File

@ -27,11 +27,11 @@ public class UseCaseTracker {
}
}
/* Output:
Found Use Case 49
New passwords can't equal previously used ones
Found Use Case 47
Passwords must contain at least one numeric
Found Use Case 48
no description
Found Use Case 49
New passwords can't equal previously used ones
Missing use case 50
*/

View File

@ -19,11 +19,11 @@ public class AlphabeticSearch {
}
}
/* Output:
[anmkkyh, bhmupju, btpenpc, cjwzmmr, cuxszgv,
eloztdv, ewcippc, ezdeklu, fcjpthl,
fqmlgsh, gmeinne, hyoubzl, jbvlgwc, jlxpqds,
ljlbynx, mvducuj, qgekgly, skddcat,
taprwxz, uybypgp, vjsszkn, vniyapk, vqqakbm,
vwodhcf, ydpulcq, ygpoalk, yskvett,
zehpfmm, zofmmvm, zrxmclh] Index: 10 gmeinne
[anmkkyh, bhmupju, btpenpc, cjwzmmr, cuxszgv, eloztdv,
ewcippc, ezdeklu, fcjpthl, fqmlgsh, gmeinne, hyoubzl,
jbvlgwc, jlxpqds, ljlbynx, mvducuj, qgekgly, skddcat,
taprwxz, uybypgp, vjsszkn, vniyapk, vqqakbm, vwodhcf,
ydpulcq, ygpoalk, yskvett, zehpfmm, zofmmvm, zrxmclh]
Index: 10
gmeinne
*/

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand} // CI Systems have trouble
// {ValidateByHand} CI Systems have trouble
import java.util.*;
public class ParallelPrefix3 {

View File

@ -1,2 +0,0 @@
cp ..\..\OnJava-Tools\verify_output.py .
py -3 verify_output.py

View File

@ -32,6 +32,6 @@ public class ApplesAndOrangesWithoutGenerics {
___[ Error Output ]___
Exception in thread "main" java.lang.ClassCastException:
Orange cannot be cast to Apple
at ApplesAndOrangesWithoutGenerics.main(ApplesAndOr
at ApplesAndOrangesWithoutGenerics.main(ApplesAndOr
angesWithoutGenerics.java:23)
*/

View File

@ -21,8 +21,8 @@ public class GenericsAndUpcasting {
}
}
/* Output:
GrannySmith@1db9742
Gala@106d69c
Fuji@52e922
Braeburn@25154f
GrannySmith@15db9742
Gala@6d06d69c
Fuji@7852e922
Braeburn@4e25154f
*/

View File

@ -27,8 +27,8 @@ public class ListIteration {
}
}
/* Output:
Rat, 1, 0; Manx, 2, 1; Cymric, 3, 2; Mutt, 4, 3;
Pug, 5, 4; Cymric, 6, 5; Pug, 7, 6; Manx, 8, 7;
Rat, 1, 0; Manx, 2, 1; Cymric, 3, 2; Mutt, 4, 3; Pug, 5, 4;
Cymric, 6, 5; Pug, 7, 6; Manx, 8, 7;
7 6 5 4 3 2 1 0
[Rat, Manx, Cymric, Mutt, Pug, Cymric, Pug, Manx]
[Rat, Manx, Cymric, Cymric, Rat, EgyptianMau, Hamster,

View File

@ -39,26 +39,26 @@ public class MapOfList {
}
}
/* Output:
People: [Person Marilyn, Person Dawn, Person Luke, Person
Isaac, Person Kate]
Pets: [[Pug Louie aka Louis Snorkelstein Dupree, Cat
Stanford aka Stinky el Negro, Cat Pinkola], [Cymric Molly,
Mutt Spot], [Rat Fuzzy, Rat Fizzy], [Rat Freckly], [Cat
Shackleton, Cat Elsie May, Dog Margrett]]
Person Marilyn has:
Pug Louie aka Louis Snorkelstein Dupree
Cat Stanford aka Stinky el Negro
Cat Pinkola
People: [Person Dawn, Person Kate, Person Isaac, Person
Marilyn, Person Luke]
Pets: [[Cymric Molly, Mutt Spot], [Cat Shackleton, Cat
Elsie May, Dog Margrett], [Rat Freckly], [Pug Louie aka
Louis Snorkelstein Dupree, Cat Stanford aka Stinky el
Negro, Cat Pinkola], [Rat Fuzzy, Rat Fizzy]]
Person Dawn has:
Cymric Molly
Mutt Spot
Person Luke has:
Rat Fuzzy
Rat Fizzy
Person Isaac has:
Rat Freckly
Person Kate has:
Cat Shackleton
Cat Elsie May
Dog Margrett
Person Isaac has:
Rat Freckly
Person Marilyn has:
Pug Louie aka Louis Snorkelstein Dupree
Cat Stanford aka Stinky el Negro
Cat Pinkola
Person Luke has:
Rat Fuzzy
Rat Fizzy
*/

View File

@ -60,18 +60,18 @@ public class Bits {
}
}
/* Output:
byte value: 118
bits: {1, 2, 4, 5, 6}
bit pattern: 0110111000000000000000000000000000000000000000
byte value: -107
bits: {0, 2, 4, 7}
bit pattern: 1010100100000000000000000000000000000000000000
000000000000000000
short value: 9795
bits: {0, 1, 6, 9, 10, 13}
bit pattern: 1100001001100100000000000000000000000000000000
short value: 1302
bits: {1, 2, 4, 8, 10}
bit pattern: 0110100010100000000000000000000000000000000000
000000000000000000
int value: -645079414
bits: {1, 3, 7, 9, 10, 11, 12, 14, 15, 18, 19, 23, 24, 27,
28, 30, 31}
bit pattern: 0101000101111011001100011001101100000000000000
int value: -2014573909
bits: {0, 1, 3, 5, 7, 9, 11, 18, 19, 21, 22, 23, 24, 25,
26, 31}
bit pattern: 1101010101010000001101111110000100000000000000
000000000000000000
set bit 127: {127}
set bit 255: {255}

View File

@ -26,9 +26,10 @@ public class FillingLists {
}
}
/* Output:
[StringAddress@1db9742 Hello, StringAddress@1db9742 Hello,
StringAddress@1db9742 Hello, StringAddress@1db9742 Hello]
[StringAddress@106d69c World!, StringAddress@106d69c
World!, StringAddress@106d69c World!, StringAddress@106d69c
World!]
[StringAddress@15db9742 Hello, StringAddress@15db9742
Hello, StringAddress@15db9742 Hello, StringAddress@15db9742
Hello]
[StringAddress@6d06d69c World!, StringAddress@6d06d69c
World!, StringAddress@6d06d69c World!,
StringAddress@6d06d69c World!]
*/

View File

@ -123,4 +123,44 @@ public class ListOps {
}
}
/* Output:
[AliceBlue, AntiqueWhite, Aquamarine, Azure, Beige, Bisque,
Black, BlanchedAlmond, Blue, BlueViolet]
b = [AliceBlue, AntiqueWhite, Aquamarine, Azure, Beige,
Bisque, Black, BlanchedAlmond, Blue, BlueViolet]
[AliceBlue, AntiqueWhite, Aquamarine, Azure, Beige, Bisque,
Black, BlanchedAlmond, Blue, BlueViolet, AliceBlue,
AntiqueWhite, Aquamarine, Azure, Beige, Bisque, Black,
BlanchedAlmond, Blue, BlueViolet, AliceBlue, AntiqueWhite,
Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond,
Blue, BlueViolet]
[AliceBlue, AntiqueWhite, Aquamarine, Azure, Beige, Bisque,
Black, BlanchedAlmond, Blue, BlueViolet, AliceBlue,
AntiqueWhite, Aquamarine, Azure, Beige, one, Bisque, Black,
BlanchedAlmond, Blue, BlueViolet, AliceBlue, AntiqueWhite,
Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond,
Blue, BlueViolet]
Bisque
Black
[AliceBlue, AntiqueWhite, Aquamarine, Azure, Beige, Bisque,
Black, BlanchedAlmond, Blue, BlueViolet, AliceBlue,
AntiqueWhite, Aquamarine, Azure, Beige, one, 47,
BlanchedAlmond, Blue, BlueViolet, AliceBlue, AntiqueWhite,
Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond,
Blue, BlueViolet]
BlueViolet Blue BlanchedAlmond Black Bisque Beige Azure
Aquamarine AntiqueWhite AliceBlue BlueViolet Blue
BlanchedAlmond 47 one Beige Azure Aquamarine AntiqueWhite
AliceBlue BlueViolet Blue BlanchedAlmond Black Bisque Beige
Azure Aquamarine AntiqueWhite AliceBlue
testVisual finished
[AliceBlue, AntiqueWhite, Aquamarine, Azure, Beige, Bisque,
Black, BlanchedAlmond, Blue, BlueViolet]
[two, one, AliceBlue, AntiqueWhite, Aquamarine, Azure,
Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet]
two
two
one
BlueViolet
[AliceBlue, AntiqueWhite, Aquamarine, Azure, Beige, Bisque,
Black, BlanchedAlmond, Blue]
*/

View File

@ -67,25 +67,25 @@ public class References {
}
}
/* Output: (First and Last 10 Lines)
Just created: java.lang.ref.SoftReference@1db9742
Just created: java.lang.ref.SoftReference@106d69c
Just created: java.lang.ref.SoftReference@52e922
Just created: java.lang.ref.SoftReference@25154f
Just created: java.lang.ref.SoftReference@10dea4e
Just created: java.lang.ref.SoftReference@647e05
Just created: java.lang.ref.SoftReference@1909752
Just created: java.lang.ref.SoftReference@1f96302
Just created: java.lang.ref.SoftReference@14eac69
Just created: java.lang.ref.SoftReference@a57993
Just created: java.lang.ref.SoftReference@15db9742
Just created: java.lang.ref.SoftReference@6d06d69c
Just created: java.lang.ref.SoftReference@7852e922
Just created: java.lang.ref.SoftReference@4e25154f
Just created: java.lang.ref.SoftReference@70dea4e
Just created: java.lang.ref.SoftReference@5c647e05
Just created: java.lang.ref.SoftReference@33909752
Just created: java.lang.ref.SoftReference@55f96302
Just created: java.lang.ref.SoftReference@3d4eac69
Just created: java.lang.ref.SoftReference@42a57993
...________...________...________...________...
Just created: java.lang.ref.PhantomReference@1ee12a7
Just created: java.lang.ref.PhantomReference@45ee12a7
In queue: null
Just created: java.lang.ref.PhantomReference@10bedb4
Just created: java.lang.ref.PhantomReference@330bedb4
In queue: null
Just created: java.lang.ref.PhantomReference@103dbd3
Just created: java.lang.ref.PhantomReference@2503dbd3
In queue: null
Just created: java.lang.ref.PhantomReference@167cf4d
Just created: java.lang.ref.PhantomReference@4b67cf4d
In queue: null
Just created: java.lang.ref.PhantomReference@a987ac
Just created: java.lang.ref.PhantomReference@7ea987ac
In queue: null
*/

View File

@ -80,14 +80,14 @@ public class TypesForSets {
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
[10, 9, 8, 7, 6, 5, 0, 1, 2, 3, 4]
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]
[1, 6, 8, 6, 2, 7, 8, 9, 4, 10, 7, 5, 1, 3, 4, 9, 9,
10, 5, 3, 2, 0, 4, 1, 2, 0, 8, 3, 0, 10, 6, 5, 7]
[3, 1, 4, 8, 7, 6, 9, 5, 3, 0, 10, 5, 5, 10, 7, 8, 8,
9, 1, 4, 10, 2, 6, 9, 1, 6, 0, 3, 2, 0, 7, 2, 4]
[10, 9, 8, 7, 6, 5, 0, 1, 2, 3, 4, 10, 9, 8, 7, 6, 5,
0, 1, 2, 3, 4, 10, 9, 8, 7, 6, 5, 0, 1, 2, 3, 4]
[10, 9, 8, 7, 6, 5, 0, 1, 2, 3, 4, 10, 9, 8, 7, 6, 5,
0, 1, 2, 3, 4, 10, 9, 8, 7, 6, 5, 0, 1, 2, 3, 4]
[1, 6, 8, 6, 2, 7, 8, 9, 4, 10, 7, 5, 1, 3, 4, 9, 9, 10, 5,
3, 2, 0, 4, 1, 2, 0, 8, 3, 0, 10, 6, 5, 7]
[3, 1, 4, 8, 7, 6, 9, 5, 3, 0, 10, 5, 5, 10, 7, 8, 8, 9, 1,
4, 10, 2, 6, 9, 1, 6, 0, 3, 2, 0, 7, 2, 4]
[10, 9, 8, 7, 6, 5, 0, 1, 2, 3, 4, 10, 9, 8, 7, 6, 5, 0, 1,
2, 3, 4, 10, 9, 8, 7, 6, 5, 0, 1, 2, 3, 4]
[10, 9, 8, 7, 6, 5, 0, 1, 2, 3, 4, 10, 9, 8, 7, 6, 5, 0, 1,
2, 3, 4, 10, 9, 8, 7, 6, 5, 0, 1, 2, 3, 4]
SetType cannot be cast to java.lang.Comparable
HashType cannot be cast to java.lang.Comparable
*/

View File

@ -16,14 +16,14 @@ public class CachedThreadPool {
}
}
/* Output:
NapTask[2] pool-1-thread-3
NapTask[9] pool-1-thread-10
NapTask[6] pool-1-thread-7
NapTask[5] pool-1-thread-6
NapTask[7] pool-1-thread-8
NapTask[8] pool-1-thread-9
NapTask[0] pool-1-thread-1
NapTask[1] pool-1-thread-2
NapTask[4] pool-1-thread-5
NapTask[8] pool-1-thread-9
NapTask[7] pool-1-thread-8
NapTask[5] pool-1-thread-6
NapTask[6] pool-1-thread-7
NapTask[3] pool-1-thread-4
NapTask[4] pool-1-thread-5
NapTask[0] pool-1-thread-1
NapTask[2] pool-1-thread-3
*/

View File

@ -16,14 +16,14 @@ public class CachedThreadPool2 {
}
}
/* Output:
0 pool-1-thread-1 200
4 pool-1-thread-5 300
3 pool-1-thread-4 400
1 pool-1-thread-2 200
2 pool-1-thread-3 200
6 pool-1-thread-7 500
8 pool-1-thread-9 757
5 pool-1-thread-6 657
7 pool-1-thread-8 657
9 pool-1-thread-10 857
1 pool-1-thread-2 117
0 pool-1-thread-1 117
2 pool-1-thread-3 217
4 pool-1-thread-5 407
3 pool-1-thread-4 337
5 pool-1-thread-6 507
7 pool-1-thread-8 707
6 pool-1-thread-7 607
8 pool-1-thread-9 807
9 pool-1-thread-10 907
*/

View File

@ -34,14 +34,14 @@ public class CachedThreadPool3 {
}
/* Output:
2 pool-1-thread-3 100
6 pool-1-thread-7 100
5 pool-1-thread-6 100
7 pool-1-thread-8 100
4 pool-1-thread-5 100
9 pool-1-thread-10 100
3 pool-1-thread-4 100
0 pool-1-thread-1 100
1 pool-1-thread-2 100
3 pool-1-thread-4 100
4 pool-1-thread-5 100
5 pool-1-thread-6 100
6 pool-1-thread-7 100
7 pool-1-thread-8 100
8 pool-1-thread-9 100
9 pool-1-thread-10 100
sum = 1000
*/

View File

@ -52,11 +52,14 @@ public class CatchCompletableExceptions {
/* Output:
**** Failure Mode ****
Breakable_exceptionally [1]
Throwing Exception for exceptionally
result: Breakable_java.lang.RuntimeException:
Breakable_exceptionally failed [0]
Breakable_handle [1]
Throwing Exception for handle
result: Failure recovery object
Breakable_whenComplete [1]
Throwing Exception for whenComplete
It failed
**** Success Mode ****
Breakable_exceptionally [-1]

View File

@ -21,11 +21,11 @@ public class CompletableApplyAsync {
}
}
/* Output:
50
45
Machina0: ONE
Machina0: TWO
Machina0: THREE
Machina0: complete
Machina0: complete
462
463
*/

View File

@ -23,5 +23,5 @@ Machina0: ONE
Machina0: TWO
Machina0: THREE
Machina0: complete
460
452
*/

View File

@ -55,6 +55,7 @@ public class CompletableOperations {
1
runAsync
thenRunAsync
runAsync is static
99
thenAcceptAsync: 4
47
@ -65,7 +66,7 @@ thenAcceptAsync: 4
cancelled: true
completed exceptionally: true
done: true
java.util.concurrent.CompletableFuture@404b9385[Completed
java.util.concurrent.CompletableFuture@6d311334[Completed
exceptionally]
777
dependents: 1

View File

@ -42,46 +42,46 @@ public class CompletablePizza {
}
}
/* Output:
56
69
Pizza 0: ROLLED
Pizza 1: ROLLED
Pizza 4: ROLLED
Pizza 2: ROLLED
Pizza 3: ROLLED
Pizza 0: SAUCED
Pizza 3: SAUCED
Pizza 2: SAUCED
Pizza 4: SAUCED
Pizza 1: SAUCED
Pizza 0: SAUCED
Pizza 2: SAUCED
Pizza 0: CHEESED
Pizza 4: CHEESED
Pizza 2: CHEESED
Pizza 3: CHEESED
Pizza 1: CHEESED
Pizza 2: CHEESED
Pizza 4: ROLLED
Pizza 3: ROLLED
Pizza 0: TOPPED
Pizza 4: TOPPED
Pizza 3: SAUCED
Pizza 1: TOPPED
Pizza 3: TOPPED
Pizza 3: CHEESED
Pizza 4: SAUCED
Pizza 2: TOPPED
Pizza 3: TOPPED
Pizza 0: BAKED
Pizza 4: BAKED
Pizza 3: BAKED
Pizza 1: BAKED
Pizza 2: BAKED
Pizza 4: CHEESED
Pizza 3: BAKED
Pizza 0: SLICED
Pizza 2: SLICED
Pizza 4: SLICED
Pizza 1: SLICED
Pizza 3: SLICED
Pizza 3: BOXED
Pizza 1: SLICED
Pizza 2: BAKED
Pizza 0: BOXED
Pizza0: complete
Pizza 4: BOXED
Pizza 3: BOXED
Pizza 2: BOXED
Pizza 1: BOXED
Pizza1: complete
Pizza 4: TOPPED
Pizza 2: SLICED
Pizza 2: BOXED
Pizza2: complete
Pizza3: complete
Pizza 4: BAKED
Pizza 4: SLICED
Pizza 4: BOXED
Pizza4: complete
1659
3269
*/

View File

@ -17,15 +17,15 @@ public class CountingStream {
}
}
/* Output:
4 ForkJoinPool.commonPool-worker-5 100
2 ForkJoinPool.commonPool-worker-1 100
6 main 100
5 ForkJoinPool.commonPool-worker-1 100
7 ForkJoinPool.commonPool-worker-4 100
1 ForkJoinPool.commonPool-worker-3 100
8 ForkJoinPool.commonPool-worker-2 100
0 ForkJoinPool.commonPool-worker-6 100
9 ForkJoinPool.commonPool-worker-7 100
3 ForkJoinPool.commonPool-worker-5 100
4 ForkJoinPool.commonPool-worker-1 100
3 ForkJoinPool.commonPool-worker-1 100
7 ForkJoinPool.commonPool-worker-1 100
0 ForkJoinPool.commonPool-worker-1 100
5 ForkJoinPool.commonPool-worker-1 100
6 main 100
1 ForkJoinPool.commonPool-worker-3 100
9 ForkJoinPool.commonPool-worker-2 100
1000
*/

View File

@ -103,13 +103,11 @@ Workable[AW]
Workable[CW]
anyOf
Workable[BW]
Workable[DW]
Workable[AW]
*****************
Workable[CW]
Workable[DW]
Workable[BW]
Workable[DW]
Workable[CW]
Workable[AW]
*****************
allOf
*/

View File

@ -20,7 +20,7 @@ public class MoreTasksAfterShutdown {
/* Output:
java.util.concurrent.RejectedExecutionException: Task
NapTask[99] rejected from
java.util.concurrent.ThreadPoolExecutor@25154f[Shutting
java.util.concurrent.ThreadPoolExecutor@4e25154f[Shutting
down, pool size = 1, active threads = 1, queued tasks = 0,
completed tasks = 0]
NapTask[1] pool-1-thread-1

View File

@ -22,5 +22,5 @@ Pizza 0: TOPPED
Pizza 0: BAKED
Pizza 0: SLICED
Pizza 0: BOXED
1612
1605
*/

View File

@ -31,5 +31,5 @@ public class ParallelPrime {
}
}
/* Output:
616
1197
*/

View File

@ -24,5 +24,5 @@ public class ParallelStreamPuzzle {
}
}
/* Output:
[2, 8, 21, 24, 27, 30, 33, 37, 40, 43]
[1, 28, 30, 33, 36, 39, 42, 44, 46, 48]
*/

View File

@ -34,5 +34,5 @@ public class ParallelStreamPuzzle2 {
}
}
/* Output:
[4, 25, 27, 32, 37, 44, 49, 56, 61, 73]
[3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
*/

View File

@ -2,6 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand}
import java.util.*;
import java.util.stream.*;
@ -26,7 +27,7 @@ public class ParallelStreamPuzzle3 {
2: ForkJoinPool.commonPool-worker-6
4: ForkJoinPool.commonPool-worker-1
0: ForkJoinPool.commonPool-worker-4
7: main
7: ForkJoinPool.commonPool-worker-1
9: ForkJoinPool.commonPool-worker-2
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
*/

View File

@ -25,45 +25,45 @@ public class PizzaParallelSteps {
}
}
/* Output:
Pizza 0: ROLLED
Pizza 4: ROLLED
Pizza 1: ROLLED
Pizza 3: ROLLED
Pizza 0: ROLLED
Pizza 2: ROLLED
Pizza 4: SAUCED
Pizza 3: SAUCED
Pizza 1: SAUCED
Pizza 2: SAUCED
Pizza 0: SAUCED
Pizza 4: CHEESED
Pizza 1: CHEESED
Pizza 3: CHEESED
Pizza 1: SAUCED
Pizza 4: SAUCED
Pizza 0: CHEESED
Pizza 4: CHEESED
Pizza 2: CHEESED
Pizza 1: CHEESED
Pizza 1: TOPPED
Pizza 3: TOPPED
Pizza 4: TOPPED
Pizza 2: TOPPED
Pizza 4: TOPPED
Pizza 0: TOPPED
Pizza 1: BAKED
Pizza 3: BAKED
Pizza 0: BAKED
Pizza 4: BAKED
Pizza 2: BAKED
Pizza 0: BAKED
Pizza 1: SLICED
Pizza 3: SLICED
Pizza 1: BAKED
Pizza 0: SLICED
Pizza 2: SLICED
Pizza 4: SLICED
Pizza 0: SLICED
Pizza 1: BOXED
Pizza 3: BOXED
Pizza3: complete
Pizza 1: SLICED
Pizza 4: BOXED
Pizza4: complete
Pizza1: complete
Pizza 0: BOXED
Pizza 2: BOXED
Pizza2: complete
Pizza 0: BOXED
Pizza0: complete
1673
Pizza4: complete
Pizza 1: BOXED
Pizza1: complete
Pizza 3: ROLLED
Pizza 3: SAUCED
Pizza 3: CHEESED
Pizza 3: TOPPED
Pizza 3: BAKED
Pizza 3: SLICED
Pizza 3: BOXED
Pizza3: complete
3279
*/

View File

@ -21,40 +21,40 @@ public class PizzaStreams {
}
}
/* Output:
Pizza 1: ROLLED
Pizza 4: ROLLED
Pizza 2: ROLLED
Pizza 0: ROLLED
Pizza 3: ROLLED
Pizza 1: ROLLED
Pizza 0: SAUCED
Pizza 3: SAUCED
Pizza 2: SAUCED
Pizza 4: SAUCED
Pizza 1: SAUCED
Pizza 2: SAUCED
Pizza 0: CHEESED
Pizza 4: CHEESED
Pizza 3: CHEESED
Pizza 0: SAUCED
Pizza 2: CHEESED
Pizza 4: CHEESED
Pizza 0: CHEESED
Pizza 1: CHEESED
Pizza 3: TOPPED
Pizza 2: TOPPED
Pizza 4: TOPPED
Pizza 0: TOPPED
Pizza 2: TOPPED
Pizza 1: TOPPED
Pizza 0: BAKED
Pizza 3: BAKED
Pizza 4: BAKED
Pizza 1: BAKED
Pizza 2: BAKED
Pizza 4: SLICED
Pizza 3: SLICED
Pizza 0: SLICED
Pizza 1: BAKED
Pizza 0: BAKED
Pizza 2: SLICED
Pizza 4: SLICED
Pizza 1: SLICED
Pizza 3: BOXED
Pizza 0: SLICED
Pizza 2: BOXED
Pizza 4: BOXED
Pizza 0: BOXED
Pizza 1: BOXED
Pizza 2: BOXED
1667
Pizza 3: ROLLED
Pizza 3: SAUCED
Pizza 3: CHEESED
Pizza 3: TOPPED
Pizza 3: BAKED
Pizza 3: SLICED
Pizza 3: BOXED
3275
*/

View File

@ -23,13 +23,13 @@ public class QuittingCompletable {
}
}
/* Output:
125 148 115 127 120 118 106 140 77 119 97 80 143 17 92 147
89 123 16 12 138 25 13 101 135 96 76 73 130 133 37 132 134
149 137 122 29 49 60 40 142 131 53 1 98 145 126 65 5 64 82
79 68 86 141 61 128 22 7 26 19 139 114 146 14 15 43 34 10
75 87 90 31 47 38 62 18 63 41 42 144 66 23 6 4 91 70 83 102
103 54 69 74 56 71 94 88 78 81 57 52 93 45 48 44 32 28 36
33 104 105 112 109 100 117 24 108 21 116 20 9 85 8 84 72
107 113 121 124 136 129 99 95 55 3 27 2 59 67 50 58 51 39
30 35 46 110 111 11
1 3 4 5 6 2 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
118 119 120 121 122 123 124 7 126 127 128 129 130 131 132
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
148 149 125
*/

View File

@ -23,13 +23,13 @@ public class QuittingTasks {
}
}
/* Output:
125 148 115 127 120 118 106 140 77 119 97 80 143 17 92 147
89 123 16 12 138 25 13 101 135 96 76 73 130 133 37 132 134
149 137 122 29 49 60 40 142 131 53 1 98 145 126 65 5 64 82
79 68 86 141 61 128 22 7 26 19 139 114 146 14 15 43 34 10
75 87 90 31 47 38 62 18 63 41 42 144 66 23 6 4 91 70 83 102
103 54 69 74 56 71 94 88 78 81 57 52 93 45 48 44 32 28 36
33 104 105 112 109 100 117 24 108 21 116 20 9 85 8 84 72
107 113 121 124 136 129 99 95 55 3 27 2 59 67 50 58 51 39
30 35 46 110 111 11
2 33 32 28 31 30 26 29 27 22 1 25 4 23 24 6 5 7 3 8 10 9 12
11 21 17 13 14 15 16 18 19 20 39 34 36 37 35 38 40 52 57 53
54 95 88 89 91 84 90 87 85 92 86 77 94 80 81 78 59 55 71 74
60 58 76 79 62 83 63 82 61 64 68 65 72 69 67 66 47 75 73 49
45 70 42 44 51 41 43 50 46 48 56 123 126 119 120 127 121
114 117 99 116 115 129 96 145 142 143 148 93 140 125 139
124 147 101 141 128 133 100 135 137 130 144 134 146 131 149
138 113 132 110 109 111 105 118 97 122 107 98 102 104 103
106 112 108 136
*/

View File

@ -39,6 +39,6 @@ public class SharedConstructorArgument {
}
}
/* Output:
47747
48627
0
*/

View File

@ -26,20 +26,21 @@ public class SingleThreadExecutor {
/* Output:
All tasks submitted
main awaiting termination
main awaiting termination
NapTask[0] pool-1-thread-1
main awaiting termination
NapTask[1] pool-1-thread-1
main awaiting termination
NapTask[2] pool-1-thread-1
main awaiting termination
NapTask[3] pool-1-thread-1
main awaiting termination
main awaiting termination
NapTask[4] pool-1-thread-1
main awaiting termination
NapTask[5] pool-1-thread-1
main awaiting termination
NapTask[6] pool-1-thread-1
main awaiting termination
main awaiting termination
NapTask[7] pool-1-thread-1
main awaiting termination
NapTask[8] pool-1-thread-1

View File

@ -41,7 +41,7 @@ public class Summing {
}
/* Output:
5000000050000000
Sum Stream: 631ms
Sum Stream Parallel: 159ms
Sum Iterated: 2560ms
Sum Stream: 62ms
Sum Stream Parallel: 42ms
Sum Iterated: 116ms
*/

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand} // CI has trouble
// {ValidateByHand} CI has trouble
import java.util.*;
public class Summing2 {

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand} // CI has trouble
// {ValidateByHand} CI has trouble
import java.util.*;
public class Summing3 {

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand} // CI has trouble
// {ValidateByHand} CI has trouble
import java.util.*;
public class Summing4 {

View File

@ -9,5 +9,5 @@ public class TestStaticIDField {
}
}
/* Output:
47643
47829
*/

View File

@ -33,8 +33,8 @@ public enum ConstantSpecificMethod {
}
}
/* Output:
Jul 27, 2016
C:\Users\Bruce\Documents\GitHub\on-
May 2, 2017
C:\Users\bruce\Documents\Git\on-
java\ExtractedExamples\\gradle\wrapper\gradle-wrapper.jar
1.8.0_102
*/

View File

@ -34,8 +34,11 @@ Compiled from "NotClasses.java"
abstract class LikeClasses extends
java.lang.Enum<LikeClasses> {
public static final LikeClasses WINKEN;
public static final LikeClasses BLINKEN;
public static final LikeClasses NOD;
public static LikeClasses[] values();
Code:
0: getstatic #2 // Field

View File

@ -144,54 +144,54 @@ public class PostOffice {
}
}
/* Output:
Mail 0, General Delivery: NO3, Address Scanability: YES2,
Address Readability: YES1, Address Address: OK4, Return
address: OK5
Delivering Mail 0 automatically
Mail 0, General Delivery: NO2, Address Scanability:
UNSCANNABLE, Address Readability: YES3, Address Address:
OK1, Return address: OK1
Delivering Mail 0 normally
*****
Mail 1, General Delivery: NO1, Address Scanability: YES1,
Address Readability: YES3, Address Address: OK6, Return
address: OK1
Mail 1, General Delivery: NO5, Address Scanability: YES3,
Address Readability: ILLEGIBLE, Address Address: OK5,
Return address: OK1
Delivering Mail 1 automatically
*****
Mail 2, General Delivery: NO4, Address Scanability: YES2,
Address Readability: ILLEGIBLE, Address Address: OK5,
Return address: MISSING
Delivering Mail 2 automatically
*****
Mail 3, General Delivery: YES, Address Scanability:
UNSCANNABLE, Address Readability: YES2, Address Address:
OK6, Return address: OK1
Using general delivery for Mail 3
*****
Mail 4, General Delivery: YES, Address Scanability: YES4,
Address Readability: YES1, Address Address: OK6, Return
Mail 2, General Delivery: YES, Address Scanability: YES3,
Address Readability: YES1, Address Address: OK1, Return
address: OK5
Using general delivery for Mail 4
Using general delivery for Mail 2
*****
Mail 5, General Delivery: NO5, Address Scanability: YES3,
Address Readability: YES3, Address Address: OK1, Return
address: OK4
Mail 3, General Delivery: NO4, Address Scanability: YES3,
Address Readability: YES1, Address Address: INCORRECT,
Return address: OK4
Returning Mail 3 to sender
*****
Mail 4, General Delivery: NO4, Address Scanability:
UNSCANNABLE, Address Readability: YES1, Address Address:
INCORRECT, Return address: OK2
Returning Mail 4 to sender
*****
Mail 5, General Delivery: NO3, Address Scanability: YES1,
Address Readability: ILLEGIBLE, Address Address: OK4,
Return address: OK2
Delivering Mail 5 automatically
*****
Mail 6, General Delivery: YES, Address Scanability:
UNSCANNABLE, Address Readability: YES1, Address Address:
OK3, Return address: MISSING
Mail 6, General Delivery: YES, Address Scanability: YES4,
Address Readability: ILLEGIBLE, Address Address: OK4,
Return address: OK4
Using general delivery for Mail 6
*****
Mail 7, General Delivery: NO4, Address Scanability: YES1,
Address Readability: YES2, Address Address: OK2, Return
Mail 7, General Delivery: YES, Address Scanability: YES3,
Address Readability: YES4, Address Address: OK2, Return
address: MISSING
Delivering Mail 7 automatically
Using general delivery for Mail 7
*****
Mail 8, General Delivery: NO1, Address Scanability: YES2,
Address Readability: YES3, Address Address: OK3, Return
address: OK3
Delivering Mail 8 automatically
Mail 8, General Delivery: NO3, Address Scanability: YES1,
Address Readability: YES3, Address Address: INCORRECT,
Return address: MISSING
Mail 8 is a dead letter
*****
Mail 9, General Delivery: NO5, Address Scanability: YES1,
Address Readability: YES3, Address Address: OK2, Return
address: OK3
Delivering Mail 9 automatically
Mail 9, General Delivery: NO1, Address Scanability:
UNSCANNABLE, Address Readability: YES2, Address Address:
OK1, Return address: OK4
Delivering Mail 9 normally
*****
*/

View File

@ -15,7 +15,7 @@ public class RandomTest {
}
}
/* Output:
JUMPING DODGING SITTING RUNNING FLYING RUNNING DODGING
STANDING DODGING FALLING FALLING SITTING DODGING LYING
JUMPING JUMPING HOPPING DODGING SITTING FALLING
STANDING FLYING RUNNING STANDING RUNNING STANDING LYING
DODGING SITTING RUNNING HOPPING HOPPING HOPPING RUNNING
STANDING LYING FALLING RUNNING FLYING LYING
*/

View File

@ -81,24 +81,24 @@ public class RoShamBo1 {
}
}
/* Output:
Scissors vs. Rock: LOSE
Rock vs. Rock: DRAW
Paper vs. Rock: WIN
Paper vs. Rock: WIN
Paper vs. Rock: WIN
Scissors vs. Paper: WIN
Scissors vs. Scissors: DRAW
Scissors vs. Paper: WIN
Rock vs. Paper: LOSE
Rock vs. Rock: DRAW
Rock vs. Paper: LOSE
Paper vs. Scissors: LOSE
Rock vs. Paper: LOSE
Scissors vs. Scissors: DRAW
Scissors vs. Rock: LOSE
Scissors vs. Paper: WIN
Scissors vs. Rock: LOSE
Paper vs. Scissors: LOSE
Rock vs. Rock: DRAW
Scissors vs. Scissors: DRAW
Paper vs. Paper: DRAW
Scissors vs. Paper: WIN
Scissors vs. Rock: LOSE
Scissors vs. Paper: WIN
Rock vs. Paper: LOSE
Paper vs. Scissors: LOSE
Paper vs. Scissors: LOSE
Rock vs. Scissors: WIN
Rock vs. Paper: LOSE
Paper vs. Rock: WIN
Scissors vs. Paper: WIN
Paper vs. Scissors: LOSE
Paper vs. Scissors: LOSE
Paper vs. Scissors: LOSE
Paper vs. Scissors: LOSE
*/

View File

@ -31,24 +31,24 @@ public enum RoShamBo2 implements Competitor<RoShamBo2> {
}
}
/* Output:
PAPER vs. ROCK: WIN
ROCK vs. ROCK: DRAW
SCISSORS vs. ROCK: LOSE
SCISSORS vs. ROCK: LOSE
SCISSORS vs. ROCK: LOSE
PAPER vs. SCISSORS: LOSE
PAPER vs. PAPER: DRAW
PAPER vs. SCISSORS: LOSE
ROCK vs. SCISSORS: WIN
ROCK vs. ROCK: DRAW
ROCK vs. SCISSORS: WIN
SCISSORS vs. PAPER: WIN
ROCK vs. SCISSORS: WIN
PAPER vs. PAPER: DRAW
PAPER vs. ROCK: WIN
PAPER vs. SCISSORS: LOSE
PAPER vs. ROCK: WIN
SCISSORS vs. PAPER: WIN
ROCK vs. ROCK: DRAW
PAPER vs. PAPER: DRAW
SCISSORS vs. SCISSORS: DRAW
PAPER vs. SCISSORS: LOSE
PAPER vs. ROCK: WIN
PAPER vs. SCISSORS: LOSE
ROCK vs. SCISSORS: WIN
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
ROCK vs. PAPER: LOSE
ROCK vs. SCISSORS: WIN
SCISSORS vs. ROCK: LOSE
PAPER vs. SCISSORS: LOSE
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
*/

View File

@ -48,24 +48,24 @@ public enum RoShamBo3 implements Competitor<RoShamBo3> {
}
}
/* Output:
PAPER vs. ROCK: WIN
ROCK vs. ROCK: DRAW
SCISSORS vs. ROCK: LOSE
SCISSORS vs. ROCK: LOSE
SCISSORS vs. ROCK: LOSE
PAPER vs. SCISSORS: LOSE
PAPER vs. PAPER: DRAW
PAPER vs. SCISSORS: LOSE
ROCK vs. SCISSORS: WIN
ROCK vs. ROCK: DRAW
ROCK vs. SCISSORS: WIN
SCISSORS vs. PAPER: WIN
ROCK vs. SCISSORS: WIN
PAPER vs. PAPER: DRAW
PAPER vs. ROCK: WIN
PAPER vs. SCISSORS: LOSE
PAPER vs. ROCK: WIN
SCISSORS vs. PAPER: WIN
ROCK vs. ROCK: DRAW
PAPER vs. PAPER: DRAW
SCISSORS vs. SCISSORS: DRAW
PAPER vs. SCISSORS: LOSE
PAPER vs. ROCK: WIN
PAPER vs. SCISSORS: LOSE
ROCK vs. SCISSORS: WIN
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
ROCK vs. PAPER: LOSE
ROCK vs. SCISSORS: WIN
SCISSORS vs. ROCK: LOSE
PAPER vs. SCISSORS: LOSE
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
*/

View File

@ -34,24 +34,24 @@ public enum RoShamBo4 implements Competitor<RoShamBo4> {
}
}
/* Output:
ROCK vs. PAPER: LOSE
PAPER vs. PAPER: DRAW
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
ROCK vs. SCISSORS: WIN
ROCK vs. ROCK: DRAW
ROCK vs. SCISSORS: WIN
PAPER vs. SCISSORS: LOSE
PAPER vs. PAPER: DRAW
PAPER vs. SCISSORS: LOSE
SCISSORS vs. ROCK: LOSE
PAPER vs. SCISSORS: LOSE
ROCK vs. ROCK: DRAW
ROCK vs. PAPER: LOSE
ROCK vs. SCISSORS: WIN
ROCK vs. PAPER: LOSE
SCISSORS vs. ROCK: LOSE
PAPER vs. PAPER: DRAW
ROCK vs. ROCK: DRAW
SCISSORS vs. SCISSORS: DRAW
ROCK vs. SCISSORS: WIN
ROCK vs. PAPER: LOSE
ROCK vs. SCISSORS: WIN
PAPER vs. SCISSORS: LOSE
SCISSORS vs. ROCK: LOSE
SCISSORS vs. ROCK: LOSE
PAPER vs. ROCK: WIN
PAPER vs. SCISSORS: LOSE
SCISSORS vs. PAPER: WIN
ROCK vs. SCISSORS: WIN
SCISSORS vs. ROCK: LOSE
SCISSORS vs. ROCK: LOSE
SCISSORS vs. ROCK: LOSE
SCISSORS vs. ROCK: LOSE
*/

View File

@ -36,24 +36,24 @@ enum RoShamBo5 implements Competitor<RoShamBo5> {
}
}
/* Output:
PAPER vs. ROCK: WIN
ROCK vs. ROCK: DRAW
SCISSORS vs. ROCK: LOSE
SCISSORS vs. ROCK: LOSE
SCISSORS vs. ROCK: LOSE
PAPER vs. SCISSORS: LOSE
PAPER vs. PAPER: DRAW
PAPER vs. SCISSORS: LOSE
ROCK vs. SCISSORS: WIN
ROCK vs. ROCK: DRAW
ROCK vs. SCISSORS: WIN
SCISSORS vs. PAPER: WIN
ROCK vs. SCISSORS: WIN
PAPER vs. PAPER: DRAW
PAPER vs. ROCK: WIN
PAPER vs. SCISSORS: LOSE
PAPER vs. ROCK: WIN
SCISSORS vs. PAPER: WIN
ROCK vs. ROCK: DRAW
PAPER vs. PAPER: DRAW
SCISSORS vs. SCISSORS: DRAW
PAPER vs. SCISSORS: LOSE
PAPER vs. ROCK: WIN
PAPER vs. SCISSORS: LOSE
ROCK vs. SCISSORS: WIN
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
ROCK vs. PAPER: LOSE
ROCK vs. SCISSORS: WIN
SCISSORS vs. ROCK: LOSE
PAPER vs. SCISSORS: LOSE
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
*/

View File

@ -23,24 +23,24 @@ enum RoShamBo6 implements Competitor<RoShamBo6> {
}
}
/* Output:
PAPER vs. ROCK: WIN
ROCK vs. ROCK: DRAW
SCISSORS vs. ROCK: LOSE
SCISSORS vs. ROCK: LOSE
SCISSORS vs. ROCK: LOSE
PAPER vs. SCISSORS: LOSE
PAPER vs. PAPER: DRAW
PAPER vs. SCISSORS: LOSE
ROCK vs. SCISSORS: WIN
ROCK vs. ROCK: DRAW
ROCK vs. SCISSORS: WIN
SCISSORS vs. PAPER: WIN
ROCK vs. SCISSORS: WIN
PAPER vs. PAPER: DRAW
PAPER vs. ROCK: WIN
PAPER vs. SCISSORS: LOSE
PAPER vs. ROCK: WIN
SCISSORS vs. PAPER: WIN
ROCK vs. ROCK: DRAW
PAPER vs. PAPER: DRAW
SCISSORS vs. SCISSORS: DRAW
PAPER vs. SCISSORS: LOSE
PAPER vs. ROCK: WIN
PAPER vs. SCISSORS: LOSE
ROCK vs. SCISSORS: WIN
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
ROCK vs. PAPER: LOSE
ROCK vs. SCISSORS: WIN
SCISSORS vs. ROCK: LOSE
PAPER vs. SCISSORS: LOSE
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
SCISSORS vs. PAPER: WIN
*/

View File

@ -33,14 +33,14 @@ enum SecurityCategory {
}
}
/* Output:
STOCK: MARGIN
STOCK: LONG
STOCK: LONG
STOCK: MARGIN
BOND: MUNICIPAL
BOND: MUNICIPAL
STOCK: LONG
STOCK: MARGIN
STOCK: MARGIN
BOND: JUNK
STOCK: MARGIN
STOCK: SHORT
STOCK: LONG
STOCK: LONG
BOND: MUNICIPAL
BOND: JUNK
*/

View File

@ -32,6 +32,6 @@ public class EnumImplementation {
}
}
/* Output:
SILLY, SPANKY, PUNCHY, BOUNCY, BOB, SLAPPY, SLAPPY, BOB,
BOB, SLAPPY,
BOB, PUNCHY, BOB, SPANKY, NUTTY, PUNCHY, SLAPPY, NUTTY,
NUTTY, SLAPPY,
*/

View File

@ -17,29 +17,29 @@ public class Meal {
}
}
/* Output:
SALAD
SPRING_ROLLS
VINDALOO
GELATO
CAPPUCCINO
FRUIT
DECAF_COFFEE
***
SPRING_ROLLS
BURRITO
GELATO
HERB_TEA
***
SPRING_ROLLS
BURRITO
TIRAMISU
CAPPUCCINO
***
SPRING_ROLLS
BURRITO
BLACK_FOREST_CAKE
LATTE
***
SALAD
PAD_THAI
GELATO
SOUP
VINDALOO
FRUIT
TEA
***
SALAD
BURRITO
FRUIT
TEA
***
SALAD
BURRITO
CREME_CARAMEL
LATTE
***
SOUP
BURRITO
TIRAMISU
ESPRESSO
***
*/

View File

@ -46,29 +46,29 @@ public enum Meal2 {
}
}
/* Output:
SALAD
SPRING_ROLLS
VINDALOO
GELATO
CAPPUCCINO
FRUIT
DECAF_COFFEE
***
SPRING_ROLLS
BURRITO
GELATO
HERB_TEA
***
SPRING_ROLLS
BURRITO
TIRAMISU
CAPPUCCINO
***
SPRING_ROLLS
BURRITO
BLACK_FOREST_CAKE
LATTE
***
SALAD
PAD_THAI
GELATO
SOUP
VINDALOO
FRUIT
TEA
***
SALAD
BURRITO
FRUIT
TEA
***
SALAD
BURRITO
CREME_CARAMEL
LATTE
***
SOUP
BURRITO
TIRAMISU
ESPRESSO
***
*/

View File

@ -33,13 +33,13 @@ public class LoggingExceptions {
}
/* Output:
___[ Error Output ]___
Jul 27, 2016 10:50:30 AM LoggingException <init>
May 02, 2017 3:21:47 PM LoggingException <init>
SEVERE: LoggingException
at
LoggingExceptions.main(LoggingExceptions.java:20)
Caught LoggingException
Jul 27, 2016 10:50:30 AM LoggingException <init>
May 02, 2017 3:21:47 PM LoggingException <init>
SEVERE: LoggingException
at
LoggingExceptions.main(LoggingExceptions.java:25)

View File

@ -25,7 +25,7 @@ public class LoggingExceptions2 {
}
/* Output:
___[ Error Output ]___
Jul 27, 2016 10:50:30 AM LoggingExceptions2 logException
May 02, 2017 3:21:47 PM LoggingExceptions2 logException
SEVERE: java.lang.NullPointerException
at
LoggingExceptions2.main(LoggingExceptions2.java:17)

View File

@ -53,35 +53,35 @@ public class AddAndSubtractPaths {
}
/* Output:
Windows 10
C:\Users\Bruce\Documents\GitHub
C:\Users\bruce\Documents\Git
(1)r on-
java\ExtractedExamples\files\AddAndSubtractPaths.java
RealPath: C:\Users\Bruce\Documents\GitHub\on-
RealPath: C:\Users\bruce\Documents\Git\on-
java\ExtractedExamples\files\AddAndSubtractPaths.java
(2)r on-java\ExtractedExamples\strings\..\files
RealPath: C:\Users\Bruce\Documents\GitHub\on-
RealPath: C:\Users\bruce\Documents\Git\on-
java\ExtractedExamples\files
(3)r on-java\ExtractedExamples\files
RealPath: C:\Users\Bruce\Documents\GitHub\on-
RealPath: C:\Users\bruce\Documents\Git\on-
java\ExtractedExamples\files
(4) ..\..
RealPath: C:\Users\Bruce\Documents\GitHub\on-java
RealPath: C:\Users\bruce\Documents\Git\on-java
(5) ..\..
RealPath: C:\Users\Bruce\Documents\GitHub\on-java
RealPath: C:\Users\bruce\Documents\Git\on-java
(6)r on-java
RealPath: C:\Users\Bruce\Documents\GitHub\on-java
RealPath: C:\Users\bruce\Documents\Git\on-java
(7)r on-java\ExtractedExamples\files\.\..\..
RealPath: C:\Users\Bruce\Documents\GitHub\on-java
RealPath: C:\Users\bruce\Documents\Git\on-java
(8)r on-java
RealPath: C:\Users\Bruce\Documents\GitHub\on-java
RealPath: C:\Users\bruce\Documents\Git\on-java
(9)r on-java\ExtractedExamples\files
RealPath: C:\Users\Bruce\Documents\GitHub\on-
RealPath: C:\Users\bruce\Documents\Git\on-
java\ExtractedExamples\files
(10)r on-java\ExtractedExamples\strings
RealPath: C:\Users\Bruce\Documents\GitHub\on-
RealPath: C:\Users\bruce\Documents\Git\on-
java\ExtractedExamples\strings
(11) nonexistent
java.nio.file.NoSuchFileException:
C:\Users\Bruce\Documents\GitHub\on-
C:\Users\bruce\Documents\Git\on-
java\ExtractedExamples\files\nonexistent
*/

View File

@ -59,7 +59,7 @@ Nope, that doesn't work.
test\bag
test\bar
test\baz
test\DIR_3697011820450773773
test\DIR_7205037124905635827
test\foo
test\Hello.txt
*********
@ -68,27 +68,27 @@ test\bag
test\bag\foo
test\bag\foo\bar
test\bag\foo\bar\baz
test\bag\foo\bar\baz\234245189903117886.tmp
test\bag\foo\bar\baz\4584994277735481362.tmp
test\bag\foo\bar\baz\File.txt
test\bar
test\bar\baz
test\bar\baz\bag
test\bar\baz\bag\foo
test\bar\baz\bag\foo\8752987828022262887.tmp
test\bar\baz\bag\foo\4367937361263211140.tmp
test\bar\baz\bag\foo\File.txt
test\baz
test\baz\bag
test\baz\bag\foo
test\baz\bag\foo\bar
test\baz\bag\foo\bar\465343347528104633.tmp
test\baz\bag\foo\bar\7687116918707992631.tmp
test\baz\bag\foo\bar\File.txt
test\DIR_3697011820450773773
test\DIR_3697011820450773773\pre3304897437567097054.non
test\DIR_7205037124905635827
test\DIR_7205037124905635827\pre9154379587817312624.non
test\foo
test\foo\bar
test\foo\bar\baz
test\foo\bar\baz\bag
test\foo\bar\baz\bag\2118206626074637804.tmp
test\foo\bar\baz\bag\7686121002327077993.tmp
test\foo\bar\baz\bag\File.txt
test\Hello.txt
*/

View File

@ -27,15 +27,14 @@ public class FileSystemDemo {
}
/* Output:
Windows 10
File Store: SSD (C:)
File Store: Teenyverse (C:)
Root Directory: C:\
Root Directory: D:\
Separator: \
UserPrincipalLookupService:
sun.nio.fs.WindowsFileSystem$LookupService$1@1db9742
sun.nio.fs.WindowsFileSystem$LookupService$1@15db9742
isOpen: true
isReadOnly: false
FileSystemProvider:
sun.nio.fs.WindowsFileSystemProvider@106d69c
sun.nio.fs.WindowsFileSystemProvider@6d06d69c
File Attribute Views: [owner, dos, acl, basic, user]
*/

View File

@ -36,24 +36,24 @@ public class Find {
}
}
/* Output:
test\bag\foo\bar\baz\369594599218802549.tmp
test\bag\foo\bar\baz\7676311745640921113.tmp
test\bag\foo\bar\baz\File.txt
test\bar\baz\bag\foo\2372197258227988384.tmp
test\bar\baz\bag\foo\5150002287600428217.tmp
test\bar\baz\bag\foo\File.txt
test\baz\bag\foo\bar\1091363470697614580.tmp
test\baz\bag\foo\bar\8782742629206515741.tmp
test\baz\bag\foo\bar\File.txt
test\dir.tmp
test\foo\bar\baz\bag\48863440153181406.tmp
test\foo\bar\baz\bag\5650574120756265046.tmp
test\foo\bar\baz\bag\File.txt
***************
369594599218802549.tmp
2372197258227988384.tmp
1091363470697614580.tmp
7676311745640921113.tmp
5150002287600428217.tmp
8782742629206515741.tmp
dir.tmp
48863440153181406.tmp
5650574120756265046.tmp
***************
369594599218802549.tmp
2372197258227988384.tmp
1091363470697614580.tmp
48863440153181406.tmp
7676311745640921113.tmp
5150002287600428217.tmp
8782742629206515741.tmp
5650574120756265046.tmp
*/

View File

@ -25,18 +25,18 @@ public class PartsOfPaths {
/* Output:
Windows 10
Users
Bruce
bruce
Documents
GitHub
Git
on-java
ExtractedExamples
files
PartsOfPaths.java
ends with '.java': false
Users: false : false
Bruce: false : false
bruce: false : false
Documents: false : false
GitHub: false : false
Git: false : false
on-java: false : false
ExtractedExamples: false : false
files: false : false

View File

@ -48,9 +48,9 @@ Writable: true
notExists: false
Hidden: false
size: 1630
FileStore: SSD (C:)
LastModified: : 2016-07-27T15:52:49.898848Z
Owner: MINDVIEWTOSHIBA\Bruce (User)
FileStore: Teenyverse (C:)
LastModified: : 2017-05-02T21:19:06.828604Z
Owner: TEENYVERSE\bruce (User)
ContentType: null
SymbolicLink: false
*/

View File

@ -63,40 +63,40 @@ FileName: PathInfo.java
Parent: null
Root: null
----------------
toString: C:\Users\Bruce\Documents\GitHub\on-
toString: C:\Users\bruce\Documents\Git\on-
java\ExtractedExamples\files\PathInfo.java
Exists: true
RegularFile: true
Directory: false
Absolute: true
FileName: PathInfo.java
Parent: C:\Users\Bruce\Documents\GitHub\on-
Parent: C:\Users\bruce\Documents\Git\on-
java\ExtractedExamples\files
Root: C:\
----------------
toString: C:\Users\Bruce\Documents\GitHub\on-
toString: C:\Users\bruce\Documents\Git\on-
java\ExtractedExamples\files
Exists: true
RegularFile: false
Directory: true
Absolute: true
FileName: files
Parent: C:\Users\Bruce\Documents\GitHub\on-
Parent: C:\Users\bruce\Documents\Git\on-
java\ExtractedExamples
Root: C:\
----------------
toString: C:\Users\Bruce\Documents\GitHub\on-
toString: C:\Users\bruce\Documents\Git\on-
java\ExtractedExamples\files\PathInfo.java
Exists: true
RegularFile: true
Directory: false
Absolute: true
FileName: PathInfo.java
Parent: C:\Users\Bruce\Documents\GitHub\on-
Parent: C:\Users\bruce\Documents\Git\on-
java\ExtractedExamples\files
Root: C:\
----------------
URI: file:///C:/Users/Bruce/Documents/GitHub/on-
URI: file:///C:/Users/bruce/Documents/Git/on-
java/ExtractedExamples/files/PathInfo.java
true
*/

View File

@ -2,6 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand}
import java.io.IOException;
import java.nio.file.*;
import static java.nio.file.StandardWatchEventKinds.*;
@ -47,7 +48,4 @@ deleting test\bar\baz\bag\foo\File.txt
evt.context(): File.txt
evt.count(): 1
evt.kind(): ENTRY_DELETE
evt.context(): File.txt
evt.count(): 1
evt.kind(): ENTRY_DELETE
*/

View File

@ -60,6 +60,6 @@ public class DynamicProxyMixin {
}
/* Output:
Hello
1469638238271
1493760122461
1
*/

View File

@ -16,8 +16,8 @@ public class GenericReading {
Fruit f = readExact(fruit);
f = readExact(apples);
}
// If you have a class, its type is
// established when the class is instantiated:
// A class type is established
// when the class is instantiated:
static class Reader<T> {
T readExact(List<T> list) { return list.get(0); }
}

View File

@ -64,6 +64,6 @@ public class Mixins {
}
}
/* Output:
test string 1 1469638250315 1
test string 2 1469638250317 2
test string 1 1493760126621 1
test string 2 1493760126621 2
*/

View File

@ -18,6 +18,6 @@ extends ArrayList<Tuple4<A, B, C, D>> {
}
}
/* Output:
(Vehicle@107d329, Amphibian@1629346, hi, 47)
(Vehicle@4b9385, Amphibian@1311334, hi, 47)
(Vehicle@214c265e, Amphibian@448139f0, hi, 47)
(Vehicle@7cca494b, Amphibian@7ba4f24f, hi, 47)
*/

View File

@ -35,7 +35,7 @@ public class TupleTest {
}
/* Output:
(hi, 47)
(Amphibian@1c7c054, hi, 47)
(Vehicle@14991ad, Amphibian@d93b30, hi, 47)
(Vehicle@a14482, Amphibian@140e19d, hi, 47, 11.1)
(Amphibian@4554617c, hi, 47)
(Vehicle@677327b6, Amphibian@14ae5a5, hi, 47)
(Vehicle@135fbaa4, Amphibian@45ee12a7, hi, 47, 11.1)
*/

View File

@ -35,7 +35,7 @@ public class TupleTest2 {
/* Output:
(hi, 47)
(hi, 47)
(Amphibian@a298b7, hi, 47)
(Vehicle@16d3586, Amphibian@154617c, hi, 47)
(Vehicle@17327b6, Amphibian@14ae5a5, hi, 47, 11.1)
(Amphibian@1540e19d, hi, 47)
(Vehicle@7f31245a, Amphibian@6d6f6e28, hi, 47)
(Vehicle@330bedb4, Amphibian@2503dbd3, hi, 47, 11.1)
*/

View File

@ -35,19 +35,19 @@ COBALT_BLUE_HUE, PERMANENT_GREEN, VIRIDIAN_HUE]
set2: [CERULEAN_BLUE_HUE, PHTHALO_BLUE, ULTRAMARINE,
COBALT_BLUE_HUE, PERMANENT_GREEN, VIRIDIAN_HUE, SAP_GREEN,
YELLOW_OCHRE, BURNT_SIENNA, RAW_UMBER, BURNT_UMBER]
union(set1, set2): [MAGENTA, COBALT_BLUE_HUE, VIOLET,
VIRIDIAN_HUE, BURNT_SIENNA, ULTRAMARINE, CERULEAN_BLUE_HUE,
BURNT_UMBER, BRILLIANT_RED, PHTHALO_BLUE, YELLOW_OCHRE,
SAP_GREEN, CRIMSON, ROSE_MADDER, RAW_UMBER,
PERMANENT_GREEN]
intersection(set1, set2): [COBALT_BLUE_HUE, VIRIDIAN_HUE,
ULTRAMARINE, CERULEAN_BLUE_HUE, PHTHALO_BLUE,
PERMANENT_GREEN]
difference(set1, subset): [CRIMSON, MAGENTA, VIOLET,
ROSE_MADDER, BRILLIANT_RED]
difference(set2, subset): [BURNT_SIENNA, BURNT_UMBER,
YELLOW_OCHRE, RAW_UMBER, SAP_GREEN]
complement(set1, set2): [MAGENTA, VIOLET, BURNT_SIENNA,
BURNT_UMBER, BRILLIANT_RED, YELLOW_OCHRE, SAP_GREEN,
CRIMSON, ROSE_MADDER, RAW_UMBER]
union(set1, set2): [BURNT_UMBER, MAGENTA, RAW_UMBER,
VIOLET, BURNT_SIENNA, ULTRAMARINE, CRIMSON,
PERMANENT_GREEN, YELLOW_OCHRE, BRILLIANT_RED, PHTHALO_BLUE,
CERULEAN_BLUE_HUE, SAP_GREEN, COBALT_BLUE_HUE, ROSE_MADDER,
VIRIDIAN_HUE]
intersection(set1, set2): [ULTRAMARINE, PERMANENT_GREEN,
PHTHALO_BLUE, COBALT_BLUE_HUE, CERULEAN_BLUE_HUE,
VIRIDIAN_HUE]
difference(set1, subset): [MAGENTA, VIOLET, CRIMSON,
BRILLIANT_RED, ROSE_MADDER]
difference(set2, subset): [SAP_GREEN, BURNT_UMBER,
RAW_UMBER, BURNT_SIENNA, YELLOW_OCHRE]
complement(set1, set2): [BURNT_UMBER, MAGENTA, RAW_UMBER,
VIOLET, BURNT_SIENNA, CRIMSON, YELLOW_OCHRE, BRILLIANT_RED,
SAP_GREEN, ROSE_MADDER]
*/

1
gg.bat
View File

@ -1 +0,0 @@
gradlew --console plain %*

View File

@ -25,6 +25,6 @@ public class NewVarArgs {
47 3.14 11.11
47 3.14 11.11
one two three
A@1db9742 A@106d69c A@52e922
A@15db9742 A@6d06d69c A@7852e922
1 2 3 4
*/

View File

@ -22,5 +22,5 @@ public class VarArgs {
/* Output:
47 3.14 11.11
one two three
A@1db9742 A@106d69c A@52e922
A@15db9742 A@6d06d69c A@7852e922
*/

View File

@ -44,6 +44,6 @@ IF SHE WEIGHS THE SAME AS A DUCK, SHE'S MADE OF WOOD
Using Processor Downcase
if she weighs the same as a duck, she's made of wood
Using Processor Splitter
[If, she, weighs, the, same, as, a, duck,, she's, made,
of, wood]
[If, she, weighs, the, same, as, a, duck,, she's, made, of,
wood]
*/

View File

@ -22,5 +22,5 @@ public class HelloDateDoc {
}
/* Output:
Hello, it's:
Wed Jul 27 10:50:45 MDT 2016
Tue May 02 15:22:28 MDT 2017
*/

View File

@ -4,6 +4,7 @@
// Visit http://OnJava8.com for more book information.
// Locks in the concurrent library allow you
// to give up on trying to acquire a lock
// {ValidateByHand} AppVeyor CI has trouble
import java.util.concurrent.*;
import java.util.concurrent.locks.*;
import onjava.Nap;

View File

@ -70,14 +70,11 @@ public class DelayQueueDemo {
}
}
/* Output:
[128] Task 12 [429] Task 6 [551] Task 13
[555] Task 2 [693] Task 3 [809] Task 15
[961] Task 5 [1258] Task 1 [1258] Task 20
[1520] Task 19 [1861] Task 4 [1998] T
ask 17 [2200] Task 8 [2207] Task 10 [2288]
Task 11 [2522] Task 9 [2589] Task 14
[2861] Task 18 [2868] Task 7 [3278]
Task 16 (0:4000)
[128] Task 12 [429] Task 6 [551] Task 13 [555] Task 2 [693]
Task 3 [809] Task 15 [961] Task 5 [1258] Task 1 [1258] Task
20 [1520] Task 19 [1861] Task 4 [1998] Task 17 [2200] Task
8 [2207] Task 10 [2288] Task 11 [2522] Task 9 [2589] Task
14 [2861] Task 18 [2868] Task 7 [3278] Task 16 (0:4000)
(1:1258)
(2:555)
(3:693)

View File

@ -3,6 +3,7 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// When threads collide
// {ValidateByHand}
public class EvenProducer extends IntGenerator {
private int currentEvenValue = 0;
@ -17,10 +18,6 @@ public class EvenProducer extends IntGenerator {
}
}
/* Output:
1563 not even!
1573 not even!
1571 not even!
1569 not even!
1567 not even!
1565 not even!
303 not even!
301 not even!
*/

View File

@ -17,7 +17,7 @@ public class NotAtomic {
public NotAtomic();
Code:
0: aload_0
1: invokespecial #1 // Method
1: invokespecial #1 // Method
java/lang/Object."<init>":()V
4: return
@ -25,20 +25,20 @@ java/lang/Object."<init>":()V
Code:
0: aload_0
1: dup
2: getfield #2 // Field i:I
2: getfield #2 // Field i:I
5: iconst_1
6: iadd
7: putfield #2 // Field i:I
7: putfield #2 // Field i:I
10: return
void f2();
Code:
0: aload_0
1: dup
2: getfield #2 // Field i:I
2: getfield #2 // Field i:I
5: iconst_3
6: iadd
7: putfield #2 // Field i:I
7: putfield #2 // Field i:I
10: return
}
*/

View File

@ -10,5 +10,5 @@ public class NumberOfProcessors {
}
}
/* Output:
8
4
*/

View File

@ -98,38 +98,38 @@ public class PriorityBlockingQueueDemo {
}
}
/* Output:
[15] Prioritized 1
[17] Prioritized 0
[17] Prioritized 2
[18] Prioritized 26
[17] Prioritized 5
[16] Prioritized 6
[14] Prioritized 9
[12] Prioritized 2
[11] Prioritized 4
[11] Prioritized 12
[13] Prioritized 13
[12] Prioritized 16
[14] Prioritized 18
[15] Prioritized 23
[18] Prioritized 26
[16] Prioritized 29
[15] Prioritized 1
[15] Prioritized 23
[14] Prioritized 9
[14] Prioritized 18
[13] Prioritized 13
[12] Prioritized 17
[11] Prioritized 30
[12] Prioritized 0
[12] Prioritized 16
[11] Prioritized 12
[11] Prioritized 24
[11] Prioritized 4
[11] Prioritized 30
[10] Prioritized 15
[10] Prioritized 22
[8] Prioritized 25
[8] Prioritized 11
[8] Prioritized 10
[8] Prioritized 25
[6] Prioritized 31
[3] Prioritized 7
[2] Prioritized 20
[1] Prioritized 3
[0] Prioritized 14
[0] Prioritized 19
[0] Prioritized 8
[0] Prioritized 14
[0] Prioritized 21
[-1] Prioritized 28
(0:17)(2:12)(1:15)(3:1)(4:11)
(1:15)(0:12)(2:17)(3:1)(4:11)
(5:17)(6:16)(7:3)(8:0)(9:14)
(10:8)(11:8)(12:11)(13:13)(14:0)
(15:10)(16:12)(17:12)(18:14)(19:0)

View File

@ -9,5 +9,5 @@ public class SerialNumberTest {
}
}
/* Output:
Duplicate: 4119
Duplicate: 4687
*/

View File

@ -78,12 +78,12 @@ public class SynchronizedComparison {
/* Output:
-> 152
-> 152
-> 153
-> 153
CriticalSection: 610
-> 44
-> 28
-> 62
-> 152
-> 150
CriticalSection: 606
-> 72
-> 24
SynchronizedMethod: 158
-> 70
-> 164
SynchronizedMethod: 330
*/

View File

@ -13,5 +13,5 @@ public class TestAbort {
}
/* Output:
Napping for 4
TimedAbort 1
TimedAbort 1.0
*/

View File

@ -16,5 +16,5 @@ public class UnsafeReturn extends IntTestable {
}
}
/* Output:
failed with: 21
failed with: 3
*/

View File

@ -27,15 +27,15 @@ public class WorkStealingPool {
}
}
/* Output:
8
ForkJoinPool-1-worker-1
ForkJoinPool-1-worker-2
ForkJoinPool-1-worker-1
ForkJoinPool-1-worker-1
ForkJoinPool-1-worker-4
4
ForkJoinPool-1-worker-1
ForkJoinPool-1-worker-3
ForkJoinPool-1-worker-5
ForkJoinPool-1-worker-4
ForkJoinPool-1-worker-2
ForkJoinPool-1-worker-2
ForkJoinPool-1-worker-2
ForkJoinPool-1-worker-2
ForkJoinPool-1-worker-2
ForkJoinPool-1-worker-2
ForkJoinPool-1-worker-3
ForkJoinPool-1-worker-1
*/

View File

@ -3,7 +3,7 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// Displays Charsets and aliases
// {ValidateByHand} // CI has trouble
// {ValidateByHand} CI has trouble
import java.nio.charset.*;
import java.util.*;

View File

@ -135,10 +135,10 @@ public class MappedIO {
}
}
/* Output:
Stream Write: 0.269
Stream Write: 0.285
Mapped Write: 0.022
Stream Read: 0.262
Mapped Read: 0.010
Stream Read/Write: 1.620
Mapped Read/Write: 0.007
Stream Read: 0.311
Mapped Read: 0.009
Stream Read/Write: 1.368
Mapped Read/Write: 0.005
*/

View File

@ -14,13 +14,13 @@ public class ShowProperties {
/* Output: (First 20 Lines)
-- listing properties --
java.runtime.name=Java(TM) SE Runtime Environment
sun.boot.library.path=C:\Program Files
(x86)\Java\jdk1.8.0_...
sun.boot.library.path=C:\Program
Files\Java\jdk1.8.0_102\jr...
java.vm.version=25.102-b14
java.vm.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
path.separator=;
java.vm.name=Java HotSpot(TM) Client VM
java.vm.name=Java HotSpot(TM) 64-Bit Server VM
file.encoding.pkg=sun.io
user.script=
user.country=US
@ -28,12 +28,11 @@ sun.java.launcher=SUN_STANDARD
sun.os.patch.level=
java.vm.specification.name=Java Virtual Machine
Specification
user.dir=C:\Users\Bruce\Documents\GitHub\on-ja...
user.dir=C:\Users\bruce\Documents\Git\on-java\...
java.runtime.version=1.8.0_102-b14
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=C:\Program Files
(x86)\Java\jdk1.8.0_...
os.arch=x86
java.io.tmpdir=C:\Users\Bruce\AppData\Local\Temp\
java.endorsed.dirs=C:\Program Files\Java\jdk1.8.0_102\jr...
os.arch=amd64
java.io.tmpdir=C:\Users\bruce\AppData\Local\Temp\
...
*/

Some files were not shown because too many files have changed in this diff Show More