Skip to content

Commit ca25b1a

Browse files
author
Bruce Eckel
committed
Update to test CI with James
1 parent 82cd990 commit ca25b1a

File tree

200 files changed

+1461
-5664
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+1461
-5664
lines changed

annotations/database/Member.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ public class Member {
1111
@SQLInteger Integer age;
1212
@SQLString(value = 30,
1313
constraints = @Constraints(primaryKey = true))
14-
String handle;
14+
String reference;
1515
static int memberCount;
16-
public String getHandle() { return handle; }
16+
public String getReference() { return reference; }
1717
public String getFirstName() { return firstName; }
1818
public String getLastName() { return lastName; }
1919
@Override
20-
public String toString() { return handle; }
20+
public String toString() { return reference; }
2121
public Integer getAge() { return age; }
2222
}

arrays/TestCount.java

Lines changed: 56 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,82 +15,106 @@ public static void main(String[] args) {
1515
Boolean[] a1 = new Boolean[SZ];
1616
Arrays.setAll(a1, new Count.Boolean()::get);
1717
show(a1);
18-
show(Stream.generate(new Count.Boolean())
19-
.limit(SZ + 1).toArray());
20-
show(new Count.Boolean().array(SZ + 2));
21-
show(new Count.boolean_().array(SZ + 3));
18+
a1 = Stream.generate(new Count.Boolean())
19+
.limit(SZ + 1).toArray(Boolean[]::new);
20+
show(a1);
21+
a1 = new Count.Boolean().array(SZ + 2);
22+
show(a1);
23+
boolean[] a1b = new Count.boolean_().array(SZ + 3);
24+
show(a1b);
2225

2326
System.out.println("Byte");
2427
Byte[] a2 = new Byte[SZ];
2528
Arrays.setAll(a2, new Count.Byte()::get);
2629
show(a2);
27-
show(Stream.generate(new Count.Byte())
28-
.limit(SZ + 1).toArray());
29-
show(new Count.Byte().array(SZ + 2));
30-
show(new Count.byte_().array(SZ + 3));
30+
a2 = Stream.generate(new Count.Byte())
31+
.limit(SZ + 1).toArray(Byte[]::new);
32+
show(a2);
33+
a2 = new Count.Byte().array(SZ + 2);
34+
show(a2);
35+
byte[] a2b = new Count.byte_().array(SZ + 3);
36+
show(a2b);
3137

3238
System.out.println("Character");
3339
Character[] a3 = new Character[SZ];
3440
Arrays.setAll(a3, new Count.Character()::get);
3541
show(a3);
36-
show(Stream.generate(new Count.Character())
37-
.limit(SZ + 1).toArray());
38-
show(new Count.Character().array(SZ + 2));
39-
show(new Count.char_().array(SZ + 3));
42+
a3 = Stream.generate(new Count.Character())
43+
.limit(SZ + 1).toArray(Character[]::new);
44+
show(a3);
45+
a3 = new Count.Character().array(SZ + 2);
46+
show(a3);
47+
char[] a3b = new Count.char_().array(SZ + 3);
48+
show(a3b);
4049

4150
System.out.println("Short");
4251
Short[] a4 = new Short[SZ];
4352
Arrays.setAll(a4, new Count.Short()::get);
4453
show(a4);
45-
show(Stream.generate(new Count.Short())
46-
.limit(SZ + 1).toArray());
47-
show(new Count.Short().array(SZ + 2));
48-
show(new Count.short_().array(SZ + 3));
54+
a4 = Stream.generate(new Count.Short())
55+
.limit(SZ + 1).toArray(Short[]::new);
56+
show(a4);
57+
a4 = new Count.Short().array(SZ + 2);
58+
show(a4);
59+
short[] a4b = new Count.short_().array(SZ + 3);
60+
show(a4b);
4961

5062
System.out.println("Integer");
5163
int[] a5 = new int[SZ];
5264
Arrays.setAll(a5, new Count.Integer()::get);
5365
show(a5);
54-
show(Stream.generate(new Count.Integer())
55-
.limit(SZ + 1).toArray());
56-
show(new Count.Integer().array(SZ + 2));
66+
Integer[] a5b = Stream.generate(new Count.Integer())
67+
.limit(SZ + 1).toArray(Integer[]::new);
68+
show(a5b);
69+
a5b = new Count.Integer().array(SZ + 2);
70+
show(a5b);
5771
a5 = IntStream.generate(new Count.int_())
5872
.limit(SZ + 1).toArray();
5973
show(a5);
60-
show(new Count.int_().array(SZ + 3));
74+
a5 = new Count.int_().array(SZ + 3);
75+
show(a5);
6176

6277
System.out.println("Long");
6378
long[] a6 = new long[SZ];
6479
Arrays.setAll(a6, new Count.Long()::get);
6580
show(a6);
66-
show(Stream.generate(new Count.Long())
67-
.limit(SZ + 1).toArray());
68-
show(new Count.Long().array(SZ + 2));
81+
Long[] a6b = Stream.generate(new Count.Long())
82+
.limit(SZ + 1).toArray(Long[]::new);
83+
show(a6b);
84+
a6b = new Count.Long().array(SZ + 2);
85+
show(a6b);
6986
a6 = LongStream.generate(new Count.long_())
7087
.limit(SZ + 1).toArray();
7188
show(a6);
72-
show(new Count.long_().array(SZ + 3));
89+
a6 = new Count.long_().array(SZ + 3);
90+
show(a6);
7391

7492
System.out.println("Float");
7593
Float[] a7 = new Float[SZ];
7694
Arrays.setAll(a7, new Count.Float()::get);
7795
show(a7);
78-
show(Stream.generate(new Count.Float())
79-
.limit(SZ + 1).toArray());
80-
show(new Count.Float().array(SZ + 2));
81-
show(new Count.float_().array(SZ + 3));
96+
a7 = Stream.generate(new Count.Float())
97+
.limit(SZ + 1).toArray(Float[]::new);
98+
show(a7);
99+
a7 = new Count.Float().array(SZ + 2);
100+
show(a7);
101+
float[] a7b = new Count.float_().array(SZ + 3);
102+
show(a7b);
82103

83104
System.out.println("Double");
84105
double[] a8 = new double[SZ];
85106
Arrays.setAll(a8, new Count.Double()::get);
86107
show(a8);
87-
show(Stream.generate(new Count.Double())
88-
.limit(SZ + 1).toArray());
89-
show(new Count.Double().array(SZ + 2));
108+
Double[] a8b = Stream.generate(new Count.Double())
109+
.limit(SZ + 1).toArray(Double[]::new);
110+
show(a8b);
111+
a8b = new Count.Double().array(SZ + 2);
112+
show(a8b);
90113
a8 = DoubleStream.generate(new Count.double_())
91114
.limit(SZ + 1).toArray();
92115
show(a8);
93-
show(new Count.double_().array(SZ + 3));
116+
a8 = new Count.double_().array(SZ + 3);
117+
show(a8);
94118
}
95119
}
96120
/* Output:

arrays/TestRand.java

Lines changed: 67 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,96 +15,124 @@ public static void main(String[] args) {
1515
Boolean[] a1 = new Boolean[SZ];
1616
Arrays.setAll(a1, new Rand.Boolean()::get);
1717
show(a1);
18-
show(Stream.generate(new Rand.Boolean())
19-
.limit(SZ + 1).toArray());
20-
show(new Rand.Boolean().array(SZ + 2));
21-
show(new Rand.boolean_().array(SZ + 3));
18+
a1 = Stream.generate(new Rand.Boolean())
19+
.limit(SZ + 1).toArray(Boolean[]::new);
20+
show(a1);
21+
a1 = new Rand.Boolean().array(SZ + 2);
22+
show(a1);
23+
boolean[] a1b = new Rand.boolean_().array(SZ + 3);
24+
show(a1b);
2225

2326
System.out.println("Byte");
2427
Byte[] a2 = new Byte[SZ];
2528
Arrays.setAll(a2, new Rand.Byte()::get);
2629
show(a2);
27-
show(Stream.generate(new Rand.Byte())
28-
.limit(SZ + 1).toArray());
29-
show(new Rand.Byte().array(SZ + 2));
30-
show(new Rand.byte_().array(SZ + 3));
30+
a2 = Stream.generate(new Rand.Byte())
31+
.limit(SZ + 1).toArray(Byte[]::new);
32+
show(a2);
33+
a2 = new Rand.Byte().array(SZ + 2);
34+
show(a2);
35+
byte[] a2b = new Rand.byte_().array(SZ + 3);
36+
show(a2b);
3137

3238
System.out.println("Character");
3339
Character[] a3 = new Character[SZ];
3440
Arrays.setAll(a3, new Rand.Character()::get);
3541
show(a3);
36-
show(Stream.generate(new Rand.Character())
37-
.limit(SZ + 1).toArray());
38-
show(new Rand.Character().array(SZ + 2));
39-
show(new Rand.char_().array(SZ + 3));
42+
a3 = Stream.generate(new Rand.Character())
43+
.limit(SZ + 1).toArray(Character[]::new);
44+
show(a3);
45+
a3 = new Rand.Character().array(SZ + 2);
46+
show(a3);
47+
char[] a3b = new Rand.char_().array(SZ + 3);
48+
show(a3b);
4049

4150
System.out.println("Short");
4251
Short[] a4 = new Short[SZ];
4352
Arrays.setAll(a4, new Rand.Short()::get);
4453
show(a4);
45-
show(Stream.generate(new Rand.Short())
46-
.limit(SZ + 1).toArray());
47-
show(new Rand.Short().array(SZ + 2));
48-
show(new Rand.short_().array(SZ + 3));
54+
a4 = Stream.generate(new Rand.Short())
55+
.limit(SZ + 1).toArray(Short[]::new);
56+
show(a4);
57+
a4 = new Rand.Short().array(SZ + 2);
58+
show(a4);
59+
short[] a4b = new Rand.short_().array(SZ + 3);
60+
show(a4b);
4961

5062
System.out.println("Integer");
5163
int[] a5 = new int[SZ];
5264
Arrays.setAll(a5, new Rand.Integer()::get);
5365
show(a5);
54-
show(Stream.generate(new Rand.Integer())
55-
.limit(SZ + 1).toArray());
56-
show(new Rand.Integer().array(SZ + 2));
66+
Integer[] a5b = Stream.generate(new Rand.Integer())
67+
.limit(SZ + 1).toArray(Integer[]::new);
68+
show(a5b);
69+
a5b = new Rand.Integer().array(SZ + 2);
70+
show(a5b);
5771
a5 = IntStream.generate(new Rand.int_())
5872
.limit(SZ + 1).toArray();
5973
show(a5);
60-
show(new Rand.int_().array(SZ + 3));
74+
a5 = new Rand.int_().array(SZ + 3);
75+
show(a5);
6176

6277
System.out.println("Long");
6378
long[] a6 = new long[SZ];
6479
Arrays.setAll(a6, new Rand.Long()::get);
6580
show(a6);
66-
show(Stream.generate(new Rand.Long())
67-
.limit(SZ + 1).toArray());
68-
show(new Rand.Long().array(SZ + 2));
81+
Long[] a6b = Stream.generate(new Rand.Long())
82+
.limit(SZ + 1).toArray(Long[]::new);
83+
show(a6b);
84+
a6b = new Rand.Long().array(SZ + 2);
85+
show(a6b);
6986
a6 = LongStream.generate(new Rand.long_())
7087
.limit(SZ + 1).toArray();
7188
show(a6);
72-
show(new Rand.long_().array(SZ + 3));
89+
a6 = new Rand.long_().array(SZ + 3);
90+
show(a6);
7391

7492
System.out.println("Float");
7593
Float[] a7 = new Float[SZ];
7694
Arrays.setAll(a7, new Rand.Float()::get);
7795
show(a7);
78-
show(Stream.generate(new Rand.Float())
79-
.limit(SZ + 1).toArray());
80-
show(new Rand.Float().array(SZ + 2));
81-
show(new Rand.float_().array(SZ + 3));
96+
a7 = Stream.generate(new Rand.Float())
97+
.limit(SZ + 1).toArray(Float[]::new);
98+
show(a7);
99+
a7 = new Rand.Float().array(SZ + 2);
100+
show(a7);
101+
float[] a7b = new Rand.float_().array(SZ + 3);
102+
show(a7b);
82103

83104
System.out.println("Double");
84105
double[] a8 = new double[SZ];
85106
Arrays.setAll(a8, new Rand.Double()::get);
86107
show(a8);
87-
show(Stream.generate(new Rand.Double())
88-
.limit(SZ + 1).toArray());
89-
show(new Rand.Double().array(SZ + 2));
108+
Double[] a8b = Stream.generate(new Rand.Double())
109+
.limit(SZ + 1).toArray(Double[]::new);
110+
show(a8b);
111+
a8b = new Rand.Double().array(SZ + 2);
112+
show(a8b);
90113
a8 = DoubleStream.generate(new Rand.double_())
91-
.limit(SZ + 2).toArray();
114+
.limit(SZ + 1).toArray();
115+
show(a8);
116+
a8 = new Rand.double_().array(SZ + 3);
92117
show(a8);
93-
show(new Rand.double_().array(SZ + 3));
94118

95119
System.out.println("String");
96120
String[] s = new String[SZ - 1];
97121
Arrays.setAll(s, new Rand.String()::get);
98122
show(s);
99-
show(Stream.generate(new Rand.String())
100-
.limit(SZ).toArray());
101-
show(new Rand.String().array(SZ + 1));
123+
s = Stream.generate(new Rand.String())
124+
.limit(SZ).toArray(String[]::new);
125+
show(s);
126+
s = new Rand.String().array(SZ + 1);
127+
show(s);
102128

103129
Arrays.setAll(s, new Rand.String(4)::get);
104130
show(s);
105-
show(Stream.generate(new Rand.String(4))
106-
.limit(SZ).toArray());
107-
show(new Rand.String(4).array(SZ + 1));
131+
s = Stream.generate(new Rand.String(4))
132+
.limit(SZ).toArray(String[]::new);
133+
show(s);
134+
s = new Rand.String(4).array(SZ + 1);
135+
show(s);
108136
}
109137
}
110138
/* Output:

build.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@
4242
files/build.xml
4343
enums/build.xml
4444
annotations/build.xml
45-
tasks/build.xml
46-
ui/build.xml
47-
swt/build.xml
45+
threads/build.xml
4846
patterns/build.xml
4947
unittesting/build.xml
5048
assertions/build.xml
@@ -86,7 +84,7 @@
8684
files/build.xml
8785
enums/build.xml
8886
annotations/build.xml
89-
tasks/build.xml
87+
threads/build.xml
9088
patterns/build.xml
9189
unittesting/build.xml
9290
assertions/build.xml

collections/StackCollision.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public static void main(String[] args) {
88
onjava.Stack<String> stack = new onjava.Stack<>();
99
for(String s : "My dog has fleas".split(" "))
1010
stack.push(s);
11-
while(!stack.empty())
11+
while(!stack.isEmpty())
1212
System.out.print(stack.pop() + " ");
1313
System.out.println();
1414
java.util.Stack<String> stack2 =

collections/StackTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
// (c)2016 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
5-
import onjava.*;
5+
import java.util.*;
66

77
public class StackTest {
88
public static void main(String[] args) {
9-
Stack<String> stack = new Stack<>();
9+
Deque<String> stack = new ArrayDeque<>();
1010
for(String s : "My dog has fleas".split(" "))
1111
stack.push(s);
12-
while(!stack.empty())
12+
while(!stack.isEmpty())
1313
System.out.print(stack.pop() + " ");
1414
}
1515
}

collections/StackTest2.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// collections/StackTest2.java
2+
// (c)2016 MindView LLC: see Copyright.txt
3+
// We make no guarantees that this code is fit for any purpose.
4+
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
5+
import onjava.*;
6+
7+
public class StackTest2 {
8+
public static void main(String[] args) {
9+
Stack<String> stack = new Stack<>();
10+
for(String s : "My dog has fleas".split(" "))
11+
stack.push(s);
12+
while(!stack.isEmpty())
13+
System.out.print(stack.pop() + " ");
14+
}
15+
}
16+
/* Output:
17+
fleas has dog My
18+
*/

0 commit comments

Comments
 (0)