This is an automated email from the ASF dual-hosted git repository.
apkhmv pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 1ca18062f56 IGNITE-27935 Add checkstyle rule to detect logger names
mismatches (#7642)
1ca18062f56 is described below
commit 1ca18062f561d3d2354f2368cea7fff2ce1b9bdc
Author: Vadim Pakhnushev <[email protected]>
AuthorDate: Tue Feb 24 18:02:19 2026 +0300
IGNITE-27935 Add checkstyle rule to detect logger names mismatches (#7642)
---
buildscripts/java-core.gradle | 10 +-
check-rules/checkstyle-rules.xml | 9 +
gradle/libs.versions.toml | 2 +
.../calls/RetriableMigrateCacheCall.java | 2 +-
.../cli/sql/calls/SqlDdlGeneratorCall.java | 3 +-
modules/checkstyle-custom/build.gradle | 72 ++++
.../checkstyle/LoggerClassMismatchCheck.java | 366 +++++++++++++++++++++
.../ignite/internal/checkstyle/messages.properties | 18 +
.../checkstyle/LoggerClassMismatchCheckTest.java | 173 ++++++++++
.../internal/checkstyle/InputLoggerCorrect.java | 25 ++
.../checkstyle/InputLoggerCustomFieldName.java | 25 ++
.../internal/checkstyle/InputLoggerInnerClass.java | 29 ++
.../checkstyle/InputLoggerInnerClassMismatch.java | 29 ++
.../internal/checkstyle/InputLoggerMismatched.java | 25 ++
.../checkstyle/InputLoggerMultiplePatterns.java | 28 ++
.../checkstyle/InputLoggerNonLoggerField.java | 24 ++
.../cluster/management/raft/CmgRaftService.java | 3 +-
.../internal/thread/IgniteThreadFactoryTest.java | 2 +-
.../metastorage/impl/MetaStorageServiceImpl.java | 2 +-
.../ScaleCubeDirectMarshallerTransport.java | 2 +-
.../internal/raft/ThrottlingContextHolderImpl.java | 2 +-
.../ignite/internal/replicator/ReplicaImpl.java | 2 +-
.../rest/health/NodeLivenessIndicator.java | 2 +-
.../rest/health/NodeReadinessIndicator.java | 2 +-
.../benchmark/TxUpsertRetryOperationBenchmark.java | 2 +-
.../GenerateConfigurationSnapshot.java | 2 +-
.../internal/sql/engine/prepare/IgnitePlanner.java | 4 +-
.../disaster/GroupUpdateRequestHandler.java | 2 +-
settings.gradle | 2 +
29 files changed, 851 insertions(+), 18 deletions(-)
diff --git a/buildscripts/java-core.gradle b/buildscripts/java-core.gradle
index 25da975ca77..9a0f889be5a 100644
--- a/buildscripts/java-core.gradle
+++ b/buildscripts/java-core.gradle
@@ -55,7 +55,6 @@ pmdTest {
}
checkstyle {
- toolVersion = libs.versions.checkstyleTool.get()
ignoreFailures = false
showViolations = true
maxWarnings = 0
@@ -66,6 +65,15 @@ checkstyle {
]
}
+// Checkstyle tool and custom checks are declared explicitly because Gradle's
checkstyle plugin
+// uses defaultDependencies (based on toolVersion) which only applies when no
user-defined
+// dependencies exist. Since we need ignite-checkstyle-custom on the
classpath, we must also
+// declare the checkstyle tool itself — otherwise Gradle skips it entirely.
+dependencies {
+ checkstyle libs.checkstyle
+ checkstyle project(':ignite-checkstyle-custom')
+}
+
tasks.withType(Checkstyle).configureEach {
excludes = ["**/generated-source/**",
"**/generated/**",
diff --git a/check-rules/checkstyle-rules.xml b/check-rules/checkstyle-rules.xml
index 44b0839fbbb..ff297a45ac1 100644
--- a/check-rules/checkstyle-rules.xml
+++ b/check-rules/checkstyle-rules.xml
@@ -397,6 +397,15 @@
<module name="SuppressionCommentFilter"/>
<!-- https://checkstyle.org/checks/coding/packagedeclaration.html -->
<module name="PackageDeclaration"/>
+ <!-- Custom check: logger class argument must match enclosing class -->
+ <module
name="org.apache.ignite.internal.checkstyle.LoggerClassMismatchCheck">
+ <!-- default: LOG|log|LOGGER|logger -->
+ <!-- <property name="fieldNamePattern" value="LOG|log|LOGGER|logger"/>
-->
+ <!-- default: getLogger,forClass -->
+ <!-- <property name="factoryMethods" value="getLogger,forClass"/> -->
+ <!-- Comma-separated fully qualified class names to exclude from the
check -->
+ <!-- <property name="excludeClasses" value=""/> -->
+ </module>
</module>
<module name="Header">
<property name="headerFile" value="${checkstyle.header.file}"
default="LICENSE.txt"/>
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 219523c2cdb..509bfaa2c4c 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -127,6 +127,8 @@ license = 'com.github.jk1.dependency-license-report:2.9'
[libraries]
+checkstyle = { module = "com.puppycrawl.tools:checkstyle", version.ref =
"checkstyleTool" }
+
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj" }
bouncycastle-bcpkix-jdk18on = { module = "org.bouncycastle:bcpkix-jdk18on",
version.ref = "bouncycastle" }
diff --git
a/migration-tools/modules/migration-tools-cli/src/main/java/org/apache/ignite/migrationtools/cli/persistence/calls/RetriableMigrateCacheCall.java
b/migration-tools/modules/migration-tools-cli/src/main/java/org/apache/ignite/migrationtools/cli/persistence/calls/RetriableMigrateCacheCall.java
index 8b2982f3f6c..dfbfabec400 100644
---
a/migration-tools/modules/migration-tools-cli/src/main/java/org/apache/ignite/migrationtools/cli/persistence/calls/RetriableMigrateCacheCall.java
+++
b/migration-tools/modules/migration-tools-cli/src/main/java/org/apache/ignite/migrationtools/cli/persistence/calls/RetriableMigrateCacheCall.java
@@ -31,7 +31,7 @@ import org.apache.ignite3.internal.logger.IgniteLogger;
/** Call for the Retrieable Migrate Cache Command. */
public class RetriableMigrateCacheCall implements
Call<RetriableMigrateCacheCall.Input, MigrateCacheCall.Ouput> {
- private static final IgniteLogger LOGGER =
CliLoggers.forClass(MigrateCacheCall.class);
+ private static final IgniteLogger LOGGER =
CliLoggers.forClass(RetriableMigrateCacheCall.class);
private final MigrateCacheCall migrateCacheCall;
diff --git
a/migration-tools/modules/migration-tools-cli/src/main/java/org/apache/ignite/migrationtools/cli/sql/calls/SqlDdlGeneratorCall.java
b/migration-tools/modules/migration-tools-cli/src/main/java/org/apache/ignite/migrationtools/cli/sql/calls/SqlDdlGeneratorCall.java
index e8da13acc24..cb865734ac6 100644
---
a/migration-tools/modules/migration-tools-cli/src/main/java/org/apache/ignite/migrationtools/cli/sql/calls/SqlDdlGeneratorCall.java
+++
b/migration-tools/modules/migration-tools-cli/src/main/java/org/apache/ignite/migrationtools/cli/sql/calls/SqlDdlGeneratorCall.java
@@ -29,7 +29,6 @@ import java.util.Optional;
import java.util.stream.Collectors;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.migrationtools.cli.sql.commands.SqlDdlGeneratorCmd;
import org.apache.ignite.migrationtools.config.Ignite2ConfigurationUtils;
import org.apache.ignite.migrationtools.sql.SqlDdlGenerator;
import
org.apache.ignite.migrationtools.tablemanagement.TableTypeRegistryMapImpl;
@@ -45,7 +44,7 @@ import org.slf4j.LoggerFactory;
/** Call for the SQL Generator command. */
public class SqlDdlGeneratorCall implements Call<SqlDdlGeneratorCall.Input,
String> {
- private static final Logger LOGGER =
LoggerFactory.getLogger(SqlDdlGeneratorCmd.class);
+ private static final Logger LOGGER =
LoggerFactory.getLogger(SqlDdlGeneratorCall.class);
@Override
public CallOutput<String> execute(Input i) {
diff --git a/modules/checkstyle-custom/build.gradle
b/modules/checkstyle-custom/build.gradle
new file mode 100644
index 00000000000..0ddf95863d5
--- /dev/null
+++ b/modules/checkstyle-custom/build.gradle
@@ -0,0 +1,72 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
+// This module cannot apply java-core.gradle because java-core.gradle adds
+// `checkstyle project(':ignite-checkstyle-custom')` to every module's
checkstyle classpath.
+// That would create a circular dependency: this module would depend on its
own jar
+// to run checkstyle on itself. Instead, we configure checkstyle and PMD
directly.
+apply plugin: 'java'
+apply plugin: 'checkstyle'
+apply plugin: 'pmd'
+
+java {
+ sourceCompatibility = JavaVersion.VERSION_11
+ targetCompatibility = JavaVersion.VERSION_11
+}
+
+description = 'ignite-checkstyle-custom'
+
+checkstyle {
+ ignoreFailures = false
+ showViolations = true
+ maxWarnings = 0
+ configFile = file("$rootDir/check-rules/checkstyle-rules.xml")
+ configProperties = [
+ "checkstyle.header.file" :
file("$rootDir/check-rules/LICENSE.txt"),
+ "org.checkstyle.google.suppressionfilter.config" :
file("$rootDir/check-rules/checkstyle-suppressions.xml")
+ ]
+}
+
+// Chicken-and-egg problem: checkstyle-rules.xml references
LoggerClassMismatchCheck which lives
+// in this module. To run checkstyle on ourselves, we need our own compiled
classes and resources
+// on the checkstyle classpath. Without this, checkstyle fails with "Unable to
create Root Module"
+// because it cannot find the custom check class.
+dependencies {
+ checkstyle libs.checkstyle
+ checkstyle files(sourceSets.main.output.classesDirs)
+ checkstyle files(sourceSets.main.output.resourcesDir)
+}
+
+pmd {
+ ignoreFailures = false
+ consoleOutput = true
+ incrementalAnalysis = true
+ toolVersion = libs.versions.pmdTool.get()
+ ruleSets = ["$rootDir/check-rules/pmd-rules.xml"]
+}
+
+dependencies {
+ compileOnly libs.checkstyle
+
+ testImplementation libs.checkstyle
+ testImplementation libs.bundles.junit
+ testImplementation libs.bundles.hamcrest
+}
+
+test {
+ useJUnitPlatform()
+}
diff --git
a/modules/checkstyle-custom/src/main/java/org/apache/ignite/internal/checkstyle/LoggerClassMismatchCheck.java
b/modules/checkstyle-custom/src/main/java/org/apache/ignite/internal/checkstyle/LoggerClassMismatchCheck.java
new file mode 100644
index 00000000000..982a7f8fce5
--- /dev/null
+++
b/modules/checkstyle-custom/src/main/java/org/apache/ignite/internal/checkstyle/LoggerClassMismatchCheck.java
@@ -0,0 +1,366 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
+package org.apache.ignite.internal.checkstyle;
+
+import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
+import com.puppycrawl.tools.checkstyle.api.DetailAST;
+import com.puppycrawl.tools.checkstyle.api.TokenTypes;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+/**
+ * Checks that logger fields are initialized with the enclosing class, not a
copy-pasted different class.
+ *
+ * <p>Detects patterns like:
+ * <pre>
+ * class Bar {
+ * // BUG: should be Bar.class, not Foo.class
+ * private static final Logger LOG = LoggerFactory.getLogger(Foo.class);
+ * }
+ * </pre>
+ */
+public class LoggerClassMismatchCheck extends AbstractCheck {
+
+ /** Key for the violation message. */
+ public static final String MSG_KEY = "logger.class.mismatch";
+
+ /** Default field name pattern. */
+ private static final String DEFAULT_FIELD_NAME_PATTERN =
"LOG|log|LOGGER|logger";
+
+ /** Default factory method names. */
+ private static final String DEFAULT_FACTORY_METHODS = "getLogger,forClass";
+
+ /** Compiled field name pattern. */
+ private Pattern fieldNamePattern =
Pattern.compile(DEFAULT_FIELD_NAME_PATTERN);
+
+ /** Set of factory method names. */
+ private Set<String> factoryMethods = new
HashSet<>(Arrays.asList(DEFAULT_FACTORY_METHODS.split(",")));
+
+ /** Set of fully qualified class names to exclude from the check. */
+ private Set<String> excludeClasses = Set.of();
+
+ /**
+ * Sets the field name pattern.
+ *
+ * @param pattern regex pattern for matching logger field names.
+ */
+ public void setFieldNamePattern(String pattern) {
+ this.fieldNamePattern = Pattern.compile(pattern);
+ }
+
+ /**
+ * Sets the factory method names.
+ *
+ * @param methods comma-separated list of factory method names.
+ */
+ public void setFactoryMethods(String methods) {
+ this.factoryMethods = new HashSet<>(Arrays.asList(methods.split(",")));
+ }
+
+ /**
+ * Sets the fully qualified class names to exclude from the check.
+ *
+ * @param classNames comma-separated list of fully qualified class names
to exclude.
+ */
+ public void setExcludeClasses(String classNames) {
+ this.excludeClasses = new
HashSet<>(Arrays.asList(classNames.split(",")));
+ }
+
+ @Override
+ public int[] getDefaultTokens() {
+ return getRequiredTokens();
+ }
+
+ @Override
+ public int[] getAcceptableTokens() {
+ return getRequiredTokens();
+ }
+
+ @Override
+ public int[] getRequiredTokens() {
+ return new int[]{TokenTypes.VARIABLE_DEF};
+ }
+
+ @Override
+ public void visitToken(DetailAST ast) {
+ if (!isStaticFinal(ast)) {
+ return;
+ }
+
+ String fieldName = getFieldName(ast);
+ if (fieldName == null ||
!fieldNamePattern.matcher(fieldName).matches()) {
+ return;
+ }
+
+ DetailAST methodCall = findLoggerFactoryCall(ast);
+ if (methodCall == null) {
+ return;
+ }
+
+ String argClassName = extractClassArgument(methodCall);
+ if (argClassName == null) {
+ return;
+ }
+
+ String enclosingClassName = findEnclosingClassName(ast);
+ if (enclosingClassName == null) {
+ return;
+ }
+
+ if (!excludeClasses.isEmpty()) {
+ String fullyQualifiedName = buildFullyQualifiedName(ast);
+ if (fullyQualifiedName != null &&
excludeClasses.contains(fullyQualifiedName)) {
+ return;
+ }
+ }
+
+ if (!argClassName.equals(enclosingClassName)) {
+ log(ast, MSG_KEY, argClassName, enclosingClassName);
+ }
+ }
+
+ /**
+ * Checks if the variable definition has both 'static' and 'final'
modifiers.
+ */
+ private static boolean isStaticFinal(DetailAST variableDef) {
+ DetailAST modifiers = variableDef.findFirstToken(TokenTypes.MODIFIERS);
+ if (modifiers == null) {
+ return false;
+ }
+
+ boolean isStatic = false;
+ boolean isFinal = false;
+
+ for (DetailAST child = modifiers.getFirstChild(); child != null; child
= child.getNextSibling()) {
+ if (child.getType() == TokenTypes.LITERAL_STATIC) {
+ isStatic = true;
+ } else if (child.getType() == TokenTypes.FINAL) {
+ isFinal = true;
+ }
+ }
+
+ return isStatic && isFinal;
+ }
+
+ /**
+ * Gets the field name from a variable definition.
+ */
+ private static String getFieldName(DetailAST variableDef) {
+ DetailAST ident = variableDef.findFirstToken(TokenTypes.IDENT);
+ return ident != null ? ident.getText() : null;
+ }
+
+ /**
+ * Finds a logger factory method call in the variable assignment.
+ * Looks for patterns like {@code LoggerFactory.getLogger(...)}.
+ */
+ private DetailAST findLoggerFactoryCall(DetailAST variableDef) {
+ DetailAST assign = variableDef.findFirstToken(TokenTypes.ASSIGN);
+ if (assign == null) {
+ return null;
+ }
+
+ return findMethodCallInSubtree(assign);
+ }
+
+ /**
+ * Recursively searches for a matching factory method call in the AST
subtree.
+ */
+ private DetailAST findMethodCallInSubtree(DetailAST node) {
+ if (node == null) {
+ return null;
+ }
+
+ if (node.getType() == TokenTypes.METHOD_CALL) {
+ String methodName = getMethodCallName(node);
+ if (methodName != null && factoryMethods.contains(methodName)) {
+ return node;
+ }
+ }
+
+ for (DetailAST child = node.getFirstChild(); child != null; child =
child.getNextSibling()) {
+ DetailAST result = findMethodCallInSubtree(child);
+ if (result != null) {
+ return result;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Gets the method name from a METHOD_CALL node.
+ * Handles both simple calls {@code getLogger(...)} and dotted calls
{@code LoggerFactory.getLogger(...)}.
+ */
+ private static String getMethodCallName(DetailAST methodCall) {
+ DetailAST firstChild = methodCall.getFirstChild();
+ if (firstChild == null) {
+ return null;
+ }
+
+ // Simple call: getLogger(...)
+ if (firstChild.getType() == TokenTypes.IDENT) {
+ return firstChild.getText();
+ }
+
+ // Dotted call: LoggerFactory.getLogger(...)
+ if (firstChild.getType() == TokenTypes.DOT) {
+ DetailAST methodIdent = firstChild.getLastChild();
+ if (methodIdent != null && methodIdent.getType() ==
TokenTypes.IDENT) {
+ return methodIdent.getText();
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Extracts the class name from {@code X.class} argument in the method
call.
+ */
+ private static String extractClassArgument(DetailAST methodCall) {
+ DetailAST elist = methodCall.findFirstToken(TokenTypes.ELIST);
+ if (elist == null) {
+ return null;
+ }
+
+ DetailAST expr = elist.findFirstToken(TokenTypes.EXPR);
+ if (expr == null) {
+ return null;
+ }
+
+ // Look for DOT node representing X.class
+ DetailAST dot = expr.findFirstToken(TokenTypes.DOT);
+ if (dot == null) {
+ return null;
+ }
+
+ DetailAST lastChild = dot.getLastChild();
+ if (lastChild == null || lastChild.getType() !=
TokenTypes.LITERAL_CLASS) {
+ return null;
+ }
+
+ // The class name is the first child of the DOT: could be IDENT
(simple) or another DOT (qualified)
+ DetailAST classNameNode = dot.getFirstChild();
+ if (classNameNode == null) {
+ return null;
+ }
+
+ // For simple names like Foo.class, the first child is IDENT
+ if (classNameNode.getType() == TokenTypes.IDENT) {
+ return classNameNode.getText();
+ }
+
+ return null;
+ }
+
+ /**
+ * Builds the fully qualified name of the nearest enclosing class (package
+ nested class path).
+ */
+ private static String buildFullyQualifiedName(DetailAST node) {
+ // Find the compilation unit (root) to get the package name.
+ DetailAST root = node;
+ while (root.getParent() != null) {
+ root = root.getParent();
+ }
+
+ String packageName = "";
+ for (DetailAST child = root.getFirstChild(); child != null; child =
child.getNextSibling()) {
+ if (child.getType() == TokenTypes.PACKAGE_DEF) {
+ packageName =
extractDottedName(child.findFirstToken(TokenTypes.DOT),
+ child.findFirstToken(TokenTypes.IDENT));
+ break;
+ }
+ }
+
+ // Build the class nesting path from outermost to the immediate
enclosing class.
+ StringBuilder classPath = new StringBuilder();
+ DetailAST parent = node.getParent();
+ while (parent != null) {
+ if (parent.getType() == TokenTypes.CLASS_DEF
+ || parent.getType() == TokenTypes.INTERFACE_DEF
+ || parent.getType() == TokenTypes.ENUM_DEF) {
+ DetailAST ident = parent.findFirstToken(TokenTypes.IDENT);
+ if (ident != null) {
+ if (classPath.length() > 0) {
+ classPath.insert(0, '.');
+ }
+ classPath.insert(0, ident.getText());
+ }
+ }
+ parent = parent.getParent();
+ }
+
+ if (classPath.length() == 0) {
+ return null;
+ }
+
+ if (packageName.isEmpty()) {
+ return classPath.toString();
+ }
+
+ return packageName + "." + classPath;
+ }
+
+ /**
+ * Extracts a dotted name (like a package name) from the AST.
+ */
+ private static String extractDottedName(DetailAST dot, DetailAST ident) {
+ if (dot != null) {
+ return buildDotExpression(dot);
+ }
+ if (ident != null) {
+ return ident.getText();
+ }
+ return "";
+ }
+
+ /**
+ * Recursively builds a dotted expression string from a DOT node.
+ */
+ private static String buildDotExpression(DetailAST dot) {
+ DetailAST left = dot.getFirstChild();
+ DetailAST right = dot.getLastChild();
+
+ String leftText = left.getType() == TokenTypes.DOT
+ ? buildDotExpression(left) : left.getText();
+ String rightText = right.getText();
+
+ return leftText + "." + rightText;
+ }
+
+ /**
+ * Finds the name of the nearest enclosing class definition.
+ */
+ private static String findEnclosingClassName(DetailAST node) {
+ DetailAST parent = node.getParent();
+ while (parent != null) {
+ if (parent.getType() == TokenTypes.CLASS_DEF
+ || parent.getType() == TokenTypes.INTERFACE_DEF
+ || parent.getType() == TokenTypes.ENUM_DEF) {
+ DetailAST ident = parent.findFirstToken(TokenTypes.IDENT);
+ if (ident != null) {
+ return ident.getText();
+ }
+ }
+ parent = parent.getParent();
+ }
+ return null;
+ }
+}
diff --git
a/modules/checkstyle-custom/src/main/resources/org/apache/ignite/internal/checkstyle/messages.properties
b/modules/checkstyle-custom/src/main/resources/org/apache/ignite/internal/checkstyle/messages.properties
new file mode 100644
index 00000000000..27db8dc3ec3
--- /dev/null
+++
b/modules/checkstyle-custom/src/main/resources/org/apache/ignite/internal/checkstyle/messages.properties
@@ -0,0 +1,18 @@
+#
+# 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
+#
+# 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.
+#
+
+logger.class.mismatch = Logger uses {0}.class but is declared in class {1}.
Did you copy-paste this from another class?
diff --git
a/modules/checkstyle-custom/src/test/java/org/apache/ignite/internal/checkstyle/LoggerClassMismatchCheckTest.java
b/modules/checkstyle-custom/src/test/java/org/apache/ignite/internal/checkstyle/LoggerClassMismatchCheckTest.java
new file mode 100644
index 00000000000..b5907f860fe
--- /dev/null
+++
b/modules/checkstyle-custom/src/test/java/org/apache/ignite/internal/checkstyle/LoggerClassMismatchCheckTest.java
@@ -0,0 +1,173 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
+package org.apache.ignite.internal.checkstyle;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.empty;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import com.puppycrawl.tools.checkstyle.Checker;
+import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
+import com.puppycrawl.tools.checkstyle.TreeWalker;
+import com.puppycrawl.tools.checkstyle.api.AuditEvent;
+import com.puppycrawl.tools.checkstyle.api.AuditListener;
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import org.junit.jupiter.api.Test;
+
+/** Tests for {@link LoggerClassMismatchCheck}. */
+class LoggerClassMismatchCheckTest {
+
+ private static final String RESOURCE_DIR =
"org/apache/ignite/internal/checkstyle/";
+
+ @Test
+ void correctUsageProducesNoViolation() throws Exception {
+ List<AuditEvent> violations = runCheck("InputLoggerCorrect.java", new
DefaultConfiguration(
+ LoggerClassMismatchCheck.class.getName()));
+
+ assertThat(violations, is(empty()));
+ }
+
+ @Test
+ void mismatchedClassProducesViolation() throws Exception {
+ List<AuditEvent> violations = runCheck("InputLoggerMismatched.java",
new DefaultConfiguration(
+ LoggerClassMismatchCheck.class.getName()));
+
+ assertThat(violations, hasSize(1));
+ assertThat(violations.get(0).getLine(), is(24));
+ assertTrue(violations.get(0).getMessage().contains("SomeOtherClass"));
+
assertTrue(violations.get(0).getMessage().contains("InputLoggerMismatched"));
+ }
+
+ @Test
+ void nonLoggerFieldProducesNoViolation() throws Exception {
+ List<AuditEvent> violations =
runCheck("InputLoggerNonLoggerField.java", new DefaultConfiguration(
+ LoggerClassMismatchCheck.class.getName()));
+
+ assertThat(violations, is(empty()));
+ }
+
+ @Test
+ void innerClassLoggerMatchesInnerClass() throws Exception {
+ List<AuditEvent> violations = runCheck("InputLoggerInnerClass.java",
new DefaultConfiguration(
+ LoggerClassMismatchCheck.class.getName()));
+
+ assertThat(violations, is(empty()));
+ }
+
+ @Test
+ void innerClassMismatchProducesViolation() throws Exception {
+ List<AuditEvent> violations =
runCheck("InputLoggerInnerClassMismatch.java", new DefaultConfiguration(
+ LoggerClassMismatchCheck.class.getName()));
+
+ assertThat(violations, hasSize(1));
+ assertThat(violations.get(0).getLine(), is(27));
+
assertTrue(violations.get(0).getMessage().contains("InputLoggerInnerClassMismatch"));
+ assertTrue(violations.get(0).getMessage().contains("Inner"));
+ }
+
+ @Test
+ void customFieldNamePattern() throws Exception {
+ DefaultConfiguration checkConfig = new DefaultConfiguration(
+ LoggerClassMismatchCheck.class.getName());
+ checkConfig.addProperty("fieldNamePattern", "MY_LOG");
+
+ List<AuditEvent> violations =
runCheck("InputLoggerCustomFieldName.java", checkConfig);
+
+ assertThat(violations, hasSize(1));
+ assertThat(violations.get(0).getLine(), is(24));
+ assertTrue(violations.get(0).getMessage().contains("SomeOtherClass"));
+ }
+
+ @Test
+ void multipleFactoryPatterns() throws Exception {
+ List<AuditEvent> violations =
runCheck("InputLoggerMultiplePatterns.java", new DefaultConfiguration(
+ LoggerClassMismatchCheck.class.getName()));
+
+ assertThat(violations, hasSize(2));
+ assertThat(violations.get(0).getLine(), is(25));
+ assertThat(violations.get(1).getLine(), is(27));
+ }
+
+ @Test
+ void excludeClassSuppressesViolation() throws Exception {
+ DefaultConfiguration checkConfig = new DefaultConfiguration(
+ LoggerClassMismatchCheck.class.getName());
+ checkConfig.addProperty("excludeClasses",
"org.apache.ignite.internal.checkstyle.InputLoggerMismatched");
+
+ List<AuditEvent> violations = runCheck("InputLoggerMismatched.java",
checkConfig);
+
+ assertThat(violations, is(empty()));
+ }
+
+ private List<AuditEvent> runCheck(String inputFile, DefaultConfiguration
checkConfig) throws Exception {
+ DefaultConfiguration treeWalkerConfig = new
DefaultConfiguration(TreeWalker.class.getName());
+ treeWalkerConfig.addChild(checkConfig);
+
+ DefaultConfiguration checkerConfig = new
DefaultConfiguration("Checker");
+ checkerConfig.addChild(treeWalkerConfig);
+
+ Checker checker = new Checker();
+
checker.setModuleClassLoader(Thread.currentThread().getContextClassLoader());
+ checker.configure(checkerConfig);
+
+ List<AuditEvent> violations = new ArrayList<>();
+ checker.addListener(new AuditListener() {
+ @Override
+ public void auditStarted(AuditEvent event) {
+ }
+
+ @Override
+ public void auditFinished(AuditEvent event) {
+ }
+
+ @Override
+ public void fileStarted(AuditEvent event) {
+ }
+
+ @Override
+ public void fileFinished(AuditEvent event) {
+ }
+
+ @Override
+ public void addError(AuditEvent event) {
+ violations.add(event);
+ }
+
+ @Override
+ public void addException(AuditEvent event, Throwable throwable) {
+ throw new RuntimeException("Checkstyle exception", throwable);
+ }
+ });
+
+ URL resource = getClass().getClassLoader().getResource(RESOURCE_DIR +
inputFile);
+ assert resource != null : "Test resource not found: " + inputFile;
+
+ File file = new File(resource.toURI());
+ List<File> files = List.of(file);
+
+ checker.process(files);
+ checker.destroy();
+
+ return violations;
+ }
+}
diff --git
a/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerCorrect.java
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerCorrect.java
new file mode 100644
index 00000000000..2bf3617c2a0
--- /dev/null
+++
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerCorrect.java
@@ -0,0 +1,25 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
+package org.apache.ignite.internal.checkstyle;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class InputLoggerCorrect {
+ private static final Logger LOG =
LoggerFactory.getLogger(InputLoggerCorrect.class);
+}
diff --git
a/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerCustomFieldName.java
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerCustomFieldName.java
new file mode 100644
index 00000000000..faaa7f2e230
--- /dev/null
+++
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerCustomFieldName.java
@@ -0,0 +1,25 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
+package org.apache.ignite.internal.checkstyle;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class InputLoggerCustomFieldName {
+ private static final Logger MY_LOG =
LoggerFactory.getLogger(SomeOtherClass.class);
+}
diff --git
a/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerInnerClass.java
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerInnerClass.java
new file mode 100644
index 00000000000..5751fe9bff5
--- /dev/null
+++
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerInnerClass.java
@@ -0,0 +1,29 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
+package org.apache.ignite.internal.checkstyle;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class InputLoggerInnerClass {
+ private static final Logger LOG =
LoggerFactory.getLogger(InputLoggerInnerClass.class);
+
+ static class Inner {
+ private static final Logger LOG = LoggerFactory.getLogger(Inner.class);
+ }
+}
diff --git
a/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerInnerClassMismatch.java
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerInnerClassMismatch.java
new file mode 100644
index 00000000000..abc103ecc64
--- /dev/null
+++
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerInnerClassMismatch.java
@@ -0,0 +1,29 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
+package org.apache.ignite.internal.checkstyle;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class InputLoggerInnerClassMismatch {
+ private static final Logger LOG =
LoggerFactory.getLogger(InputLoggerInnerClassMismatch.class);
+
+ static class Inner {
+ private static final Logger LOG =
LoggerFactory.getLogger(InputLoggerInnerClassMismatch.class);
+ }
+}
diff --git
a/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerMismatched.java
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerMismatched.java
new file mode 100644
index 00000000000..13ed3c0a38c
--- /dev/null
+++
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerMismatched.java
@@ -0,0 +1,25 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
+package org.apache.ignite.internal.checkstyle;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class InputLoggerMismatched {
+ private static final Logger LOG =
LoggerFactory.getLogger(SomeOtherClass.class);
+}
diff --git
a/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerMultiplePatterns.java
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerMultiplePatterns.java
new file mode 100644
index 00000000000..fb4d8cabe01
--- /dev/null
+++
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerMultiplePatterns.java
@@ -0,0 +1,28 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
+package org.apache.ignite.internal.checkstyle;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class InputLoggerMultiplePatterns {
+ private static final Logger LOG =
LoggerFactory.getLogger(InputLoggerMultiplePatterns.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(Wrong.class);
+
+ private static final Object log = Loggers.forClass(Wrong.class);
+}
diff --git
a/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerNonLoggerField.java
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerNonLoggerField.java
new file mode 100644
index 00000000000..69f2a86a38d
--- /dev/null
+++
b/modules/checkstyle-custom/src/test/resources/org/apache/ignite/internal/checkstyle/InputLoggerNonLoggerField.java
@@ -0,0 +1,24 @@
+/*
+ * 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
+ *
+ * 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.
+ */
+
+package org.apache.ignite.internal.checkstyle;
+
+public class InputLoggerNonLoggerField {
+ private static final String NAME = "test";
+
+ private static final int COUNT = 42;
+}
diff --git
a/modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/CmgRaftService.java
b/modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/CmgRaftService.java
index deb4deecb3f..a9e37b70a75 100644
---
a/modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/CmgRaftService.java
+++
b/modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/CmgRaftService.java
@@ -27,7 +27,6 @@ import java.util.List;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import org.apache.ignite.internal.close.ManuallyCloseable;
-import
org.apache.ignite.internal.cluster.management.ClusterManagementGroupManager;
import org.apache.ignite.internal.cluster.management.ClusterState;
import org.apache.ignite.internal.cluster.management.ClusterTag;
import
org.apache.ignite.internal.cluster.management.InvalidNodeConfigurationException;
@@ -59,7 +58,7 @@ import org.jetbrains.annotations.Nullable;
* A wrapper around a {@link RaftGroupService} providing helpful methods for
working with the CMG.
*/
public class CmgRaftService implements ManuallyCloseable {
- private static final IgniteLogger LOG =
Loggers.forClass(ClusterManagementGroupManager.class);
+ private static final IgniteLogger LOG =
Loggers.forClass(CmgRaftService.class);
private final CmgMessagesFactory msgFactory = new CmgMessagesFactory();
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/thread/IgniteThreadFactoryTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/thread/IgniteThreadFactoryTest.java
index 610bbed5cba..ee08a05bcc7 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/thread/IgniteThreadFactoryTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/thread/IgniteThreadFactoryTest.java
@@ -31,7 +31,7 @@ import org.apache.ignite.internal.logger.Loggers;
import org.junit.jupiter.api.Test;
class IgniteThreadFactoryTest {
- private static final IgniteLogger LOG =
Loggers.forClass(IgniteThreadFactory.class);
+ private static final IgniteLogger LOG =
Loggers.forClass(IgniteThreadFactoryTest.class);
@Test
void producesCorrectThreadNames() throws Exception {
diff --git
a/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageServiceImpl.java
b/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageServiceImpl.java
index 8ff08fa3f62..f188952a13d 100644
---
a/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageServiceImpl.java
+++
b/modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageServiceImpl.java
@@ -69,7 +69,7 @@ import org.jetbrains.annotations.Nullable;
* {@link MetaStorageService} implementation.
*/
public class MetaStorageServiceImpl implements MetaStorageService {
- private static final IgniteLogger LOG =
Loggers.forClass(MetaStorageService.class);
+ private static final IgniteLogger LOG =
Loggers.forClass(MetaStorageServiceImpl.class);
/** Default batch size that is requested from the remote server. */
public static final int BATCH_SIZE = 1000;
diff --git
a/modules/network/src/main/java/org/apache/ignite/internal/network/scalecube/ScaleCubeDirectMarshallerTransport.java
b/modules/network/src/main/java/org/apache/ignite/internal/network/scalecube/ScaleCubeDirectMarshallerTransport.java
index f0a81366d98..aa6a9430ddb 100644
---
a/modules/network/src/main/java/org/apache/ignite/internal/network/scalecube/ScaleCubeDirectMarshallerTransport.java
+++
b/modules/network/src/main/java/org/apache/ignite/internal/network/scalecube/ScaleCubeDirectMarshallerTransport.java
@@ -48,7 +48,7 @@ import reactor.core.publisher.MonoProcessor;
*/
class ScaleCubeDirectMarshallerTransport implements Transport {
/** Logger. */
- private static final IgniteLogger LOG = Loggers.forClass(Transport.class);
+ private static final IgniteLogger LOG =
Loggers.forClass(ScaleCubeDirectMarshallerTransport.class);
/** Channel type for Scale Cube. */
static final ChannelType SCALE_CUBE_CHANNEL_TYPE = new ChannelType((short)
1, "ScaleCube");
diff --git
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/ThrottlingContextHolderImpl.java
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/ThrottlingContextHolderImpl.java
index 57de381d976..c9175547760 100644
---
a/modules/raft/src/main/java/org/apache/ignite/internal/raft/ThrottlingContextHolderImpl.java
+++
b/modules/raft/src/main/java/org/apache/ignite/internal/raft/ThrottlingContextHolderImpl.java
@@ -43,7 +43,7 @@ import org.jetbrains.annotations.TestOnly;
* probability of getting timeout exceptions dramatically increase.
*/
public class ThrottlingContextHolderImpl implements ThrottlingContextHolder {
- private static final IgniteLogger LOG =
Loggers.forClass(ThrottlingContextHolder.class);
+ private static final IgniteLogger LOG =
Loggers.forClass(ThrottlingContextHolderImpl.class);
private final RaftConfiguration configuration;
diff --git
a/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaImpl.java
b/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaImpl.java
index ca1a775b464..bfa89f44f3c 100644
---
a/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaImpl.java
+++
b/modules/replicator/src/main/java/org/apache/ignite/internal/replicator/ReplicaImpl.java
@@ -57,7 +57,7 @@ import org.apache.ignite.internal.util.IgniteBusyLock;
*/
public class ReplicaImpl implements Replica {
/** The logger. */
- private static final IgniteLogger LOG =
Loggers.forClass(ReplicaManager.class);
+ private static final IgniteLogger LOG =
Loggers.forClass(ReplicaImpl.class);
/** Replica group identity, this id is the same as the considered
partition's id. */
private final ReplicationGroupId replicaGrpId;
diff --git
a/modules/rest/src/main/java/org/apache/ignite/internal/rest/health/NodeLivenessIndicator.java
b/modules/rest/src/main/java/org/apache/ignite/internal/rest/health/NodeLivenessIndicator.java
index bb5390d8c49..c459d6a759d 100644
---
a/modules/rest/src/main/java/org/apache/ignite/internal/rest/health/NodeLivenessIndicator.java
+++
b/modules/rest/src/main/java/org/apache/ignite/internal/rest/health/NodeLivenessIndicator.java
@@ -34,7 +34,7 @@ import reactor.core.publisher.Flux;
@Singleton
@Liveness
public class NodeLivenessIndicator implements HealthIndicator {
- private static final IgniteLogger LOG =
Loggers.forClass(HealthIndicator.class);
+ private static final IgniteLogger LOG =
Loggers.forClass(NodeLivenessIndicator.class);
@Override
public Publisher<HealthResult> getResult() {
diff --git
a/modules/rest/src/main/java/org/apache/ignite/internal/rest/health/NodeReadinessIndicator.java
b/modules/rest/src/main/java/org/apache/ignite/internal/rest/health/NodeReadinessIndicator.java
index 3ff456ae70c..6ddb3514998 100644
---
a/modules/rest/src/main/java/org/apache/ignite/internal/rest/health/NodeReadinessIndicator.java
+++
b/modules/rest/src/main/java/org/apache/ignite/internal/rest/health/NodeReadinessIndicator.java
@@ -39,7 +39,7 @@ import reactor.core.publisher.Flux;
@Singleton
@Readiness
public class NodeReadinessIndicator implements HealthIndicator {
- private static final IgniteLogger LOG =
Loggers.forClass(HealthIndicator.class);
+ private static final IgniteLogger LOG =
Loggers.forClass(NodeReadinessIndicator.class);
private final JoinFutureProvider joinFutureProvider;
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/TxUpsertRetryOperationBenchmark.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/TxUpsertRetryOperationBenchmark.java
index 9a6a8cc8f51..4d68d9984b1 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/TxUpsertRetryOperationBenchmark.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/TxUpsertRetryOperationBenchmark.java
@@ -59,7 +59,7 @@ import org.openjdk.jmh.runner.options.OptionsBuilder;
@BenchmarkMode({Mode.AverageTime, Mode.Throughput})
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public class TxUpsertRetryOperationBenchmark extends
AbstractMultiNodeBenchmark {
- private static final IgniteLogger LOG =
Loggers.forClass(TxBalanceRetryOperationBenchmark.class);
+ private static final IgniteLogger LOG =
Loggers.forClass(TxUpsertRetryOperationBenchmark.class);
private static RecordView<Tuple> recordView;
diff --git
a/modules/runner/src/test/java/org/apache/ignite/internal/configuration/compatibility/GenerateConfigurationSnapshot.java
b/modules/runner/src/test/java/org/apache/ignite/internal/configuration/compatibility/GenerateConfigurationSnapshot.java
index d34da2af97b..5ff7a70eb48 100644
---
a/modules/runner/src/test/java/org/apache/ignite/internal/configuration/compatibility/GenerateConfigurationSnapshot.java
+++
b/modules/runner/src/test/java/org/apache/ignite/internal/configuration/compatibility/GenerateConfigurationSnapshot.java
@@ -36,7 +36,7 @@ import org.apache.ignite.internal.logger.Loggers;
public class GenerateConfigurationSnapshot {
private static final Path DEFAULT_SNAPSHOT_FILE = Path.of("modules",
"runner", "build", "work", DEFAULT_FILE_NAME);
- private static final IgniteLogger LOG =
Loggers.forClass(ConfigurationCompatibilityTest.class);
+ private static final IgniteLogger LOG =
Loggers.forClass(GenerateConfigurationSnapshot.class);
/**
* Generates a snapshot of the current configuration metadata and saves it
to a file.
diff --git
a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgnitePlanner.java
b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgnitePlanner.java
index 23da21366bf..fd41c507e35 100644
---
a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgnitePlanner.java
+++
b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgnitePlanner.java
@@ -100,6 +100,8 @@ import org.jetbrains.annotations.Nullable;
* Query planer.
*/
public class IgnitePlanner implements Planner, RelOptTable.ViewExpander {
+ private static final IgniteLogger LOG =
Loggers.forClass(IgnitePlanner.class);
+
private final SqlOperatorTable operatorTbl;
private final List<Program> programs;
@@ -657,8 +659,6 @@ public class IgnitePlanner implements Planner,
RelOptTable.ViewExpander {
}
private static class VolcanoPlannerExt extends VolcanoPlanner {
- private static final IgniteLogger LOG =
Loggers.forClass(IgnitePlanner.class);
-
private final long startTs;
protected VolcanoPlannerExt(RelOptCostFactory costFactory, Context
externalCtx, long startTs) {
diff --git
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/GroupUpdateRequestHandler.java
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/GroupUpdateRequestHandler.java
index 42aec0b81bf..6c6813d90a6 100644
---
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/GroupUpdateRequestHandler.java
+++
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/GroupUpdateRequestHandler.java
@@ -84,7 +84,7 @@ import org.jetbrains.annotations.Nullable;
* A colocation-aware handler for {@link GroupUpdateRequest}.
*/
class GroupUpdateRequestHandler {
- private static final IgniteLogger LOG =
Loggers.forClass(GroupUpdateRequest.class);
+ private static final IgniteLogger LOG =
Loggers.forClass(GroupUpdateRequestHandler.class);
private final GroupUpdateRequest request;
diff --git a/settings.gradle b/settings.gradle
index 038092ce46b..e8212ab9d87 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -108,6 +108,7 @@ include(':ignite-system-disaster-recovery')
include(':ignite-system-disaster-recovery-api')
include(':ignite-compatibility-tests')
include(':ignite-configuration-storage')
+include(':ignite-checkstyle-custom')
project(":ignite-examples").projectDir = file('examples/java')
project(":ignite-dev-utilities").projectDir = file('dev-utilities')
@@ -193,6 +194,7 @@ project(":ignite-system-disaster-recovery").projectDir =
file('modules/system-di
project(":ignite-system-disaster-recovery-api").projectDir =
file('modules/system-disaster-recovery-api')
project(':ignite-compatibility-tests').projectDir =
file('modules/compatibility-tests')
project(':ignite-configuration-storage').projectDir =
file('modules/configuration-storage')
+project(':ignite-checkstyle-custom').projectDir =
file('modules/checkstyle-custom')
include(":migration-tools-ignite2-repack")
include(":migration-tools-ignite3-repack")