Fix issues after merging master

This commit is contained in:
Andrea Boriero 2020-04-16 11:46:19 +01:00
parent 2ccf7fab9e
commit 132a4121b5
3 changed files with 39 additions and 35 deletions

View File

@ -16,7 +16,7 @@ buildscript {
classpath 'gradle.plugin.com.github.lburgazzoli:gradle-karaf-plugin:0.5.1' classpath 'gradle.plugin.com.github.lburgazzoli:gradle-karaf-plugin:0.5.1'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7' classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'de.thetaphi:forbiddenapis:2.5' classpath 'de.thetaphi:forbiddenapis:2.7'
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1' classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1'
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.2.0' classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.2.0'
} }

View File

@ -362,36 +362,36 @@ task nonFatalCheckstyle(type:Checkstyle) {
checkstyleMain.exclude '**/org/hibernate/cfg/**' checkstyleMain.exclude '**/org/hibernate/cfg/**'
checkstyleMain.exclude '**/org/hibernate/cfg/*' checkstyleMain.exclude '**/org/hibernate/cfg/*'
//
//task forbiddenApisSystemOut(type: CheckForbiddenApis, dependsOn: compileJava) { task forbiddenApisSystemOut(type: CheckForbiddenApis, dependsOn: compileJava) {
// classesDirs = project.sourceSets.main.output.classesDirs classesDirs = project.sourceSets.main.output.classesDirs
// classpath = project.sourceSets.main.compileClasspath + project.sourceSets.main.runtimeClasspath classpath = project.sourceSets.main.compileClasspath + project.sourceSets.main.runtimeClasspath
// targetCompatibility = project.forbiddenAPITargetJDKCompatibility targetCompatibility = project.forbiddenAPITargetJDKCompatibility
// bundledSignatures += 'jdk-system-out' bundledSignatures += 'jdk-system-out'
// suppressAnnotations += ['org.hibernate.internal.build.AllowSysOut', 'org.hibernate.internal.build.AllowPrintStacktrace'] suppressAnnotations += ['org.hibernate.internal.build.AllowSysOut', 'org.hibernate.internal.build.AllowPrintStacktrace']
//} }
//
//task forbiddenApisUnsafe(type: CheckForbiddenApis, dependsOn: compileJava) { task forbiddenApisUnsafe(type: CheckForbiddenApis, dependsOn: compileJava) {
// classesDirs = project.sourceSets.main.output.classesDirs classesDirs = project.sourceSets.main.output.classesDirs
// classpath = project.sourceSets.main.compileClasspath + project.sourceSets.main.runtimeClasspath classpath = project.sourceSets.main.compileClasspath + project.sourceSets.main.runtimeClasspath
// targetCompatibility = project.forbiddenAPITargetJDKCompatibility targetCompatibility = project.forbiddenAPITargetJDKCompatibility
// bundledSignatures += "jdk-unsafe-${baselineJavaVersion}".toString() bundledSignatures += "jdk-unsafe-${baselineJavaVersion}".toString()
//
// // unfortunately we currently have many uses of default Locale implicitly (~370) which need to be fixed // unfortunately we currently have many uses of default Locale implicitly (~370) which need to be fixed
// // before we can fully enabled this check // before we can fully enabled this check
// // //
// // No idea how findbugs was missing these b4 // No idea how findbugs was missing these b4
// ignoreFailures = true ignoreFailures = true
//} }
//
//task forbiddenApisNonPortable(type: CheckForbiddenApis, dependsOn: compileJava) { task forbiddenApisNonPortable(type: CheckForbiddenApis, dependsOn: compileJava) {
// classesDirs = project.sourceSets.main.output.classesDirs classesDirs = project.sourceSets.main.output.classesDirs
// classpath = project.sourceSets.main.compileClasspath + project.sourceSets.main.runtimeClasspath classpath = project.sourceSets.main.compileClasspath + project.sourceSets.main.runtimeClasspath
// targetCompatibility = project.forbiddenAPITargetJDKCompatibility targetCompatibility = project.forbiddenAPITargetJDKCompatibility
// bundledSignatures += 'jdk-non-portable' bundledSignatures += 'jdk-non-portable'
//} }
//
//task forbiddenApis task forbiddenApis
//project.tasks.withType( CheckForbiddenApis ).each { task -> forbiddenApis.finalizedBy task } project.tasks.withType( CheckForbiddenApis ).each { task -> forbiddenApis.finalizedBy task }
//
//project.tasks.check.finalizedBy forbiddenApis project.tasks.check.finalizedBy forbiddenApis

View File

@ -16,6 +16,7 @@ import org.hibernate.dialect.Dialect;
import org.hibernate.engine.config.spi.ConfigurationService; import org.hibernate.engine.config.spi.ConfigurationService;
import org.hibernate.engine.query.spi.NativeQueryInterpreter; import org.hibernate.engine.query.spi.NativeQueryInterpreter;
import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.util.config.ConfigurationHelper; import org.hibernate.internal.util.config.ConfigurationHelper;
import org.hibernate.metamodel.model.domain.JpaMetamodel; import org.hibernate.metamodel.model.domain.JpaMetamodel;
import org.hibernate.query.QueryLogger; import org.hibernate.query.QueryLogger;
@ -37,6 +38,8 @@ import org.hibernate.service.ServiceRegistry;
import java.util.Map; import java.util.Map;
import java.util.function.Supplier; import java.util.function.Supplier;
import org.jboss.logging.Logger;
/** /**
* Aggregation and encapsulation of the components Hibernate uses * Aggregation and encapsulation of the components Hibernate uses
* to execute queries (HQL, Criteria and native) * to execute queries (HQL, Criteria and native)
@ -45,6 +48,7 @@ import java.util.function.Supplier;
*/ */
@Incubating @Incubating
public class QueryEngine { public class QueryEngine {
private static final Logger LOG_HQL_FUNCTIONS = CoreLogging.logger( "org.hibernate.LOG_HQL_FUNCTIONS" );
public static QueryEngine from( public static QueryEngine from(
SessionFactoryImplementor sessionFactory, SessionFactoryImplementor sessionFactory,
@ -119,7 +123,7 @@ public class QueryEngine {
); );
if ( showSQLFunctions ) { if ( showSQLFunctions ) {
sqmFunctionRegistry.getFunctionsByName().forEach( sqmFunctionRegistry.getFunctionsByName().forEach(
entry -> System.out.println( entry.getValue().getSignature( entry.getKey() ) ) entry -> LOG_HQL_FUNCTIONS.info( entry.getValue().getSignature( entry.getKey() ) )
); );
} }
} }