File tree Expand file tree Collapse file tree 7 files changed +7
-8
lines changed Expand file tree Collapse file tree 7 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 22// (c)2017 MindView LLC: see Copyright.txt
33// We make no guarantees that this code is fit for any purpose.
44// Visit http://OnJava8.com for more book information.
5- // A stack built on a linkedList
5+ // A stack built on a LinkedList
66package annotations ;
77import java .util .*;
88
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ public class ArrayOfGenericType<T> {
88 @ SuppressWarnings ("unchecked" )
99 public ArrayOfGenericType (int size ) {
1010 // error: generic array creation:
11- // - array = new T[size];
11+ //- array = new T[size];
1212 array = (T [])new Object [size ]; // unchecked cast
1313 }
1414 // error: generic array creation:
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public static void main(String[] args) {
1212 ls = (List <String >[])la ; // Unchecked cast
1313 ls [0 ] = new ArrayList <>();
1414
15- // - ls[1] = new ArrayList<Integer>();
15+ //- ls[1] = new ArrayList<Integer>();
1616 // error: incompatible types: ArrayList<Integer>
1717 // cannot be converted to List<String>
1818 // ls[1] = new ArrayList<Integer>();
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public static void basicTest(List<String> a) {
3232 b = a .isEmpty (); // Any elements inside?
3333 it = a .iterator (); // Ordinary Iterator
3434 lit = a .listIterator (); // ListIterator
35- lit = a .listIterator (3 ); // Start at loc 3
35+ lit = a .listIterator (3 ); // Start at location 3
3636 i = a .lastIndexOf ("1" ); // Last match
3737 a .remove (1 ); // Remove location 1
3838 a .remove ("3" ); // Remove this object
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ static double[] primitive(Double[] in) {
5757 static Boolean [] boxed (boolean [] in ) {
5858 Boolean [] result = new Boolean [in .length ];
5959 for (int i = 0 ; i < in .length ; i ++)
60- result [i ] = in [i ]; // Autboxing
60+ result [i ] = in [i ]; // Autoboxing
6161 return result ;
6262 }
6363 static Character [] boxed (char [] in ) {
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public static String thisClass(byte[] classBytes) {
5353 case 11 : // INTERFACE_METHOD_REF
5454 case 12 : // NAME_AND_TYPE
5555 case 18 : // Invoke Dynamic
56- data .readInt (); // discard 4 bytes;
56+ data .readInt (); // discard 4 bytes
5757 break ;
5858 case 15 : // Method Handle
5959 data .readByte ();
@@ -86,7 +86,6 @@ public static String thisClass(byte[] classBytes) {
8686 // Walk the entire tree:
8787 Files .walk (Paths .get ("." ))
8888 .filter (matcher ::matches )
89- //.peek(System.out::println)
9089 .map (p -> {
9190 try {
9291 return thisClass (Files .readAllBytes (p ));
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public class CircularQueueTest {
1111 private int i = 0 ;
1212 @ BeforeEach
1313 public void initialize () {
14- while (i < 5 ) // Preload with some data
14+ while (i < 5 ) // Pre-load with some data
1515 queue .put (Integer .toString (i ++));
1616 }
1717 // Support methods:
You can’t perform that action at this time.
0 commit comments