From 40afbb94dbab86215e4085163643848f8ea4b657 Mon Sep 17 00:00:00 2001 From: Nihal Jain Date: Wed, 6 Nov 2024 19:46:07 +0530 Subject: [PATCH 1/2] PHOENIX-7441 Integrate the Spotless plugin and update the code template - Update dev/PhoenixCodeTemplate.xml to use latest format as in hbase. - Copied license-header file from hbase, the one which phoenix was using was a little different - Fix file having misplaced package block as we do not want any manual code change in the commit where we run spotless --- dev/PhoenixCodeTemplate.xml | 724 ++++++++++-------- .../coprocessor/DelegateRegionScanner.java | 3 +- pom.xml | 114 +++ src/main/config/checkstyle/header.txt | 17 +- 4 files changed, 540 insertions(+), 318 deletions(-) diff --git a/dev/PhoenixCodeTemplate.xml b/dev/PhoenixCodeTemplate.xml index 318b30d9bff..993b616957d 100644 --- a/dev/PhoenixCodeTemplate.xml +++ b/dev/PhoenixCodeTemplate.xml @@ -1,312 +1,418 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionScanner.java b/phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionScanner.java index 3d742431914..3d562d57619 100644 --- a/phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionScanner.java +++ b/phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/DelegateRegionScanner.java @@ -14,7 +14,8 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */package org.apache.phoenix.coprocessor; + */ +package org.apache.phoenix.coprocessor; import java.io.IOException; import java.util.List; diff --git a/pom.xml b/pom.xml index 29786ee7bba..53738776290 100644 --- a/pom.xml +++ b/pom.xml @@ -168,6 +168,7 @@ 3.3.0 3.6.0 2.5.2.Final + 2.43.0 false @@ -700,6 +701,119 @@ true true + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + + + + **/generated/* + **/package-info.java + + + + Remove unhelpful javadoc stubs + (?m)^ *\* *@(?:param|throws|return) *\w* *\n + + + + + Purge single returns tag multi line + (?m)^ */\*\*\n *\* *@return *(.*) *\n *\*/$ + /** Returns $1 */ + + + Purge single returns tag single line + ^ */\*\* *@return *(.*) *\*/$ + /** Returns $1 */ + + + + ${session.executionRootDirectory}/dev/PhoenixCodeTemplate.xml + + + ${session.executionRootDirectory}/dev/phoenix.importorder + + + + + + + + false + + + + + + + + **/*.xml + **/*.sh + **/*.py + **/Jenkinsfile* + **/Dockerfile* + **/*.md + *.md + **/*.txt + *.txt + + + **/target/** + **/dependency-reduced-pom.xml + + + + + + + + + src/main/java/**/*.java + src/test/java/**/*.java + + + **/generated/* + **/package-info.java + + + ${session.executionRootDirectory}/src/main/config/checkstyle/header.txt + package + + + + + + false + + + diff --git a/src/main/config/checkstyle/header.txt b/src/main/config/checkstyle/header.txt index 2a4297155ea..d5519133edc 100644 --- a/src/main/config/checkstyle/header.txt +++ b/src/main/config/checkstyle/header.txt @@ -1,16 +1,17 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to you under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ + */ \ No newline at end of file From 078071b89739f05f0b1071a26bcd54740fed4536 Mon Sep 17 00:00:00 2001 From: Nihal Jain Date: Wed, 6 Nov 2024 23:12:03 +0530 Subject: [PATCH 2/2] Downgrade to 2.30.0 as that is the last known version which works with java 8 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 53738776290..36baee073fb 100644 --- a/pom.xml +++ b/pom.xml @@ -168,7 +168,7 @@ 3.3.0 3.6.0 2.5.2.Final - 2.43.0 + 2.30.0 false