NeuronRobotics / nrjavaserial

A Java Serial Port system. This is a fork of the RXTX project that uses in jar loading of the native code.
Other
344 stars 142 forks source link

Apply formatting and remove more trace statements #209

Open MrDOS opened 3 years ago

MrDOS commented 3 years ago

This PR applies formatting (via Spotless) to the Java source code using the Eclipse JDT default formatting. Now that I see the magnitude of the changeset, I think I'm going to make some tweaks to the formatting rules to try to minimize the changes. Placing opening braces on a new line and not rewrapping lines which are already shorter than the line length limit would drastically cut down on the number of changes, I think, and it turns out I do care more than I thought I did about the wrapping of multiple arguments. I don't like the way it wraps only some of the arguments:

- something = foo(one, two, three);
+ something = foo(one, two,
    three);

or worse, rewraps only a few of the arguments onto the first line, and leaves the rest hanging:

- something = foo(one,
-   two,
-   three);
+ something = foo(one, two,
    three);

I did also try applying the Eclipse CDT formatter to the C source, and was pretty disappointed with the results. Again, mostly over unnecessary re-wrapping of lines.