Skip to content

Commit 23d6e41

Browse files
committed
[CONJ-1112] code style validation change
library com.spotify.fmt:fmt-maven-plugin is not compatible with java 21, replaced by com.theoryinpractise:googleformatter-maven-plugin
1 parent 65c2f1e commit 23d6e41

File tree

74 files changed

+2205
-1937
lines changed

Some content is hidden

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

74 files changed

+2205
-1937
lines changed

CHANGELOG.md

Lines changed: 424 additions & 232 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,80 @@
11
# Contributing
22

3-
Each pull request should address a single issue, and contain both the fix and a description of how the pull request and tests that validate that the PR fixes the issue in question.
3+
Each pull request should address a single issue, and contain both the fix and a description of how the pull request and
4+
tests that validate that the PR fixes the issue in question.
45

5-
For significant feature additions, we like to have an open issue in [MariaDB JIRA](https://mariadb.atlassian.net/secure/RapidBoard.jspa?projectKey=CONJ). It is expected that discussion will have taken place in the attached issue.
6+
For significant feature additions, we like to have an open issue
7+
in [MariaDB JIRA](https://mariadb.atlassian.net/secure/RapidBoard.jspa?projectKey=CONJ). It is expected that discussion
8+
will have taken place in the attached issue.
69

710
# Install Prerequisites
811

9-
These are the set of tools which are required in order to complete any build. Follow the links to download and install them on your own before continuing.
12+
These are the set of tools which are required in order to complete any build. Follow the links to download and install
13+
them on your own before continuing.
1014

1115
* At least one GPG Key see https://help.github.com/en/articles/generating-a-new-gpg-key
12-
* [Oracle JDK 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html) ( with [JCE policies](http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html) if using TLS/SSL)
16+
* [Oracle JDK 8](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (
17+
with [JCE policies](http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html) if using
18+
TLS/SSL)
1319
* IDE (eclipse / netbean / intelliJ) with maven and GIT plugins
1420

1521
# Fork source
1622

17-
Before downloading source, fork the project to your own repository, and use your repository as source.
23+
Before downloading source, fork the project to your own repository, and use your repository as source.
1824

1925
## Branch signification
2026

2127
* master : correspond to the last released version
2228
* develop : Develop new features for upcoming releases (compatible with java 8)
23-
* develop-jre6 : maintenance branch compatible with java 6 / 7
29+
* develop-jre6 : maintenance branch compatible with java 6 / 7
2430

2531
# Run local test
2632

2733
Before any submission :
28-
Run the test locally : by default, you need to have a MySQL/MariaDB server on localhost:3306 with a database named "testj" and a user root without password.
29-
so you can run
30-
34+
Run the test locally : by default, you need to have a MySQL/MariaDB server on localhost:3306 with a database named "
35+
testj" and a user root without password.
36+
so you can run
37+
3138
```script
3239
mvn test
3340
```
34-
35-
You can change this parameter by adding -DdbUrl parameter. like :
36-
41+
42+
You can change this parameter by adding -DdbUrl parameter. like :
43+
3744
```script
3845
mvn test -DdbUrl=jdbc:mariadb://127.0.0.1:3306/testj?user=root&password=*****
3946
```
40-
47+
4148
You can launch a specific test by adding -Dtest
4249

4350
```script
4451
mvn test -Dtest=org.mariadb.jdbc.JdbcParserTest
4552
```
46-
53+
4754
When all test are passing, you can package project.
48-
Additional tests , like javadoc formatting, code style validation will be done :
49-
55+
Additional tests , like javadoc formatting, code style validation will be done :
56+
5057
```script
5158
mvn package -Dmaven.test.skip=true
5259
```
53-
60+
5461
If operation succeed, a new mariadb-java-client jar will be on the target folder.
55-
62+
5663
# Run travis test
57-
58-
You can activate travis to validate your repository.
59-
The advantage of travis compare to running test locally is that it will launch tests for a combination of those parameters :
64+
65+
You can activate travis to validate your repository.
66+
The advantage of travis compare to running test locally is that it will launch tests for a combination of those
67+
parameters :
6068

6169
jdk:
70+
6271
* oraclejdk8
63-
and if your work is on develop-jre6 branch
72+
and if your work is on develop-jre6 branch
6473
* openjdk6
6574
* openjdk7
6675

6776
server :
77+
6878
* MariaDB 5.5
6979
* MariaDB 10.0
7080
* MariaDB 10.1
@@ -73,17 +83,20 @@ server :
7383
* MySQL 5.7
7484

7585
max_allowed_packet : (this permit to check multipacket send)
86+
7687
* 8M
7788
* 20M
7889
* 40M
7990

80-
For that, you have to go on [travis website](https://travis-ci.org), connect with your github account, and activate your mariadb-connector-j repository.
81-
After this step, every push to your repository will launch a travis test.
91+
For that, you have to go on [travis website](https://travis-ci.org), connect with your github account, and activate your
92+
mariadb-connector-j repository.
93+
After this step, every push to your repository will launch a travis test.
8294

8395
## Submitting a request
8496

85-
When your repository has the correction/change done, you can submit a pull request by clicking the "Pull request" button on github.
86-
Please detail the operation done in your request.
97+
When your repository has the correction/change done, you can submit a pull request by clicking the "Pull request" button
98+
on github.
99+
Please detail the operation done in your request.
87100

88101
## License
89102

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
<p align="center">
1+
<p style="text-align: center;">
22
<a href="https://mariadb.com/">
3-
<img src="https://mariadb.com/kb/static/images/logo-2018-black.png">
3+
<img alt="mariadb logo" src="https://mariadb.com/kb/static/images/logo-2018-black.png">
44
</a>
55
</p>
66

77
# MariaDB java connector
88

9-
MariaDB java connector is a JDBC 4.2 compatible driver, used to connect applications developed in Java to MariaDB and MySQL databases. MariaDB Connector/J is LGPL licensed.
9+
MariaDB java connector is a JDBC 4.2 compatible driver, used to connect applications developed in Java to MariaDB and
10+
MySQL databases. MariaDB Connector/J is LGPL licensed.
1011

1112
Tracker link <a href="https://jira.mariadb.org/projects/CONJ/issues/">https://jira.mariadb.org/projects/CONJ/issues/</a>
1213

1314
## Status
15+
1416
[![Linux Build](https://travis-ci.com/mariadb-corporation/mariadb-connector-j.svg?branch=master)](https://app.travis-ci.com/github/mariadb-corporation/mariadb-connector-j)
1517
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.mariadb.jdbc/mariadb-java-client/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.mariadb.jdbc/mariadb-java-client)
1618
[![License (LGPL version 2.1)](https://img.shields.io/badge/license-GNU%20LGPL%20version%202.1-green.svg?style=flat-square)](http://opensource.org/licenses/LGPL-2.1)
@@ -21,7 +23,8 @@ Tracker link <a href="https://jira.mariadb.org/projects/CONJ/issues/">https://ji
2123
For java 8+ :
2224

2325
The driver (jar) can be downloaded from [mariadb connector download](https://mariadb.com/downloads/#connectors)
24-
or maven :
26+
or maven :
27+
2528
```script
2629
<dependency>
2730
<groupId>org.mariadb.jdbc</groupId>
@@ -30,8 +33,8 @@ or maven :
3033
</dependency>
3134
```
3235

33-
3436
Development snapshot are available on sonatype nexus repository
37+
3538
```script
3639
<repositories>
3740
<repository>
@@ -52,12 +55,13 @@ Development snapshot are available on sonatype nexus repository
5255

5356
## Documentation
5457

55-
For a Getting started guide, API docs, recipes, etc. see the
58+
For a Getting started guide, API docs, recipes, etc. see the
59+
5660
* [About MariaDB connector/J](https://mariadb.com/kb/en/about-mariadb-connector-j/)
5761
* [Install driver](https://mariadb.com/kb/en/installing-mariadb-connectorj/)
5862
* [Changelog](/CHANGELOG.md)
5963
* [Failover and high-availability](https://mariadb.com/kb/en/failover-and-high-availability-with-mariadb-connector-j/)
6064

61-
6265
[codecov-image]:https://codecov.io/gh/mariadb-corporation/mariadb-connector-j/branch/master/graph/badge.svg
66+
6367
[codecov-url]:https://codecov.io/gh/mariadb-corporation/mariadb-connector-j

pom.xml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,20 +231,30 @@
231231
</execution>
232232
</executions>
233233
</plugin>
234-
235234
<plugin>
236-
<groupId>com.spotify.fmt</groupId>
237-
<artifactId>fmt-maven-plugin</artifactId>
238-
<version>2.20</version>
235+
<groupId>com.theoryinpractise</groupId>
236+
<artifactId>googleformatter-maven-plugin</artifactId>
237+
<version>1.7.3</version>
239238
<executions>
240239
<execution>
240+
<id>reformat-sources</id>
241+
<configuration>
242+
<includeStale>false</includeStale>
243+
<style>GOOGLE</style>
244+
<formatMain>true</formatMain>
245+
<formatTest>true</formatTest>
246+
<filterModified>false</filterModified>
247+
<skip>false</skip>
248+
<fixImports>false</fixImports>
249+
<maxLineLength>100</maxLineLength>
250+
</configuration>
241251
<goals>
242252
<goal>format</goal>
243253
</goals>
254+
<phase>process-sources</phase>
244255
</execution>
245256
</executions>
246257
</plugin>
247-
248258
<plugin>
249259
<groupId>org.apache.maven.plugins</groupId>
250260
<artifactId>maven-surefire-plugin</artifactId>

src/benchmark/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
<p align="center">
1+
<p style="text-align: center;">
22
<a href="https://mariadb.com/">
3-
<img src="https://mariadb.com/kb/static/images/logo-2018-black.png">
3+
<img alt="mariadb logo" src="https://mariadb.com/kb/static/images/logo-2018-black.png">
44
</a>
55
</p>
66

77
# Benchmark
88

9-
How to run :
9+
How to run :
10+
1011
```script
1112
mvn clean package -P bench -DskipTests
1213
@@ -18,14 +19,16 @@ java -Duser.country=US -Duser.language=en -jar target/benchmarks.jar "Select_100
1819
```
1920

2021
Configuration by system properties :
22+
2123
* TEST_HOST: Hostname. default "localhost"
2224
* TEST_PORT: port. default 3306
2325
* TEST_USERNAME: user name. default "root"
2426
* TEST_PASSWORD: password. default ""
2527
* TEST_DATABASE: database. default "testj"
2628
* TEST_OTHER: permit adding connection string options. default ""
2729

28-
example:
30+
example:
31+
2932
```script
3033
mvn clean package -P bench -Dmaven.test.skip
3134
java -DTEST_PORT=3307 -Duser.country=US -Duser.language=en -jar target/benchmarks.jar "Select_100_cols"

src/benchmark/java/org/mariadb/jdbc/Common.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44

55
package org.mariadb.jdbc;
66

7-
import org.openjdk.jmh.annotations.*;
8-
97
import java.sql.Connection;
108
import java.sql.DriverManager;
119
import java.sql.SQLException;
1210
import java.sql.Statement;
1311
import java.util.Properties;
1412
import java.util.concurrent.TimeUnit;
13+
import org.openjdk.jmh.annotations.*;
1514

1615
@State(Scope.Benchmark)
1716
@Warmup(iterations = 10, timeUnit = TimeUnit.SECONDS, time = 1)

src/benchmark/java/org/mariadb/jdbc/Do_1.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111

1212
public class Do_1 extends Common {
1313

14-
@Benchmark
15-
public int run(MyState state) throws Throwable {
16-
try (Statement st = state.connectionText.createStatement()) {
17-
return st.executeUpdate("DO 1");
18-
}
14+
@Benchmark
15+
public int run(MyState state) throws Throwable {
16+
try (Statement st = state.connectionText.createStatement()) {
17+
return st.executeUpdate("DO 1");
1918
}
20-
19+
}
2120
}

src/benchmark/java/org/mariadb/jdbc/Do_1000_params.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44

55
package org.mariadb.jdbc;
66

7-
import org.openjdk.jmh.annotations.Benchmark;
8-
97
import java.sql.Connection;
108
import java.sql.PreparedStatement;
11-
import java.sql.ResultSet;
9+
import org.openjdk.jmh.annotations.Benchmark;
1210

1311
public class Do_1000_params extends Common {
1412

src/benchmark/java/org/mariadb/jdbc/Insert_batch.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@
44

55
package org.mariadb.jdbc;
66

7-
import org.openjdk.jmh.annotations.Benchmark;
8-
97
import java.sql.Connection;
108
import java.sql.PreparedStatement;
11-
import java.sql.ResultSet;
12-
import java.sql.Statement;
139
import java.util.ArrayList;
1410
import java.util.Arrays;
1511
import java.util.List;
12+
import org.openjdk.jmh.annotations.Benchmark;
1613

1714
public class Insert_batch extends Common {
1815

src/benchmark/java/org/mariadb/jdbc/Select_1.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55
package org.mariadb.jdbc;
66

7-
import org.openjdk.jmh.annotations.Benchmark;
8-
97
import java.sql.ResultSet;
108
import java.sql.Statement;
9+
import org.openjdk.jmh.annotations.Benchmark;
1110

1211
public class Select_1 extends Common {
1312

0 commit comments

Comments
 (0)