Skip to content

Commit 24032c3

Browse files
authored
Merge pull request #295 from cicirello/adopt-google-style
Adopted Google Java Style
2 parents 2e63a53 + e040273 commit 24032c3

File tree

117 files changed

+14168
-14275
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+14168
-14275
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Added
1010

1111
### Changed
12+
* Reformatted all sourcecode to [Google Java Style](https://google.github.io/styleguide/javaguide.html)
1213

1314
### Deprecated
1415

@@ -22,8 +23,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2223

2324
### CI/CD
2425
* Configured the [refactor-first-maven-plugin](https://github.com/jimbethancourt/RefactorFirst) within a profile in the pom.xml.
26+
* Configured [Spotify's fmt-maven-plugin](https://github.com/spotify/fmt-maven-plugin) to format to Google Java Style during builds.
2527

2628
### Other
29+
* Adopted [Google Java Style](https://google.github.io/styleguide/javaguide.html)
2730

2831

2932
## [4.3.0] - 2022-10-17

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ API documentation: https://jpt.cicirello.org/api
1515
| __JaCoCo Test Coverage__ | [![coverage](https://raw.githubusercontent.com/cicirello/JavaPermutationTools/badges/jacoco.svg)](https://github.com/cicirello/JavaPermutationTools/actions/workflows/build.yml) [![branch coverage](https://raw.githubusercontent.com/cicirello/JavaPermutationTools/badges/branches.svg)](https://github.com/cicirello/JavaPermutationTools/actions/workflows/build.yml) |
1616
| __Security__ | [![Snyk security score](https://snyk-widget.herokuapp.com/badge/mvn/org.cicirello/jpt/badge.svg)](https://snyk.io/vuln/maven%3Aorg.cicirello%3Ajpt) [![Snyk Known Vulnerabilities](https://snyk.io/test/github/cicirello/JavaPermutationTools/badge.svg)](https://snyk.io/test/github/cicirello/JavaPermutationTools) |
1717
| __DOI__ | [![DOI](https://zenodo.org/badge/139182095.svg)](https://zenodo.org/badge/latestdoi/139182095) |
18-
| __License__ | [![GitHub](https://img.shields.io/github/license/cicirello/JavaPermutationTools)](https://github.com/cicirello/JavaPermutationTools/blob/master/LICENSE) |
18+
| __Other Information__ | [![GitHub](https://img.shields.io/github/license/cicirello/JavaPermutationTools)](https://github.com/cicirello/JavaPermutationTools/blob/master/LICENSE) [![style](https://img.shields.io/badge/style-Google%20Java%20Style-informational)](https://google.github.io/styleguide/javaguide.html) |
1919
| __Support__ | [![GitHub Sponsors](https://img.shields.io/badge/sponsor-30363D?logo=GitHub-Sponsors&logoColor=#EA4AAA)](https://github.com/sponsors/cicirello) [![Liberapay](https://img.shields.io/badge/Liberapay-F6C915?logo=liberapay&logoColor=black)](https://liberapay.com/cicirello) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?logo=ko-fi&logoColor=white)](https://ko-fi.com/cicirello) |
2020

2121
## How to Cite

pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,18 @@
314314
</execution>
315315
</executions>
316316
</plugin>
317+
<plugin>
318+
<groupId>com.spotify.fmt</groupId>
319+
<artifactId>fmt-maven-plugin</artifactId>
320+
<version>2.19</version>
321+
<executions>
322+
<execution>
323+
<goals>
324+
<goal>format</goal>
325+
</goals>
326+
</execution>
327+
</executions>
328+
</plugin>
317329
</plugins>
318330
</build>
319331
</project>

src/main/java/module-info.java

Lines changed: 79 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
* JavaPermutationTools - A Java library for computation on permutations.
33
* Copyright 2005-2022 Vincent A. Cicirello, <https://www.cicirello.org/>.
44
*
5-
* JavaPermutationTools is free software: you can
6-
* redistribute it and/or modify it under the terms of the GNU
7-
* General Public License as published by the Free Software
8-
* Foundation, either version 3 of the License, or (at your
5+
* JavaPermutationTools is free software: you can
6+
* redistribute it and/or modify it under the terms of the GNU
7+
* General Public License as published by the Free Software
8+
* Foundation, either version 3 of the License, or (at your
99
* option) any later version.
1010
*
11-
* JavaPermutationTools is distributed in the hope
12-
* that it will be useful, but WITHOUT ANY WARRANTY; without even
13-
* the implied warranty of MERCHANTABILITY or FITNESS FOR A
14-
* PARTICULAR PURPOSE. See the GNU General Public License for more
11+
* JavaPermutationTools is distributed in the hope
12+
* that it will be useful, but WITHOUT ANY WARRANTY; without even
13+
* the implied warranty of MERCHANTABILITY or FITNESS FOR A
14+
* PARTICULAR PURPOSE. See the GNU General Public License for more
1515
* details.
1616
*
1717
* You should have received a copy of the GNU General Public License
@@ -20,82 +20,90 @@
2020
*/
2121

2222
/**
23+
*
24+
*
2325
* <h2>JavaPermutationTools - A Java library for computation on permutations</h2>
2426
*
25-
* <p>Copyright &copy; 2005-2022 <a href="https://www.cicirello.org/" target=_top>Vincent A. Cicirello</a>.</p>
26-
*
27-
* <p><a href="https://doi.org/10.21105/joss.00950"><img
28-
* src="http://joss.theoj.org/papers/10.21105/joss.00950/status.svg"
29-
* alt="DOI:10.21105/joss.00950" height="20" width="168"></a>
30-
* <a href="https://search.maven.org/artifact/org.cicirello/jpt"><img
31-
* src="https://img.shields.io/maven-central/v/org.cicirello/jpt.svg?logo=apachemaven"
32-
* alt="Maven Central" height="20" width="153"></a>
33-
* <a href="https://github.com/cicirello/JavaPermutationTools/releases"><img
34-
* src="https://img.shields.io/github/v/release/cicirello/JavaPermutationTools?logo=GitHub"
35-
* alt="GitHub release (latest by date)" height="20" width="111"></a>
36-
* <a href="https://github.com/cicirello/JavaPermutationTools"><img
37-
* src="https://jpt.cicirello.org/images/GitHub.svg"
38-
* alt="GitHub Repository" width="68" height="20"></a>
39-
* <a href="https://github.com/cicirello/JavaPermutationTools/blob/master/LICENSE"><img
40-
* src="https://img.shields.io/github/license/cicirello/JavaPermutationTools"
41-
* alt="GNU General Public License Version 3 (GPLv3)" height="20" width="102"></a>
42-
* </p>
27+
* <p>Copyright &copy; 2005-2022 <a href="https://www.cicirello.org/" target=_top>Vincent A.
28+
* Cicirello</a>.
29+
*
30+
* <p><a href="https://doi.org/10.21105/joss.00950"><img
31+
* src="http://joss.theoj.org/papers/10.21105/joss.00950/status.svg" alt="DOI:10.21105/joss.00950"
32+
* height="20" width="168"></a> <a href="https://search.maven.org/artifact/org.cicirello/jpt"><img
33+
* src="https://img.shields.io/maven-central/v/org.cicirello/jpt.svg?logo=apachemaven" alt="Maven
34+
* Central" height="20" width="153"></a> <a
35+
* href="https://github.com/cicirello/JavaPermutationTools/releases"><img
36+
* src="https://img.shields.io/github/v/release/cicirello/JavaPermutationTools?logo=GitHub"
37+
* alt="GitHub release (latest by date)" height="20" width="111"></a> <a
38+
* href="https://github.com/cicirello/JavaPermutationTools"><img
39+
* src="https://jpt.cicirello.org/images/GitHub.svg" alt="GitHub Repository" width="68"
40+
* height="20"></a> <a
41+
* href="https://github.com/cicirello/JavaPermutationTools/blob/master/LICENSE"><img
42+
* src="https://img.shields.io/github/license/cicirello/JavaPermutationTools" alt="GNU General
43+
* Public License Version 3 (GPLv3)" height="20" width="102"></a>
4344
*
4445
* <h3>About the JavaPermutationTools Library</h3>
45-
*
46-
* <p>JavaPermutationTools (JPT) is a Java library for representing and generating permutations
47-
* and sequences, as well as performing computation on permutations and sequences. This includes
48-
* implementations of a variety of permutation distance metrics as well as distance metrics on
49-
* sequences (i.e., Strings, arrays, and other ordered data types).</p>
50-
*
51-
* <p>The <a href="https://github.com/cicirello/JavaPermutationTools" target=_top>source code</a>
52-
* is hosted on GitHub; and is licensed under the
53-
* <a href="https://www.gnu.org/licenses/gpl-3.0.html" target=_top>GNU General Public License
54-
* Version 3 (GPLv3)</a>. The library's jar files are regularly published
55-
* to <a href="https://search.maven.org/artifact/org.cicirello/jpt" target=_top>Maven Central</a>,
56-
* from which it is easily imported into software projects using Maven and other
57-
* commonly used build tools. Additionally, there is a
58-
* GitHub <a href="https://github.com/cicirello/jpt-examples" target=_top>repository of
59-
* example programs</a> that show basic usage of the JPT library, as well as replication programs that
60-
* reproduce results found in published papers.</p>
61-
*
62-
* <p>For more information see the <a href="https://jpt.cicirello.org/" target=_top>JavaPermutationTools
63-
* website</a>. Potential contributors, please see the source repository, and/or
64-
* contact <a href="https://www.cicirello.org/" target=_top>Vincent A. Cicirello</a>.</p>
46+
*
47+
* <p>JavaPermutationTools (JPT) is a Java library for representing and generating permutations and
48+
* sequences, as well as performing computation on permutations and sequences. This includes
49+
* implementations of a variety of permutation distance metrics as well as distance metrics on
50+
* sequences (i.e., Strings, arrays, and other ordered data types).
51+
*
52+
* <p>The <a href="https://github.com/cicirello/JavaPermutationTools" target=_top>source code</a> is
53+
* hosted on GitHub; and is licensed under the <a href="https://www.gnu.org/licenses/gpl-3.0.html"
54+
* target=_top>GNU General Public License Version 3 (GPLv3)</a>. The library's jar files are
55+
* regularly published to <a href="https://search.maven.org/artifact/org.cicirello/jpt"
56+
* target=_top>Maven Central</a>, from which it is easily imported into software projects using
57+
* Maven and other commonly used build tools. Additionally, there is a GitHub <a
58+
* href="https://github.com/cicirello/jpt-examples" target=_top>repository of example programs</a>
59+
* that show basic usage of the JPT library, as well as replication programs that reproduce results
60+
* found in published papers.
61+
*
62+
* <p>For more information see the <a href="https://jpt.cicirello.org/"
63+
* target=_top>JavaPermutationTools website</a>. Potential contributors, please see the source
64+
* repository, and/or contact <a href="https://www.cicirello.org/" target=_top>Vincent A.
65+
* Cicirello</a>.
6566
*
6667
* <h3>How to Cite</h3>
6768
*
68-
* <p>If you use the JPT library in your research, please cite the following
69-
* article which describes the library:</p>
69+
* <p>If you use the JPT library in your research, please cite the following article which describes
70+
* the library:
71+
*
7072
* <ul>
71-
* <li>Vincent A. Cicirello.
72-
* <a href="https://www.cicirello.org/publications/cicirello2018joss.html">JavaPermutationTools: A Java Library of Permutation Distance Metrics</a>.
73-
* <i>Journal of Open Source Software</i>, 3(31), 950, November 2018.
74-
* <a href="https://www.cicirello.org/publications/cicirello2018joss.pdf">[PDF]</a> <a href="https://www.cicirello.org/publications/cicirello2018joss.bib">[BIB]</a> <a href="https://doi.org/10.21105/joss.00950">[DOI]</a></li>
73+
* <li>Vincent A. Cicirello. <a
74+
* href="https://www.cicirello.org/publications/cicirello2018joss.html">JavaPermutationTools:
75+
* A Java Library of Permutation Distance Metrics</a>. <i>Journal of Open Source Software</i>,
76+
* 3(31), 950, November 2018. <a
77+
* href="https://www.cicirello.org/publications/cicirello2018joss.pdf">[PDF]</a> <a
78+
* href="https://www.cicirello.org/publications/cicirello2018joss.bib">[BIB]</a> <a
79+
* href="https://doi.org/10.21105/joss.00950">[DOI]</a>
7580
* </ul>
7681
*
7782
* <h3>Support JavaPermutationTools</h3>
7883
*
79-
* <p><a href="https://github.com/sponsors/cicirello"><img src="https://jpt.cicirello.org/images/github-sponsors.svg" alt="GitHub Sponsors" width="107" height="28"></a>
80-
* <a href="https://liberapay.com/cicirello"><img src="https://jpt.cicirello.org/images/Liberapay.svg" alt="Liberapay" width="119" height="28"></a>
81-
* <a href="https://ko-fi.com/cicirello"><img src="https://jpt.cicirello.org/images/ko-fi.svg" alt="Ko-Fi" width="82" height="28"></a></p>
84+
* <p><a href="https://github.com/sponsors/cicirello"><img
85+
* src="https://jpt.cicirello.org/images/github-sponsors.svg" alt="GitHub Sponsors" width="107"
86+
* height="28"></a> <a href="https://liberapay.com/cicirello"><img
87+
* src="https://jpt.cicirello.org/images/Liberapay.svg" alt="Liberapay" width="119" height="28"></a>
88+
* <a href="https://ko-fi.com/cicirello"><img src="https://jpt.cicirello.org/images/ko-fi.svg"
89+
* alt="Ko-Fi" width="82" height="28"></a>
8290
*
83-
* @author <a href=https://www.cicirello.org/ target=_top>Vincent A. Cicirello</a>,
84-
* <a href=https://www.cicirello.org/ target=_top>https://www.cicirello.org/</a>
91+
* @author <a href=https://www.cicirello.org/ target=_top>Vincent A. Cicirello</a>, <a
92+
* href=https://www.cicirello.org/ target=_top>https://www.cicirello.org/</a>
8593
*/
8694
module org.cicirello.jpt {
87-
exports org.cicirello.permutations;
88-
exports org.cicirello.permutations.distance;
89-
exports org.cicirello.sequences;
90-
exports org.cicirello.sequences.distance;
91-
92-
// Specified transitive on these to minimize the impact
93-
// of the introduction of modules on users' existing code
94-
// that might assume access to the classes/interfaces from these
95-
// modules. Strictly speaking, these do not need to be transitive
96-
// for jpt because jpt's public interface does not depend on anything
97-
// in these (e.g., no objects of any classes from these modules are
98-
// returned or expected as parameters).
99-
requires transitive org.cicirello.rho_mu;
100-
requires transitive org.cicirello.core;
95+
exports org.cicirello.permutations;
96+
exports org.cicirello.permutations.distance;
97+
exports org.cicirello.sequences;
98+
exports org.cicirello.sequences.distance;
99+
100+
// Specified transitive on these to minimize the impact
101+
// of the introduction of modules on users' existing code
102+
// that might assume access to the classes/interfaces from these
103+
// modules. Strictly speaking, these do not need to be transitive
104+
// for jpt because jpt's public interface does not depend on anything
105+
// in these (e.g., no objects of any classes from these modules are
106+
// returned or expected as parameters).
107+
requires transitive org.cicirello.rho_mu;
108+
requires transitive org.cicirello.core;
101109
}

src/main/java/org/cicirello/permutations/IllegalPermutationStateException.java

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
*
55
* This file is part of JavaPermutationTools (https://jpt.cicirello.org/).
66
*
7-
* JavaPermutationTools is free software: you can
8-
* redistribute it and/or modify it under the terms of the GNU
9-
* General Public License as published by the Free Software
10-
* Foundation, either version 3 of the License, or (at your
7+
* JavaPermutationTools is free software: you can
8+
* redistribute it and/or modify it under the terms of the GNU
9+
* General Public License as published by the Free Software
10+
* Foundation, either version 3 of the License, or (at your
1111
* option) any later version.
1212
*
13-
* JavaPermutationTools is distributed in the hope
14-
* that it will be useful, but WITHOUT ANY WARRANTY; without even
15-
* the implied warranty of MERCHANTABILITY or FITNESS FOR A
16-
* PARTICULAR PURPOSE. See the GNU General Public License for more
13+
* JavaPermutationTools is distributed in the hope
14+
* that it will be useful, but WITHOUT ANY WARRANTY; without even
15+
* the implied warranty of MERCHANTABILITY or FITNESS FOR A
16+
* PARTICULAR PURPOSE. See the GNU General Public License for more
1717
* details.
1818
*
1919
* You should have received a copy of the GNU General Public License
@@ -23,30 +23,30 @@
2323

2424
/**
2525
* This is a {@link RuntimeException} that is thrown by certain methods of the {@link Permutation}
26-
* class to indicate that the Permutation object's state is invalid, and any subsequent calls
27-
* to methods on that object may be unpredictable.
26+
* class to indicate that the Permutation object's state is invalid, and any subsequent calls to
27+
* methods on that object may be unpredictable.
2828
*
29-
* @author <a href=https://www.cicirello.org/ target=_top>Vincent A. Cicirello</a>,
30-
* <a href=https://www.cicirello.org/ target=_top>https://www.cicirello.org/</a>
29+
* @author <a href=https://www.cicirello.org/ target=_top>Vincent A. Cicirello</a>, <a
30+
* href=https://www.cicirello.org/ target=_top>https://www.cicirello.org/</a>
3131
*/
3232
public class IllegalPermutationStateException extends RuntimeException {
33-
34-
/**
35-
* Construct an IllegalPermutationStateException without specifying a cause.
36-
*
37-
* @param message A descriptive message about the exception that is thrown.
38-
*/
39-
public IllegalPermutationStateException(String message) {
40-
super(message);
41-
}
42-
43-
/**
44-
* Construct an IllegalPermutationStateException.
45-
*
46-
* @param message A descriptive message about the exception that is thrown.
47-
* @param cause The cause of the exception.
48-
*/
49-
public IllegalPermutationStateException(String message, Throwable cause) {
50-
super(message, cause);
51-
}
33+
34+
/**
35+
* Construct an IllegalPermutationStateException without specifying a cause.
36+
*
37+
* @param message A descriptive message about the exception that is thrown.
38+
*/
39+
public IllegalPermutationStateException(String message) {
40+
super(message);
41+
}
42+
43+
/**
44+
* Construct an IllegalPermutationStateException.
45+
*
46+
* @param message A descriptive message about the exception that is thrown.
47+
* @param cause The cause of the exception.
48+
*/
49+
public IllegalPermutationStateException(String message, Throwable cause) {
50+
super(message, cause);
51+
}
5252
}

0 commit comments

Comments
 (0)