Comment spell corrections

This commit is contained in:
Bruce Eckel 2017-05-15 16:15:22 -06:00
parent 0c6fc300f7
commit bf96ac6851
7 changed files with 7 additions and 8 deletions

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// A stack built on a linkedList
// A stack built on a LinkedList
package annotations;
import java.util.*;

View File

@ -8,7 +8,7 @@ public class ArrayOfGenericType<T> {
@SuppressWarnings("unchecked")
public ArrayOfGenericType(int size) {
// error: generic array creation:
// - array = new T[size];
//- array = new T[size];
array = (T[])new Object[size]; // unchecked cast
}
// error: generic array creation:

View File

@ -12,7 +12,7 @@ public class ArrayOfGenerics {
ls = (List<String>[])la; // Unchecked cast
ls[0] = new ArrayList<>();
// -ls[1] = new ArrayList<Integer>();
//- ls[1] = new ArrayList<Integer>();
// error: incompatible types: ArrayList<Integer>
// cannot be converted to List<String>
// ls[1] = new ArrayList<Integer>();

View File

@ -32,7 +32,7 @@ public class ListOps {
b = a.isEmpty(); // Any elements inside?
it = a.iterator(); // Ordinary Iterator
lit = a.listIterator(); // ListIterator
lit = a.listIterator(3); // Start at loc 3
lit = a.listIterator(3); // Start at location 3
i = a.lastIndexOf("1"); // Last match
a.remove(1); // Remove location 1
a.remove("3"); // Remove this object

View File

@ -57,7 +57,7 @@ public interface ConvertTo {
static Boolean[] boxed(boolean[] in) {
Boolean[] result = new Boolean[in.length];
for(int i = 0; i < in.length; i++)
result[i] = in[i]; // Autboxing
result[i] = in[i]; // Autoboxing
return result;
}
static Character[] boxed(char[] in) {

View File

@ -53,7 +53,7 @@ public class ClassNameFinder {
case 11: // INTERFACE_METHOD_REF
case 12: // NAME_AND_TYPE
case 18: // Invoke Dynamic
data.readInt(); // discard 4 bytes;
data.readInt(); // discard 4 bytes
break;
case 15: // Method Handle
data.readByte();
@ -86,7 +86,6 @@ public class ClassNameFinder {
// Walk the entire tree:
Files.walk(Paths.get("."))
.filter(matcher::matches)
//.peek(System.out::println)
.map(p -> {
try {
return thisClass(Files.readAllBytes(p));

View File

@ -11,7 +11,7 @@ public class CircularQueueTest {
private int i = 0;
@BeforeEach
public void initialize() {
while(i < 5) // Preload with some data
while(i < 5) // Pre-load with some data
queue.put(Integer.toString(i++));
}
// Support methods: