From 76a6ee26ca7409216766342b6dd19c84b022d6d3 Mon Sep 17 00:00:00 2001 From: Chris Mayfield Date: Sat, 30 Jan 2021 13:42:14 -0500 Subject: [PATCH 1/5] revised Checkstyle and Formatter --- Checkstyle.xml | 83 +++--- Formatter.xml | 704 +++++++++++++++++++++++++++---------------------- user.dict | 2 + 3 files changed, 442 insertions(+), 347 deletions(-) create mode 100644 user.dict diff --git a/Checkstyle.xml b/Checkstyle.xml index 6cf2192..6788535 100644 --- a/Checkstyle.xml +++ b/Checkstyle.xml @@ -1,85 +1,110 @@ + "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" + "https://checkstyle.org/dtds/configuration_1_3.dtd"> + - + - + - + + - + - + + + + + - - + + + - + - + - + - + + + + + + + + + + + + + + + + + + - + + + + - + - + + @@ -92,42 +117,38 @@ Checkstyle configuration for Think Java, 2nd Edition. - + - - + - + + + - - - + + - + diff --git a/Formatter.xml b/Formatter.xml index f97740d..a16cdb8 100644 --- a/Formatter.xml +++ b/Formatter.xml @@ -1,318 +1,390 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user.dict b/user.dict new file mode 100644 index 0000000..11b2406 --- /dev/null +++ b/user.dict @@ -0,0 +1,2 @@ +chris +mayfield From c215058330addb5206b3def6e1ad038058c72fdb Mon Sep 17 00:00:00 2001 From: Chris Mayfield Date: Sat, 30 Jan 2021 13:42:29 -0500 Subject: [PATCH 2/5] tidy up Ch15 --- ch15/Cell.java | 15 +++++++++++---- ch15/Conway.java | 5 +++-- ch15/GridCanvas.java | 9 +++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ch15/Cell.java b/ch15/Cell.java index d468b6d..5b6a0f9 100644 --- a/ch15/Cell.java +++ b/ch15/Cell.java @@ -3,6 +3,9 @@ /** * A square at a fixed location that changes color. + * + * @author Chris Mayfield + * @version 7.1.0 */ public class Cell { @@ -40,28 +43,32 @@ public void draw(Graphics g) { } /** - * @return true if the cell is OFF + * Tests whether the cell is off. + * + * @return true if the cell is off */ public boolean isOff() { return state == 0; } /** - * @return true if the cell is ON + * Tests whether the cell is on. + * + * @return true if the cell is on */ public boolean isOn() { return state == 1; } /** - * Sets the cell's state to OFF. + * Sets the cell's state to off. */ public void turnOff() { state = 0; } /** - * Sets the cell's state to ON. + * Sets the cell's state to on. */ public void turnOn() { state = 1; diff --git a/ch15/Conway.java b/ch15/Conway.java index 93faf28..5ac48c6 100644 --- a/ch15/Conway.java +++ b/ch15/Conway.java @@ -2,6 +2,9 @@ /** * Conway's Game of Life. + * + * @author Chris Mayfield + * @version 7.1.0 */ public class Conway { @@ -109,8 +112,6 @@ public void update() { /** * The simulation loop. - * - * @param rate frames per second */ private void mainloop() { while (true) { diff --git a/ch15/GridCanvas.java b/ch15/GridCanvas.java index c936135..3856a57 100644 --- a/ch15/GridCanvas.java +++ b/ch15/GridCanvas.java @@ -3,6 +3,9 @@ /** * 2D array of cells representing a rectangular grid. + * + * @author Chris Mayfield + * @version 7.1.0 */ public class GridCanvas extends Canvas { @@ -33,6 +36,8 @@ public GridCanvas(int rows, int cols, int size) { } /** + * Gets the number of rows. + * * @return number of rows */ public int numRows() { @@ -40,6 +45,8 @@ public int numRows() { } /** + * Gets the number of columns. + * * @return number of columns */ public int numCols() { @@ -47,6 +54,8 @@ public int numCols() { } /** + * Gets the cell at index (r, c). + * * @param r row index * @param c column index * @return the cell From a15b84d85862d0e3236fc0fe8655526a340b1856 Mon Sep 17 00:00:00 2001 From: Chris Mayfield Date: Fri, 20 Aug 2021 10:32:04 -0400 Subject: [PATCH 3/5] Checkstyle 8.44, Eclipse 2021-06 --- Checkstyle.xml | 3 ++- Formatter.xml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Checkstyle.xml b/Checkstyle.xml index 6788535..36dbd1f 100644 --- a/Checkstyle.xml +++ b/Checkstyle.xml @@ -4,7 +4,7 @@ "https://checkstyle.org/dtds/configuration_1_3.dtd"> @@ -82,6 +82,7 @@ Checkstyle configuration for Think Java, 2nd Edition. + diff --git a/Formatter.xml b/Formatter.xml index a16cdb8..ab6e68e 100644 --- a/Formatter.xml +++ b/Formatter.xml @@ -1,6 +1,6 @@ - - + + From bdb0b3d5dd367ff3387c7cdc602f11a6ac7c1e1b Mon Sep 17 00:00:00 2001 From: Jonathan Colmenares Date: Sat, 13 Feb 2021 14:36:50 -0500 Subject: [PATCH 4/5] slight structure cleanup --- .gitignore | 5 ++++- .idea/codeStyles/Project.xml | 6 ++++++ .idea/misc.xml | 8 ++++++++ .idea/modules.xml | 26 +++++++++++++------------- .idea/vcs.xml | 5 +++++ README.md | 4 ++-- appa/Appendix A.iml | 1 - appb/Appendix B.iml | 1 - appc/Appendix C.iml | 1 - appd/Appendix D.iml | 1 - ch01/Chapter 1.iml | 1 - ch02/Chapter 2.iml | 1 - ch03/Chapter 3.iml | 1 - ch04/Chapter 4.iml | 1 - ch05/Chapter 5.iml | 1 - ch06/Chapter 6.iml | 1 - ch07/Chapter 7.iml | 1 - ch08/Chapter 8.iml | 1 - ch09/Chapter 9.iml | 1 - ch10/Chapter 10.iml | 1 - ch11/Chapter 11.iml | 1 - ch12/Chapter 12.iml | 1 - ch13/Chapter 13.iml | 2 -- ch14/Chapter 14.iml | 1 - ch15/Chapter 15.iml | 1 - ch16/Chapter 16.iml | 1 - ch17/Chapter 17.iml | 1 - 27 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 .idea/misc.xml diff --git a/.gitignore b/.gitignore index a423ea9..e4e5f5d 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,9 @@ out/ *.tar.gz *.rar +# Libraries (Don't ignore) +!junit-platform-console-standalone-*.jar + # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* @@ -35,8 +38,8 @@ hs_err_pid* .idea/**/dictionaries .idea/**/shelf .idea/**/hotswap_agent.xml -.idea/**/misc.xml .idea/**/discord.xml +.idea/**/markdown-nav*.xml # IntelliJ generated files .idea/**/contentModel.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 7f7b294..5f74459 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,6 +1,12 @@