HHH-18306 - Implicit instantiation for queries with single selection item broken

HHH-18401 - SelectionQuery needs better validation of query return type
This commit is contained in:
Steve Ebersole 2024-07-18 19:43:48 -05:00
parent bfd63ec5a5
commit e136e5b04c
2 changed files with 15 additions and 36 deletions

View File

@ -14,7 +14,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'de.thetaphi:forbiddenapis:3.5.1'
classpath 'de.thetaphi:forbiddenapis:3.7'
}
}
@ -32,6 +32,7 @@ apply plugin: 'org.hibernate.orm.database-service'
apply plugin: 'org.hibernate.orm.build.java-module'
apply plugin: 'org.checkerframework'
apply plugin: 'de.thetaphi.forbiddenapis'
apply plugin: "jacoco"
apply plugin: 'checkstyle'
@ -488,43 +489,20 @@ checkerFramework {
]
}
tasks.forbiddenApisMain {
// unfortunately we currently have many uses of default Locale implicitly (~370)
// which need to be fixed before we can enable the "unsafe" check
//bundledSignatures += ["jdk-system-out", "jdk-non-portable", "jdk-unsafe-${jdkVersions.baseline}"]
bundledSignatures += ["jdk-system-out", "jdk-non-portable"]
task forbiddenApisSystemOut(type: CheckForbiddenApis, dependsOn: compileJava) {
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",
"org.hibernate.internal.build.AllowNonPortable"
]
}
task forbiddenApisUnsafe(type: CheckForbiddenApis, dependsOn: compileJava) {
bundledSignatures += "jdk-unsafe-${jdkVersions.baseline}".toString()
// unfortunately we currently have many uses of default Locale implicitly (~370) which need to be fixed
// before we can fully enabled this check
//
// No idea how findbugs was missing these b4
ignoreFailures = true
tasks.forbiddenApisTest {
enabled = false
}
task forbiddenApisNonPortable(type: CheckForbiddenApis, dependsOn: compileJava) {
bundledSignatures += 'jdk-non-portable'
suppressAnnotations += ['org.hibernate.internal.build.AllowNonPortable']
}
task forbiddenApis {
description 'Grouping task for all defined forbidden-apis tasks'
}
project.tasks.withType( CheckForbiddenApis ) {
outputs.upToDateWhen { true }
classesDirs = project.sourceSets.main.output
classpath = configurations.runtimeClasspath + configurations.compileClasspath
targetCompatibility = project.forbiddenAPITargetJDKCompatibility
// This slows down the checks a little, but is necessary to avoid the gradle daemon holding on
// to class definitions loaded previously - even possibly in a previous build.
disableClassloadingCache = true
tasks.forbiddenApis.finalizedBy it
}
project.tasks.check.finalizedBy tasks.forbiddenApis

View File

@ -80,6 +80,7 @@ public class SchemaCreateHelper {
);
}
@AllowSysOut
public static void createOnlyToStdOut(Metadata metadata, ServiceRegistry serviceRegistry) {
createOnlyToWriter( metadata, serviceRegistry, new OutputStreamWriter( System.out ) );
}