diff --git a/ShowFindbugs.py b/ShowFindbugs.py deleted file mode 100644 index ec11f8fb..00000000 --- a/ShowFindbugs.py +++ /dev/null @@ -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") diff --git a/_verify_output.py b/_verify_output.py index 088ca6a3..6ceb5422 100644 --- a/_verify_output.py +++ b/_verify_output.py @@ -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 diff --git a/annotations/AtUnitComposition.java b/annotations/AtUnitComposition.java index 1b6d5910..187b48a9 100644 --- a/annotations/AtUnitComposition.java +++ b/annotations/AtUnitComposition.java @@ -23,8 +23,8 @@ public class AtUnitComposition { } /* Output: annotations.AtUnitComposition - . tMethodOne . tMethodTwo This is methodTwo + . tMethodOne OK (2 tests) */ diff --git a/annotations/AtUnitExample1.java b/annotations/AtUnitExample1.java index d0f6f1e1..4b83bf9f 100644 --- a/annotations/AtUnitExample1.java +++ b/annotations/AtUnitExample1.java @@ -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 */ diff --git a/annotations/AtUnitExample2.java b/annotations/AtUnitExample2.java index a72282fa..78ba02ac 100644 --- a/annotations/AtUnitExample2.java +++ b/annotations/AtUnitExample2.java @@ -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 */ diff --git a/annotations/AtUnitExample3.java b/annotations/AtUnitExample3.java index aabb92dc..5d4f754e 100644 --- a/annotations/AtUnitExample3.java +++ b/annotations/AtUnitExample3.java @@ -34,9 +34,9 @@ public class AtUnitExample3 { } /* Output: annotations.AtUnitExample3 - . m2 This is methodTwo - . methodOneTest . initialization + . m2 This is methodTwo + OK (3 tests) */ diff --git a/annotations/AtUnitExample4.java b/annotations/AtUnitExample4.java index 2837c81a..1fb7ce3a 100644 --- a/annotations/AtUnitExample4.java +++ b/annotations/AtUnitExample4.java @@ -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 */ diff --git a/annotations/AtUnitExample5.java b/annotations/AtUnitExample5.java index 20f60860..1402ca29 100644 --- a/annotations/AtUnitExample5.java +++ b/annotations/AtUnitExample5.java @@ -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) */ diff --git a/annotations/AtUnitExternalTest.java b/annotations/AtUnitExternalTest.java index d6ba375b..55410f90 100644 --- a/annotations/AtUnitExternalTest.java +++ b/annotations/AtUnitExternalTest.java @@ -22,8 +22,8 @@ AtUnitExternalTest extends AtUnitExample1 { } /* Output: annotations.AtUnitExternalTest + . tMethodOne . tMethodTwo This is methodTwo - . tMethodOne OK (2 tests) */ diff --git a/annotations/HashSetTest.java b/annotations/HashSetTest.java index 27044ed9..40876c07 100644 --- a/annotations/HashSetTest.java +++ b/annotations/HashSetTest.java @@ -29,8 +29,8 @@ public class HashSetTest { } /* Output: annotations.HashSetTest - . tRemove - . tContains . initialization + . tContains + . tRemove OK (3 tests) */ diff --git a/annotations/UseCaseTracker.java b/annotations/UseCaseTracker.java index c6188e9f..d9fb07f5 100644 --- a/annotations/UseCaseTracker.java +++ b/annotations/UseCaseTracker.java @@ -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 */ diff --git a/arrays/AlphabeticSearch.java b/arrays/AlphabeticSearch.java index acaa7368..305b07db 100644 --- a/arrays/AlphabeticSearch.java +++ b/arrays/AlphabeticSearch.java @@ -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 */ diff --git a/arrays/ParallelPrefix3.java b/arrays/ParallelPrefix3.java index e436023a..45297cb8 100644 --- a/arrays/ParallelPrefix3.java +++ b/arrays/ParallelPrefix3.java @@ -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 { diff --git a/check.bat b/check.bat deleted file mode 100644 index 25446ee4..00000000 --- a/check.bat +++ /dev/null @@ -1,2 +0,0 @@ -cp ..\..\OnJava-Tools\verify_output.py . -py -3 verify_output.py diff --git a/collections/ApplesAndOrangesWithoutGenerics.java b/collections/ApplesAndOrangesWithoutGenerics.java index 92103377..775e25f9 100644 --- a/collections/ApplesAndOrangesWithoutGenerics.java +++ b/collections/ApplesAndOrangesWithoutGenerics.java @@ -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) */ diff --git a/collections/GenericsAndUpcasting.java b/collections/GenericsAndUpcasting.java index 797f40d5..0ba792c6 100644 --- a/collections/GenericsAndUpcasting.java +++ b/collections/GenericsAndUpcasting.java @@ -21,8 +21,8 @@ public class GenericsAndUpcasting { } } /* Output: -GrannySmith@1db9742 -Gala@106d69c -Fuji@52e922 -Braeburn@25154f +GrannySmith@15db9742 +Gala@6d06d69c +Fuji@7852e922 +Braeburn@4e25154f */ diff --git a/collections/ListIteration.java b/collections/ListIteration.java index 3925e4a1..cf4c1558 100644 --- a/collections/ListIteration.java +++ b/collections/ListIteration.java @@ -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, diff --git a/collections/MapOfList.java b/collections/MapOfList.java index 877ebd37..26135f8d 100644 --- a/collections/MapOfList.java +++ b/collections/MapOfList.java @@ -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 */ diff --git a/collectiontopics/Bits.java b/collectiontopics/Bits.java index 3235ae39..8af818d1 100644 --- a/collectiontopics/Bits.java +++ b/collectiontopics/Bits.java @@ -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} diff --git a/collectiontopics/FillingLists.java b/collectiontopics/FillingLists.java index e29fd456..f014e2f3 100644 --- a/collectiontopics/FillingLists.java +++ b/collectiontopics/FillingLists.java @@ -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!] */ diff --git a/collectiontopics/ListOps.java b/collectiontopics/ListOps.java index 72ecf8ab..cf9e2750 100644 --- a/collectiontopics/ListOps.java +++ b/collectiontopics/ListOps.java @@ -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] */ diff --git a/collectiontopics/References.java b/collectiontopics/References.java index 30dfd45d..e95cce2d 100644 --- a/collectiontopics/References.java +++ b/collectiontopics/References.java @@ -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 */ diff --git a/collectiontopics/TypesForSets.java b/collectiontopics/TypesForSets.java index b7840f64..45651d70 100644 --- a/collectiontopics/TypesForSets.java +++ b/collectiontopics/TypesForSets.java @@ -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 */ diff --git a/concurrent/CachedThreadPool.java b/concurrent/CachedThreadPool.java index 5cf7fb00..4e3a95b4 100644 --- a/concurrent/CachedThreadPool.java +++ b/concurrent/CachedThreadPool.java @@ -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 */ diff --git a/concurrent/CachedThreadPool2.java b/concurrent/CachedThreadPool2.java index 52ba937d..c9e1a775 100644 --- a/concurrent/CachedThreadPool2.java +++ b/concurrent/CachedThreadPool2.java @@ -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 */ diff --git a/concurrent/CachedThreadPool3.java b/concurrent/CachedThreadPool3.java index cc17e424..96ebb8e0 100644 --- a/concurrent/CachedThreadPool3.java +++ b/concurrent/CachedThreadPool3.java @@ -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 */ diff --git a/concurrent/CatchCompletableExceptions.java b/concurrent/CatchCompletableExceptions.java index 3f4036be..ed180ee8 100644 --- a/concurrent/CatchCompletableExceptions.java +++ b/concurrent/CatchCompletableExceptions.java @@ -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] diff --git a/concurrent/CompletableApplyAsync.java b/concurrent/CompletableApplyAsync.java index fd73a940..3218fe34 100644 --- a/concurrent/CompletableApplyAsync.java +++ b/concurrent/CompletableApplyAsync.java @@ -21,11 +21,11 @@ public class CompletableApplyAsync { } } /* Output: -50 +45 Machina0: ONE Machina0: TWO Machina0: THREE Machina0: complete Machina0: complete -462 +463 */ diff --git a/concurrent/CompletableApplyChained.java b/concurrent/CompletableApplyChained.java index 2834e2a8..c3e71fb0 100644 --- a/concurrent/CompletableApplyChained.java +++ b/concurrent/CompletableApplyChained.java @@ -23,5 +23,5 @@ Machina0: ONE Machina0: TWO Machina0: THREE Machina0: complete -460 +452 */ diff --git a/concurrent/CompletableOperations.java b/concurrent/CompletableOperations.java index ffa06612..1e29b574 100644 --- a/concurrent/CompletableOperations.java +++ b/concurrent/CompletableOperations.java @@ -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 diff --git a/concurrent/CompletablePizza.java b/concurrent/CompletablePizza.java index fb800abe..9eb936de 100644 --- a/concurrent/CompletablePizza.java +++ b/concurrent/CompletablePizza.java @@ -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 */ diff --git a/concurrent/CountingStream.java b/concurrent/CountingStream.java index 0ab94d45..73392a21 100644 --- a/concurrent/CountingStream.java +++ b/concurrent/CountingStream.java @@ -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 */ diff --git a/concurrent/DualCompletableOperations.java b/concurrent/DualCompletableOperations.java index 2c4ac45a..db092064 100644 --- a/concurrent/DualCompletableOperations.java +++ b/concurrent/DualCompletableOperations.java @@ -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 */ diff --git a/concurrent/MoreTasksAfterShutdown.java b/concurrent/MoreTasksAfterShutdown.java index 872e5853..ff22fa57 100644 --- a/concurrent/MoreTasksAfterShutdown.java +++ b/concurrent/MoreTasksAfterShutdown.java @@ -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 diff --git a/concurrent/OnePizza.java b/concurrent/OnePizza.java index 204ef839..5f00ff9a 100644 --- a/concurrent/OnePizza.java +++ b/concurrent/OnePizza.java @@ -22,5 +22,5 @@ Pizza 0: TOPPED Pizza 0: BAKED Pizza 0: SLICED Pizza 0: BOXED -1612 +1605 */ diff --git a/concurrent/ParallelPrime.java b/concurrent/ParallelPrime.java index 247deb8c..f8c3a064 100644 --- a/concurrent/ParallelPrime.java +++ b/concurrent/ParallelPrime.java @@ -31,5 +31,5 @@ public class ParallelPrime { } } /* Output: -616 +1197 */ diff --git a/concurrent/ParallelStreamPuzzle.java b/concurrent/ParallelStreamPuzzle.java index bf3dd365..a7fb4914 100644 --- a/concurrent/ParallelStreamPuzzle.java +++ b/concurrent/ParallelStreamPuzzle.java @@ -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] */ diff --git a/concurrent/ParallelStreamPuzzle2.java b/concurrent/ParallelStreamPuzzle2.java index 8f72fd76..de81c851 100644 --- a/concurrent/ParallelStreamPuzzle2.java +++ b/concurrent/ParallelStreamPuzzle2.java @@ -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] */ diff --git a/concurrent/ParallelStreamPuzzle3.java b/concurrent/ParallelStreamPuzzle3.java index 6045ba92..f537e12f 100644 --- a/concurrent/ParallelStreamPuzzle3.java +++ b/concurrent/ParallelStreamPuzzle3.java @@ -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] */ diff --git a/concurrent/PizzaParallelSteps.java b/concurrent/PizzaParallelSteps.java index 26f5e9a8..394c6e3f 100644 --- a/concurrent/PizzaParallelSteps.java +++ b/concurrent/PizzaParallelSteps.java @@ -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 */ diff --git a/concurrent/PizzaStreams.java b/concurrent/PizzaStreams.java index 58f81d6f..e782d9ec 100644 --- a/concurrent/PizzaStreams.java +++ b/concurrent/PizzaStreams.java @@ -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 */ diff --git a/concurrent/QuittingCompletable.java b/concurrent/QuittingCompletable.java index a4d3995c..0de45e2e 100644 --- a/concurrent/QuittingCompletable.java +++ b/concurrent/QuittingCompletable.java @@ -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 */ diff --git a/concurrent/QuittingTasks.java b/concurrent/QuittingTasks.java index b9825a27..330f3669 100644 --- a/concurrent/QuittingTasks.java +++ b/concurrent/QuittingTasks.java @@ -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 */ diff --git a/concurrent/SharedConstructorArgument.java b/concurrent/SharedConstructorArgument.java index 0d987088..f59406c8 100644 --- a/concurrent/SharedConstructorArgument.java +++ b/concurrent/SharedConstructorArgument.java @@ -39,6 +39,6 @@ public class SharedConstructorArgument { } } /* Output: -47747 +48627 0 */ diff --git a/concurrent/SingleThreadExecutor.java b/concurrent/SingleThreadExecutor.java index 2ef99677..9366283d 100644 --- a/concurrent/SingleThreadExecutor.java +++ b/concurrent/SingleThreadExecutor.java @@ -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 diff --git a/concurrent/Summing.java b/concurrent/Summing.java index 286861cd..aa500e18 100644 --- a/concurrent/Summing.java +++ b/concurrent/Summing.java @@ -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 */ diff --git a/concurrent/Summing2.java b/concurrent/Summing2.java index dabece6e..0a64d0b3 100644 --- a/concurrent/Summing2.java +++ b/concurrent/Summing2.java @@ -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 { diff --git a/concurrent/Summing3.java b/concurrent/Summing3.java index bcd48326..77aa8a49 100644 --- a/concurrent/Summing3.java +++ b/concurrent/Summing3.java @@ -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 { diff --git a/concurrent/Summing4.java b/concurrent/Summing4.java index 27353141..2ecfbf1b 100644 --- a/concurrent/Summing4.java +++ b/concurrent/Summing4.java @@ -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 { diff --git a/concurrent/TestStaticIDField.java b/concurrent/TestStaticIDField.java index 5ad53adb..c042ddec 100644 --- a/concurrent/TestStaticIDField.java +++ b/concurrent/TestStaticIDField.java @@ -9,5 +9,5 @@ public class TestStaticIDField { } } /* Output: -47643 +47829 */ diff --git a/enums/ConstantSpecificMethod.java b/enums/ConstantSpecificMethod.java index 7e485e2c..d1df6af1 100644 --- a/enums/ConstantSpecificMethod.java +++ b/enums/ConstantSpecificMethod.java @@ -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 */ diff --git a/enums/NotClasses.java b/enums/NotClasses.java index 7e0ce287..c58a16c4 100644 --- a/enums/NotClasses.java +++ b/enums/NotClasses.java @@ -34,8 +34,11 @@ Compiled from "NotClasses.java" abstract class LikeClasses extends java.lang.Enum { public static final LikeClasses WINKEN; + public static final LikeClasses BLINKEN; + public static final LikeClasses NOD; + public static LikeClasses[] values(); Code: 0: getstatic #2 // Field diff --git a/enums/PostOffice.java b/enums/PostOffice.java index 4d00b25e..46526804 100644 --- a/enums/PostOffice.java +++ b/enums/PostOffice.java @@ -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 ***** */ diff --git a/enums/RandomTest.java b/enums/RandomTest.java index b81835e6..9d74531f 100644 --- a/enums/RandomTest.java +++ b/enums/RandomTest.java @@ -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 */ diff --git a/enums/RoShamBo1.java b/enums/RoShamBo1.java index 93095883..7fba6896 100644 --- a/enums/RoShamBo1.java +++ b/enums/RoShamBo1.java @@ -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 */ diff --git a/enums/RoShamBo2.java b/enums/RoShamBo2.java index c977991c..45ae3362 100644 --- a/enums/RoShamBo2.java +++ b/enums/RoShamBo2.java @@ -31,24 +31,24 @@ public enum RoShamBo2 implements Competitor { } } /* 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 */ diff --git a/enums/RoShamBo3.java b/enums/RoShamBo3.java index a4a843b1..046912dd 100644 --- a/enums/RoShamBo3.java +++ b/enums/RoShamBo3.java @@ -48,24 +48,24 @@ public enum RoShamBo3 implements Competitor { } } /* 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 */ diff --git a/enums/RoShamBo4.java b/enums/RoShamBo4.java index ccaa7e5d..b129e09d 100644 --- a/enums/RoShamBo4.java +++ b/enums/RoShamBo4.java @@ -34,24 +34,24 @@ public enum RoShamBo4 implements Competitor { } } /* 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 */ diff --git a/enums/RoShamBo5.java b/enums/RoShamBo5.java index 5382aba1..eabddd3d 100644 --- a/enums/RoShamBo5.java +++ b/enums/RoShamBo5.java @@ -36,24 +36,24 @@ enum RoShamBo5 implements Competitor { } } /* 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 */ diff --git a/enums/RoShamBo6.java b/enums/RoShamBo6.java index 1483a803..d1e2e026 100644 --- a/enums/RoShamBo6.java +++ b/enums/RoShamBo6.java @@ -23,24 +23,24 @@ enum RoShamBo6 implements Competitor { } } /* 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 */ diff --git a/enums/SecurityCategory.java b/enums/SecurityCategory.java index f915f28f..908ebe9c 100644 --- a/enums/SecurityCategory.java +++ b/enums/SecurityCategory.java @@ -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 */ diff --git a/enums/cartoons/EnumImplementation.java b/enums/cartoons/EnumImplementation.java index 68eab358..cb3abaa0 100644 --- a/enums/cartoons/EnumImplementation.java +++ b/enums/cartoons/EnumImplementation.java @@ -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, */ diff --git a/enums/menu/Meal.java b/enums/menu/Meal.java index f83a3002..3bd12ed2 100644 --- a/enums/menu/Meal.java +++ b/enums/menu/Meal.java @@ -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 +*** */ diff --git a/enums/menu/Meal2.java b/enums/menu/Meal2.java index ef0c3873..17bbdf6e 100644 --- a/enums/menu/Meal2.java +++ b/enums/menu/Meal2.java @@ -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 +*** */ diff --git a/exceptions/LoggingExceptions.java b/exceptions/LoggingExceptions.java index c28510f8..0569c05b 100644 --- a/exceptions/LoggingExceptions.java +++ b/exceptions/LoggingExceptions.java @@ -33,13 +33,13 @@ public class LoggingExceptions { } /* Output: ___[ Error Output ]___ -Jul 27, 2016 10:50:30 AM LoggingException +May 02, 2017 3:21:47 PM LoggingException SEVERE: LoggingException at LoggingExceptions.main(LoggingExceptions.java:20) Caught LoggingException -Jul 27, 2016 10:50:30 AM LoggingException +May 02, 2017 3:21:47 PM LoggingException SEVERE: LoggingException at LoggingExceptions.main(LoggingExceptions.java:25) diff --git a/exceptions/LoggingExceptions2.java b/exceptions/LoggingExceptions2.java index a99d0a85..11ebc705 100644 --- a/exceptions/LoggingExceptions2.java +++ b/exceptions/LoggingExceptions2.java @@ -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) diff --git a/files/AddAndSubtractPaths.java b/files/AddAndSubtractPaths.java index c13121ba..d913fada 100644 --- a/files/AddAndSubtractPaths.java +++ b/files/AddAndSubtractPaths.java @@ -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 */ diff --git a/files/Directories.java b/files/Directories.java index 0172344b..b96d7365 100644 --- a/files/Directories.java +++ b/files/Directories.java @@ -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 */ diff --git a/files/FileSystemDemo.java b/files/FileSystemDemo.java index 98c51776..a1591b72 100644 --- a/files/FileSystemDemo.java +++ b/files/FileSystemDemo.java @@ -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] */ diff --git a/files/Find.java b/files/Find.java index 46461546..fdc7e55e 100644 --- a/files/Find.java +++ b/files/Find.java @@ -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 */ diff --git a/files/PartsOfPaths.java b/files/PartsOfPaths.java index 9f27e035..66be7823 100644 --- a/files/PartsOfPaths.java +++ b/files/PartsOfPaths.java @@ -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 diff --git a/files/PathAnalysis.java b/files/PathAnalysis.java index b76be551..163a8954 100644 --- a/files/PathAnalysis.java +++ b/files/PathAnalysis.java @@ -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 */ diff --git a/files/PathInfo.java b/files/PathInfo.java index fc6ba1d5..d2bf515f 100644 --- a/files/PathInfo.java +++ b/files/PathInfo.java @@ -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 */ diff --git a/files/TreeWatcher.java b/files/TreeWatcher.java index b13107cc..bc8378d7 100644 --- a/files/TreeWatcher.java +++ b/files/TreeWatcher.java @@ -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 */ diff --git a/generics/DynamicProxyMixin.java b/generics/DynamicProxyMixin.java index 75e162b9..942b638d 100644 --- a/generics/DynamicProxyMixin.java +++ b/generics/DynamicProxyMixin.java @@ -60,6 +60,6 @@ public class DynamicProxyMixin { } /* Output: Hello -1469638238271 +1493760122461 1 */ diff --git a/generics/GenericReading.java b/generics/GenericReading.java index 8479f105..c75cd91c 100644 --- a/generics/GenericReading.java +++ b/generics/GenericReading.java @@ -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 readExact(List list) { return list.get(0); } } diff --git a/generics/Mixins.java b/generics/Mixins.java index e272f1c0..d018ee0c 100644 --- a/generics/Mixins.java +++ b/generics/Mixins.java @@ -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 */ diff --git a/generics/TupleList.java b/generics/TupleList.java index c25a135b..8a0d75e1 100644 --- a/generics/TupleList.java +++ b/generics/TupleList.java @@ -18,6 +18,6 @@ extends ArrayList> { } } /* 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) */ diff --git a/generics/TupleTest.java b/generics/TupleTest.java index 7a0e3c73..da7305b3 100644 --- a/generics/TupleTest.java +++ b/generics/TupleTest.java @@ -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) */ diff --git a/generics/TupleTest2.java b/generics/TupleTest2.java index c12d77ef..f9f18216 100644 --- a/generics/TupleTest2.java +++ b/generics/TupleTest2.java @@ -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) */ diff --git a/generics/WatercolorSets.java b/generics/WatercolorSets.java index 365cace8..5f584e12 100644 --- a/generics/WatercolorSets.java +++ b/generics/WatercolorSets.java @@ -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] */ diff --git a/gg.bat b/gg.bat deleted file mode 100644 index 174efa64..00000000 --- a/gg.bat +++ /dev/null @@ -1 +0,0 @@ -gradlew --console plain %* diff --git a/housekeeping/NewVarArgs.java b/housekeeping/NewVarArgs.java index 2e19809a..28eb2a9c 100644 --- a/housekeeping/NewVarArgs.java +++ b/housekeeping/NewVarArgs.java @@ -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 */ diff --git a/housekeeping/VarArgs.java b/housekeeping/VarArgs.java index 0b15efa0..36dfb5a0 100644 --- a/housekeeping/VarArgs.java +++ b/housekeeping/VarArgs.java @@ -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 */ diff --git a/interfaces/interfaceprocessor/StringProcessor.java b/interfaces/interfaceprocessor/StringProcessor.java index 01ec1680..c5c229a4 100644 --- a/interfaces/interfaceprocessor/StringProcessor.java +++ b/interfaces/interfaceprocessor/StringProcessor.java @@ -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] */ diff --git a/javadoc/HelloDateDoc.java b/javadoc/HelloDateDoc.java index 8aef609b..a1c848b5 100644 --- a/javadoc/HelloDateDoc.java +++ b/javadoc/HelloDateDoc.java @@ -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 */ diff --git a/lowlevel/AttemptLocking.java b/lowlevel/AttemptLocking.java index 969143e6..ad0ded79 100644 --- a/lowlevel/AttemptLocking.java +++ b/lowlevel/AttemptLocking.java @@ -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; diff --git a/lowlevel/DelayQueueDemo.java b/lowlevel/DelayQueueDemo.java index c805d738..01620f58 100644 --- a/lowlevel/DelayQueueDemo.java +++ b/lowlevel/DelayQueueDemo.java @@ -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) diff --git a/lowlevel/EvenProducer.java b/lowlevel/EvenProducer.java index d51ec838..6b665fde 100644 --- a/lowlevel/EvenProducer.java +++ b/lowlevel/EvenProducer.java @@ -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! */ diff --git a/lowlevel/NotAtomic.java b/lowlevel/NotAtomic.java index ab9577a9..4ac34dbc 100644 --- a/lowlevel/NotAtomic.java +++ b/lowlevel/NotAtomic.java @@ -17,7 +17,7 @@ public class NotAtomic { public NotAtomic(); Code: 0: aload_0 - 1: invokespecial #1 // Method + 1: invokespecial #1 // Method java/lang/Object."":()V 4: return @@ -25,20 +25,20 @@ java/lang/Object."":()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 } */ diff --git a/lowlevel/NumberOfProcessors.java b/lowlevel/NumberOfProcessors.java index 103d6c1d..6039f30f 100644 --- a/lowlevel/NumberOfProcessors.java +++ b/lowlevel/NumberOfProcessors.java @@ -10,5 +10,5 @@ public class NumberOfProcessors { } } /* Output: -8 +4 */ diff --git a/lowlevel/PriorityBlockingQueueDemo.java b/lowlevel/PriorityBlockingQueueDemo.java index c006981b..f50b13d0 100644 --- a/lowlevel/PriorityBlockingQueueDemo.java +++ b/lowlevel/PriorityBlockingQueueDemo.java @@ -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) diff --git a/lowlevel/SerialNumberTest.java b/lowlevel/SerialNumberTest.java index d19b8f6b..9ab2b828 100644 --- a/lowlevel/SerialNumberTest.java +++ b/lowlevel/SerialNumberTest.java @@ -9,5 +9,5 @@ public class SerialNumberTest { } } /* Output: -Duplicate: 4119 +Duplicate: 4687 */ diff --git a/lowlevel/SynchronizedComparison.java b/lowlevel/SynchronizedComparison.java index f497e518..42c7aecc 100644 --- a/lowlevel/SynchronizedComparison.java +++ b/lowlevel/SynchronizedComparison.java @@ -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 */ diff --git a/lowlevel/TestAbort.java b/lowlevel/TestAbort.java index 2c38fc5c..c5dc1069 100644 --- a/lowlevel/TestAbort.java +++ b/lowlevel/TestAbort.java @@ -13,5 +13,5 @@ public class TestAbort { } /* Output: Napping for 4 -TimedAbort 1 +TimedAbort 1.0 */ diff --git a/lowlevel/UnsafeReturn.java b/lowlevel/UnsafeReturn.java index e8e9df3c..bdd6f891 100644 --- a/lowlevel/UnsafeReturn.java +++ b/lowlevel/UnsafeReturn.java @@ -16,5 +16,5 @@ public class UnsafeReturn extends IntTestable { } } /* Output: -failed with: 21 +failed with: 3 */ diff --git a/lowlevel/WorkStealingPool.java b/lowlevel/WorkStealingPool.java index a24f3722..43a03419 100644 --- a/lowlevel/WorkStealingPool.java +++ b/lowlevel/WorkStealingPool.java @@ -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 */ diff --git a/newio/AvailableCharSets.java b/newio/AvailableCharSets.java index 64c0e3a9..ac3f4b79 100644 --- a/newio/AvailableCharSets.java +++ b/newio/AvailableCharSets.java @@ -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.*; diff --git a/newio/MappedIO.java b/newio/MappedIO.java index 6b146a21..16cd2371 100644 --- a/newio/MappedIO.java +++ b/newio/MappedIO.java @@ -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 */ diff --git a/objects/ShowProperties.java b/objects/ShowProperties.java index 73f00f2e..2f59ebdc 100644 --- a/objects/ShowProperties.java +++ b/objects/ShowProperties.java @@ -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\ ... */ diff --git a/onjava/atunit/ClassNameFinder.java b/onjava/atunit/ClassNameFinder.java index 1444fa57..68ffac0e 100644 --- a/onjava/atunit/ClassNameFinder.java +++ b/onjava/atunit/ClassNameFinder.java @@ -113,63 +113,63 @@ onjava.BasicSupplier onjava.CollectionMethodDifferences onjava.ConvertTo onjava.Count$Boolean -onjava.Count$Pboolean onjava.Count$Byte -onjava.Count$Pbyte onjava.Count$Character -onjava.Count$Pchar onjava.Count$Double -onjava.Count$Pdouble onjava.Count$Float -onjava.Count$Pfloat onjava.Count$Integer -onjava.Count$Pint onjava.Count$Long +onjava.Count$Pboolean +onjava.Count$Pbyte +onjava.Count$Pchar +onjava.Count$Pdouble +onjava.Count$Pfloat +onjava.Count$Pint onjava.Count$Plong -onjava.Count$Short onjava.Count$Pshort +onjava.Count$Short onjava.Count onjava.CountingIntegerList onjava.CountMap onjava.Countries onjava.Enums onjava.FillMap -onjava.Hex +onjava.HTMLColors onjava.MouseClick +onjava.Nap onjava.Null -onjava.Operation +onjava.Operations onjava.OSExecute onjava.OSExecuteException onjava.Pair onjava.ProcessFiles$Strategy onjava.ProcessFiles onjava.Rand$Boolean -onjava.Rand$Pboolean onjava.Rand$Byte -onjava.Rand$Pbyte onjava.Rand$Character -onjava.Rand$Pchar onjava.Rand$Double -onjava.Rand$Pdouble onjava.Rand$Float -onjava.Rand$Pfloat onjava.Rand$Integer -onjava.Rand$Pint onjava.Rand$Long +onjava.Rand$Pboolean +onjava.Rand$Pbyte +onjava.Rand$Pchar +onjava.Rand$Pdouble +onjava.Rand$Pfloat +onjava.Rand$Pint onjava.Rand$Plong -onjava.Rand$Short onjava.Rand$Pshort +onjava.Rand$Short onjava.Rand$String onjava.Rand onjava.Range onjava.Repeat onjava.RmDir onjava.Sets -onjava.Sleep onjava.Stack onjava.Suppliers onjava.TimedAbort -onjava.TimeIt +onjava.Timer onjava.Tuple onjava.Tuple2 onjava.Tuple3 diff --git a/operators/Equivalence.java b/operators/Equivalence.java index 26a89490..268a75be 100644 --- a/operators/Equivalence.java +++ b/operators/Equivalence.java @@ -12,6 +12,6 @@ public class Equivalence { } } /* Output: -false true +false */ diff --git a/operators/URShift.java b/operators/URShift.java index 1ea17392..95350a57 100644 --- a/operators/URShift.java +++ b/operators/URShift.java @@ -30,7 +30,7 @@ public class URShift { /* Output: 11111111111111111111111111111111 1111111111111111111111 -111111111111111111111111111111111111111111111111111111111 +11111111111111111111111111111111111111111111111111111111111 11111 111111111111111111111111111111111111111111111111111111 11111111111111111111111111111111 diff --git a/patterns/BoxObserver.java b/patterns/BoxObserver.java index b19a448c..0bcf2bf9 100644 --- a/patterns/BoxObserver.java +++ b/patterns/BoxObserver.java @@ -4,7 +4,7 @@ // Visit http://OnJava8.com for more book information. // Demonstration of Observer pattern using // Java's built-in observer classes -// {ValidateByHand} // CI servers have problems +// {ValidateByHand} CI servers have problems import javax.swing.*; import java.awt.*; import java.awt.event.*; diff --git a/preferences/PreferencesDemo.java b/preferences/PreferencesDemo.java index e6d40260..597ed06f 100644 --- a/preferences/PreferencesDemo.java +++ b/preferences/PreferencesDemo.java @@ -30,10 +30,10 @@ Location: Oz Footwear: Ruby Slippers Companions: 4 Are there witches?: true -UsageCount: 191 +UsageCount: 58 How many companions does Dorothy have? 4 ___[ Error Output ]___ -Jul 27, 2016 10:50:50 AM java.util.prefs.WindowsPreferences +May 02, 2017 3:23:40 PM java.util.prefs.WindowsPreferences WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows diff --git a/references/Compete.java b/references/Compete.java index 0b0d77f4..34bf4594 100644 --- a/references/Compete.java +++ b/references/Compete.java @@ -84,6 +84,6 @@ public class Compete { } } /* Output: -Duplication via serialization: 776 Milliseconds -Duplication via cloning: 122 Milliseconds +Duplication via serialization: 305 Milliseconds +Duplication via cloning: 13 Milliseconds */ diff --git a/references/CopyConstructor.java b/references/CopyConstructor.java index 6627cf42..46e1ee21 100644 --- a/references/CopyConstructor.java +++ b/references/CopyConstructor.java @@ -177,10 +177,12 @@ public class CopyConstructor { /* Output: In ripen, t is a Tomato In slice, f is a Fruit -In ripen2, t is a Tomato -In slice2, f is a Tomato +java.lang.NoSuchMethodException: Tomato.(Tomato) +java.lang.NoSuchMethodException: Tomato.(Tomato) In ripen, t is a Tomato In slice, f is a Fruit -In ripen2, t is a GreenZebra -In slice2, f is a GreenZebra +java.lang.NoSuchMethodException: +GreenZebra.(GreenZebra) +java.lang.NoSuchMethodException: +GreenZebra.(GreenZebra) */ diff --git a/references/PassReferences.java b/references/PassReferences.java index d42f4a21..effa9ca6 100644 --- a/references/PassReferences.java +++ b/references/PassReferences.java @@ -14,6 +14,6 @@ public class PassReferences { } } /* Output: -p inside main(): PassReferences@1db9742 -h inside f(): PassReferences@1db9742 +p inside main(): PassReferences@15db9742 +h inside f(): PassReferences@15db9742 */ diff --git a/serialization/Logon.java b/serialization/Logon.java index eafa30d6..32d49576 100644 --- a/serialization/Logon.java +++ b/serialization/Logon.java @@ -52,11 +52,11 @@ public class Logon implements Serializable { /* Output: logon a = logon info: username: Hulk - date: Sat Jan 21 22:06:35 PST 2017 + date: Tue May 02 15:23:47 MDT 2017 password: myLittlePony -Recovering object at Sat Jan 21 22:06:36 PST 2017 +Recovering object at Tue May 02 15:23:48 MDT 2017 logon a = logon info: username: Hulk - date: Sat Jan 21 22:06:35 PST 2017 + date: Tue May 02 15:23:47 MDT 2017 password: null */ diff --git a/serialization/MyWorld.java b/serialization/MyWorld.java index de5cad4e..1bff977a 100644 --- a/serialization/MyWorld.java +++ b/serialization/MyWorld.java @@ -77,20 +77,20 @@ public class MyWorld { } } /* Output: -animals: [Bosco the dog[Animal@1db9742], House@106d69c -, Ralph the hamster[Animal@52e922], House@106d69c -, Molly the cat[Animal@25154f], House@106d69c +animals: [Bosco the dog[Animal@15db9742], House@6d06d69c +, Ralph the hamster[Animal@7852e922], House@6d06d69c +, Molly the cat[Animal@4e25154f], House@6d06d69c ] -animals1: [Bosco the dog[Animal@1a4f24f], House@19a45b3 -, Ralph the hamster[Animal@99a589], House@19a45b3 -, Molly the cat[Animal@372a00], House@19a45b3 +animals1: [Bosco the dog[Animal@7ba4f24f], House@3b9a45b3 +, Ralph the hamster[Animal@7699a589], House@3b9a45b3 +, Molly the cat[Animal@58372a00], House@3b9a45b3 ] -animals2: [Bosco the dog[Animal@1a4f24f], House@19a45b3 -, Ralph the hamster[Animal@99a589], House@19a45b3 -, Molly the cat[Animal@372a00], House@19a45b3 +animals2: [Bosco the dog[Animal@7ba4f24f], House@3b9a45b3 +, Ralph the hamster[Animal@7699a589], House@3b9a45b3 +, Molly the cat[Animal@58372a00], House@3b9a45b3 ] -animals3: [Bosco the dog[Animal@dd8dc3], House@103e736 -, Ralph the hamster[Animal@8db2f2], House@103e736 -, Molly the cat[Animal@18bf509], House@103e736 +animals3: [Bosco the dog[Animal@4dd8dc3], House@6d03e736 +, Ralph the hamster[Animal@568db2f2], House@6d03e736 +, Molly the cat[Animal@378bf509], House@6d03e736 ] */ diff --git a/serialization/Worm.java b/serialization/Worm.java index 4ed3570e..26198886 100644 --- a/serialization/Worm.java +++ b/serialization/Worm.java @@ -94,9 +94,9 @@ Worm constructor: 4 Worm constructor: 3 Worm constructor: 2 Worm constructor: 1 -w = :a(571):b(079):c(688):d(307):e(052):f(402) +w = :a(853):b(119):c(802):d(788):e(199):f(881) Worm storage -w2 = :a(571):b(079):c(688):d(307):e(052):f(402) +w2 = :a(853):b(119):c(802):d(788):e(199):f(881) Worm storage -w3 = :a(571):b(079):c(688):d(307):e(052):f(402) +w3 = :a(853):b(119):c(802):d(788):e(199):f(881) */ diff --git a/streams/ForEach.java b/streams/ForEach.java index 6258b8e7..807bab60 100644 --- a/streams/ForEach.java +++ b/streams/ForEach.java @@ -23,6 +23,6 @@ public class ForEach { } /* Output: 258 555 693 861 961 429 868 200 522 207 288 128 551 589 -551 589 200 861 522 429 868 961 288 555 128 693 207 258 +551 589 861 555 200 693 429 258 288 522 207 128 868 961 258 555 693 861 961 429 868 200 522 207 288 128 551 589 */ diff --git a/streams/SelectElement.java b/streams/SelectElement.java index 83a9f5e6..d4aff8c6 100644 --- a/streams/SelectElement.java +++ b/streams/SelectElement.java @@ -20,5 +20,5 @@ public class SelectElement { 258 258 258 -242 +8 */ diff --git a/strings/Conversion.java b/strings/Conversion.java index 9009d9b8..3b4f723b 100644 --- a/strings/Conversion.java +++ b/strings/Conversion.java @@ -104,8 +104,8 @@ e: 1.795430e+02 h: 1ef462c y = new Conversion() b: true -s: Conversion@1db9742 -h: 1db9742 +s: Conversion@15db9742 +h: 15db9742 z = false b: false s: false diff --git a/typeinfo/PetCount3.java b/typeinfo/PetCount3.java index 9977f9c0..cbce8a24 100644 --- a/typeinfo/PetCount3.java +++ b/typeinfo/PetCount3.java @@ -48,6 +48,6 @@ public class PetCount3 { Rat Manx Cymric Mutt Pug Cymric Pug Manx Cymric Rat EgyptianMau Hamster EgyptianMau Mutt Mutt Cymric Mouse Pug Mouse Cymric -{Hamster=1, Rodent=5, Mouse=2, Dog=6, Cymric=5, Manx=7, -Rat=2, Pug=3, Mutt=3, Pet=20, EgyptianMau=2, Cat=9} +{Hamster=1, Manx=7, EgyptianMau=2, Mutt=3, Rodent=5, +Mouse=2, Cymric=5, Pug=3, Dog=6, Rat=2, Pet=20, Cat=9} */ diff --git a/typeinfo/PetCount4.java b/typeinfo/PetCount4.java index 803f1c37..d5c5aa4a 100644 --- a/typeinfo/PetCount4.java +++ b/typeinfo/PetCount4.java @@ -20,6 +20,6 @@ public class PetCount4 { Rat Manx Cymric Mutt Pug Cymric Pug Manx Cymric Rat EgyptianMau Hamster EgyptianMau Mutt Mutt Cymric Mouse Pug Mouse Cymric -{EgyptianMau=2, Hamster=1, Pug=3, Manx=7, Cymric=5, Dog=6, -Pet=20, Mutt=3, Rat=2, Mouse=2, Rodent=5, Cat=9} +{EgyptianMau=2, Cymric=5, Mutt=3, Cat=9, Rat=2, Pet=20, +Manx=7, Hamster=1, Pug=3, Rodent=5, Dog=6, Mouse=2} */ diff --git a/typeinfo/SimpleDynamicProxy.java b/typeinfo/SimpleDynamicProxy.java index 50857ccb..2b0ab4e1 100644 --- a/typeinfo/SimpleDynamicProxy.java +++ b/typeinfo/SimpleDynamicProxy.java @@ -46,7 +46,7 @@ Interface.doSomething(), args: null doSomething **** proxy: class $Proxy0, method: public abstract void Interface.somethingElse(java.lang.String), args: -[Ljava.lang.Object;@1c7c054 +[Ljava.lang.Object;@6bc7c054 bonobo somethingElse bonobo */ diff --git a/update_extracted_example_output.py b/update_extracted_example_output.py deleted file mode 100644 index 3e21c283..00000000 --- a/update_extracted_example_output.py +++ /dev/null @@ -1,35 +0,0 @@ -#! py -3 -# Requires Python 3.5 -# Updates generated output into extracted Java programs in "On Java 8" -from pathlib import Path -import pprint -import sys - -def remove_output(javatext): - result = "" - for line in javatext.splitlines(): - if "/* Output:" not in line: - result += line.rstrip() + "\n" - else: - return result - -def update_file(outfile): - print(str(outfile)) - javafile = outfile.with_suffix(".java") - if not javafile.exists(): - print(str(outfile) + " has no javafile") - sys.exit(1) - javatext = javafile.read_text() - if "/* Output:" not in javatext: - print(str(javafile) + " has no /* Output:") - sys.exit(1) - new_output = outfile.read_text() - new_javatext = remove_output(javatext) + new_output - javafile.write_text(new_javatext) - -if __name__ == '__main__': - if len(sys.argv) > 1: - update_file(Path(sys.argv[1])) - else: - for outfile in Path(".").rglob("*.p1"): - update_file(outfile) diff --git a/validating/BadMicroBenchmark2.java b/validating/BadMicroBenchmark2.java index 0318edf6..74b712f4 100644 --- a/validating/BadMicroBenchmark2.java +++ b/validating/BadMicroBenchmark2.java @@ -28,8 +28,8 @@ public class BadMicroBenchmark2 { } } /* Output: -parallelSetAll: 1360 -setAll: 125 -parallelSetAll: 75 -setAll: 17 +parallelSetAll: 776 +setAll: 120 +parallelSetAll: 72 +setAll: 15 */ diff --git a/validating/GuavaPreconditions.java b/validating/GuavaPreconditions.java index fe06c574..622f3908 100644 --- a/validating/GuavaPreconditions.java +++ b/validating/GuavaPreconditions.java @@ -93,18 +93,17 @@ IllegalStateException null NullPointerException Robert -IndexOutOfBoundsException: index (6) must be less -than size (6) +IndexOutOfBoundsException: index (6) must be less than size +(6) Bob -IndexOutOfBoundsException: index (6) must be less -than size (3) +IndexOutOfBoundsException: index (6) must be less than size +(3) null NullPointerException Robert Success Bob -IndexOutOfBoundsException: index (6) -must not be greater +IndexOutOfBoundsException: index (6) must not be greater than size (3) null NullPointerException @@ -113,15 +112,14 @@ Success Hieronymus Success Hieronymus -IndexOutOfBoundsException: end index (11) -must not be greater -than size (10) +IndexOutOfBoundsException: end index (11) must not be +greater than size (10) Hieronymus -IndexOutOfBoundsException: start index (-1) -must not be negative +IndexOutOfBoundsException: start index (-1) must not be +negative Hieronymus -IndexOutOfBoundsException: end index (6) -must not be less than start index (7) +IndexOutOfBoundsException: end index (6) must not be less +than start index (7) null NullPointerException */ diff --git a/validating/SLF4JLevels.java b/validating/SLF4JLevels.java index 19214175..3e36c961 100644 --- a/validating/SLF4JLevels.java +++ b/validating/SLF4JLevels.java @@ -16,14 +16,14 @@ public class SLF4JLevels { } } /* Output: -2016-08-22T14:33:01.951 +2017-05-02T15:24:11.555 [main] TRACE SLF4JLevels - Hello -2016-08-22T14:33:01.954 +2017-05-02T15:24:11.555 [main] DEBUG SLF4JLevels - Logging -2016-08-22T14:33:01.954 +2017-05-02T15:24:11.555 [main] INFO SLF4JLevels - Using -2016-08-22T14:33:01.955 +2017-05-02T15:24:11.555 [main] WARN SLF4JLevels - the SLF4J -2016-08-22T14:33:01.955 +2017-05-02T15:24:11.555 [main] ERROR SLF4JLevels - Facade */ diff --git a/validating/SLF4JLogging.java b/validating/SLF4JLogging.java index fc39e0ed..18f28528 100644 --- a/validating/SLF4JLogging.java +++ b/validating/SLF4JLogging.java @@ -12,6 +12,6 @@ public class SLF4JLogging { } } /* Output: -2016-08-22T14:42:44.177 +2017-05-02T15:24:11.861 [main] INFO SLF4JLogging - hello logging */ diff --git a/validating/SimpleDebugging.java b/validating/SimpleDebugging.java index 476dcb9d..7dd9a1eb 100644 --- a/validating/SimpleDebugging.java +++ b/validating/SimpleDebugging.java @@ -30,8 +30,8 @@ In foo3 ___[ Error Output ]___ Exception in thread "main" java.lang.ArithmeticException: / by zero - at SimpleDebugging.foo3(SimpleDebugging.java:16) - at SimpleDebugging.foo2(SimpleDebugging.java:10) - at SimpleDebugging.foo1(SimpleDebugging.java:6) - at SimpleDebugging.main(SimpleDebugging.java:19) + at SimpleDebugging.foo3(SimpleDebugging.java:17) + at SimpleDebugging.foo2(SimpleDebugging.java:11) + at SimpleDebugging.foo1(SimpleDebugging.java:7) + at SimpleDebugging.main(SimpleDebugging.java:20) */