Error: Could not find or load main class Files\openjfx-14.0.1_windows-x64_bin-sdk\javafx-sdk-14.0.1\lib
Caused by: java.lang.ClassNotFoundException: Files\openjfx-14.0.1_windows-x64_bin-sdk\javafx-sdk-14.0.1\lib
[ERROR] Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.3:run (default-cli) on project hellofx: Error: Output directory is empty, compile first -> [Help 1]
HelloFX.java:1: error: package javafx.application does not exist
HelloFX.java:2: error: package javafx.scene does not exist
HelloFX.java:3: error: package javafx.scene.control does not exist
HelloFX.java:4: error: package javafx.scene.layout does not exist
HelloFX.java:5: error: package javafx.stage does not exist
AverageInts.java:40: error: incompatible types: possible lossy conversion from double to float
For Mac OS X. The default installation directory is /Library/Frameworks/JavaFX.framework/Versions/ version-number.
Junilu Lacar wrote:
Ok, now that you've seen what wonders Extract Method can do for your code's readability, what expression(s) can you extract from the section of your code quoted below to make it more readable? Hint: an intention-revealing name such as isOutOfBounds() is almost always better than a comment. Comments tend to get ignored whereas you always pay attention to a method name.
You'll probably go for the easy win and extract the conditional expressions of the if statements but see what you can do to clarify and generalize the intent of the statements inside the if statements because those look like they could use a little DRYing out.
Junilu Lacar wrote:You probably tried to just reference N directly, right? Did you try perc.N? If you keep the N name, that might be a compelling reason to provide a better-named accessor like getSize() or getGridSize(), even if it only just returns the value of N directly.
Edit: I was looking at your use of getN() again and realized that you don't even need access to N. Just print out GRID_SIZE -- that should be the same as N anyway. If it isn't, then you'd have a bug.
Junilu Lacar wrote:I noticed that you are doing bounds checking in a private method. Bounds checking should be done in methods that are part of the class API, that is, any method that can be called by someone else and you have no way of controlling the validity of the values being passed in. There should be no need to do bounds checking in private methods since you have control over the calls made to it. If an exception occurs because out of bounds values have been passed to a private method, that's either a bug or a lack of bounds checking in the calling method.