diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3759dd695..1461facf2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,12 +59,18 @@ Every metadata has an entry in the `metadata/index.json`. For example: "module": "org.example:dependant-library", "requires": [ "org.example:library" - ] + ], + "allowed-packages": [ + "org.package.name" + ] } ] ``` -Note that `dependant-library` can feature its own metadata as well if `directory` key is specified. +**Note:** `dependant-library` can feature its own metadata as well if `directory` key is specified. + +**Note:** `allowed-packages` describes which packages are expected to contain metadata entries. This way you can prevent metadata from other libraries to be +pulled into your config files Every library metadata has another `index.json` file. In aforementioned case that would be `metadata/org.example/library/index.json`. diff --git a/metadata/com.sun.mail/jakarta.mail/2.0.1/reflect-config.json b/metadata/com.sun.mail/jakarta.mail/2.0.1/reflect-config.json index a1ac636dd..26bfa3cf0 100644 --- a/metadata/com.sun.mail/jakarta.mail/2.0.1/reflect-config.json +++ b/metadata/com.sun.mail/jakarta.mail/2.0.1/reflect-config.json @@ -27,13 +27,6 @@ "allDeclaredConstructors": true, "name": "com.sun.mail.handlers.message_rfc822" }, - { - "condition": { - "typeReachable": "jakarta.activation.MailcapCommandMap" - }, - "allDeclaredConstructors": true, - "name": "com.sun.mail.handlers.message_rfc822" - }, { "condition": { "typeReachable": "jakarta.activation.MailcapCommandMap" diff --git a/metadata/com.sun.mail/jakarta.mail/2.0.1/resource-config.json b/metadata/com.sun.mail/jakarta.mail/2.0.1/resource-config.json index 0963dba51..c01c59f1a 100644 --- a/metadata/com.sun.mail/jakarta.mail/2.0.1/resource-config.json +++ b/metadata/com.sun.mail/jakarta.mail/2.0.1/resource-config.json @@ -1,24 +1,41 @@ - { "resources": { "includes": [ { - "pattern": "\\QMETA-INF/hk2-locator/default\\E" + "pattern": "\\QMETA-INF/hk2-locator/default\\E", + "condition": { + "typeReachable": "jakarta.mail.Session" + } }, { - "pattern": "\\QMETA-INF/gfprobe-provider.xml\\E" + "pattern": "\\QMETA-INF/gfprobe-provider.xml\\E", + "condition": { + "typeReachable": "jakarta.mail.Session" + } }, { - "pattern": "\\QMETA-INF/javamail.charset.map\\E" + "pattern": "\\QMETA-INF/javamail.charset.map\\E", + "condition": { + "typeReachable": "jakarta.mail.Session" + } }, { - "pattern": "\\QMETA-INF/javamail.default.address.map\\E" + "pattern": "\\QMETA-INF/javamail.default.address.map\\E", + "condition": { + "typeReachable": "jakarta.mail.Session" + } }, { - "pattern": "\\QMETA-INF/javamail.default.providers\\E" + "pattern": "\\QMETA-INF/javamail.default.providers\\E", + "condition": { + "typeReachable": "jakarta.mail.Session" + } }, { - "pattern": "\\QMETA-INF/mailcap\\E" + "pattern": "\\QMETA-INF/mailcap\\E", + "condition": { + "typeReachable": "jakarta.mail.Session" + } } ] } diff --git a/metadata/com.zaxxer/HikariCP/5.0.1/jni-config.json b/metadata/com.zaxxer/HikariCP/5.0.1/jni-config.json index 017be3a67..55a29bfb6 100644 --- a/metadata/com.zaxxer/HikariCP/5.0.1/jni-config.json +++ b/metadata/com.zaxxer/HikariCP/5.0.1/jni-config.json @@ -1,5 +1,8 @@ [ { + "condition": { + "typeReachable": "java.lang.ClassLoader" + }, "name": "java.lang.ClassLoader", "methods": [ { @@ -15,6 +18,9 @@ ] }, { + "condition": { + "typeReachable": "jdk.internal.loader.ClassLoaders" + }, "name": "jdk.internal.loader.ClassLoaders$PlatformClassLoader" } ] diff --git a/metadata/index.json b/metadata/index.json index 98e0bbfbc..af93b67a8 100644 --- a/metadata/index.json +++ b/metadata/index.json @@ -1,53 +1,98 @@ [ { "directory": "org.example/library", - "module": "org.example:library" + "module": "org.example:library", + "allowed-packages": [ + "org.example" + ] }, { "directory": "org.jline/jline", - "module": "org.jline:jline" + "module": "org.jline:jline", + "allowed-packages": [ + "org.jline", + "org.fusesource" + ] }, { "module": "org.jline:jline-terminal", "requires": [ "org.jline:jline" + ], + "allowed-packages": [ + "org.jline", + "org.fusesource" ] }, { "module": "org.jline:jline-console", "requires": [ "org.jline:jline" + ], + "allowed-packages": [ + "org.jline", + "org.fusesource" ] }, { "directory" : "org.jooq/jooq", - "module" : "org.jooq:jooq" + "module" : "org.jooq:jooq", + "allowed-packages": [ + "org.jooq" + ] }, { "directory": "com.h2database/h2", - "module": "com.h2database:h2" + "module": "com.h2database:h2", + "allowed-packages": [ + "org.h2" + ] }, { "directory" : "com.microsoft.sqlserver/mssql-jdbc", - "module" : "com.microsoft.sqlserver:mssql-jdbc" + "module" : "com.microsoft.sqlserver:mssql-jdbc", + "allowed-packages": [ + "com.microsoft.sqlserver" + ] }, { "directory": "org.opengauss/opengauss-jdbc", - "module": "org.opengauss:opengauss-jdbc" + "module": "org.opengauss:opengauss-jdbc", + "allowed-packages": [ + "org.opengauss" + ] }, { "directory": "org.hdrhistogram/HdrHistogram", - "module": "org.hdrhistogram:HdrHistogram" + "module": "org.hdrhistogram:HdrHistogram", + "allowed-packages": [ + "org.HdrHistogram" + ] }, { "directory": "org.hibernate.orm/hibernate-core", - "module": "org.hibernate.orm:hibernate-core" + "module": "org.hibernate.orm:hibernate-core", + "allowed-packages": [ + "org.hibernate", + "jakarta", + "org.h2.Driver", + "org.postgresql.Driver", + "com.mysql.cj.jdbc.Driver", + "org.hsqldb.jdbc.JDBCDriver", + "com.microsoft.sqlserver.jdbc.SQLServerDriver", + "oracle.jdbc.driver.OracleDriver", + "org.mariadb.jdbc.Driver" + ] }, { "directory": "org.hibernate.orm/hibernate-envers", "module": "org.hibernate.orm:hibernate-envers", "requires": [ "org.hibernate.orm:hibernate-core" + ], + "allowed-packages": [ + "org.hibernate", + "jakarta" ] }, { @@ -55,11 +100,19 @@ "module": "org.hibernate.validator:hibernate-validator", "requires": [ "org.jboss.logging:jboss-logging" + ], + "allowed-packages": [ + "org.hibernate", + "jakarta" ] }, { "directory": "org.apache.tomcat.embed/tomcat-embed-core", - "module": "org.apache.tomcat.embed:tomcat-embed-core" + "module": "org.apache.tomcat.embed:tomcat-embed-core", + "allowed-packages": [ + "org.apache.tomcat", + "org.apache.catalina" + ] }, { "directory" : "org.apache.tomcat/tomcat-jdbc", @@ -67,139 +120,256 @@ }, { "directory": "com.google.protobuf/protobuf-java-util", - "module": "com.google.protobuf:protobuf-java-util" + "module": "com.google.protobuf:protobuf-java-util", + "allowed-packages": [ + "com.google.protobuf" + ] }, { "directory": "io.grpc/grpc-netty", - "module": "io.grpc:grpc-netty" + "module": "io.grpc:grpc-netty", + "allowed-packages": [ + "io.grpc" + ] }, { "directory": "io.netty/netty-common", - "module": "io.netty:netty-common" + "module": "io.netty:netty-common", + "allowed-packages": [ + "io.netty" + ] }, { "directory": "io.netty/netty-transport", - "module": "io.netty:netty-transport" + "module": "io.netty:netty-transport", + "allowed-packages": [ + "io.netty" + ] }, { "directory": "mysql/mysql-connector-java", - "module": "mysql:mysql-connector-java" + "module": "mysql:mysql-connector-java", + "allowed-packages": [ + "mysql" + ] }, { "directory": "com.mysql/mysql-connector-j", - "module": "com.mysql:mysql-connector-j" + "module": "com.mysql:mysql-connector-j", + "allowed-packages": [ + "com.mysql" + ] }, { "directory": "org.postgresql/postgresql", - "module": "org.postgresql:postgresql" + "module": "org.postgresql:postgresql", + "allowed-packages": [ + "org.postgresql" + ] }, { "directory": "org.apache.commons/commons-pool2", - "module": "org.apache.commons:commons-pool2" + "module": "org.apache.commons:commons-pool2", + "allowed-packages": [ + "org.apache.commons" + ] }, { "directory": "ch.qos.logback/logback-classic", - "module": "ch.qos.logback:logback-classic" + "module": "ch.qos.logback:logback-classic", + "allowed-packages": [ + "ch.qos.logback" + ] }, { "directory": "com.zaxxer/HikariCP", - "module": "com.zaxxer:HikariCP" + "module": "com.zaxxer:HikariCP", + "allowed-packages": [ + "com.zaxxer", + "jdk.internal" + ] }, { "directory": "com.github.ben-manes.caffeine/caffeine", - "module": "com.github.ben-manes.caffeine:caffeine" + "module": "com.github.ben-manes.caffeine:caffeine", + "allowed-packages": [ + "com.github.benmanes.caffeine" + ] }, { "directory": "org.jetbrains.kotlin/kotlin-stdlib", - "module": "org.jetbrains.kotlin:kotlin-stdlib" + "module": "org.jetbrains.kotlin:kotlin-stdlib", + "allowed-packages": [ + "kotlin" + ] }, { "directory": "org.jetbrains.kotlin/kotlin-reflect", - "module": "org.jetbrains.kotlin:kotlin-reflect" + "module": "org.jetbrains.kotlin:kotlin-reflect", + "allowed-packages": [ + "kotlin" + ] }, { "directory": "com.hazelcast/hazelcast", - "module": "com.hazelcast:hazelcast" + "module": "com.hazelcast:hazelcast", + "allowed-packages": [ + "com.hazelcast" + ] }, { "directory": "org.quartz-scheduler/quartz", - "module": "org.quartz-scheduler:quartz" + "module": "org.quartz-scheduler:quartz", + "allowed-packages": [ + "org.quartz" + ] }, { "directory": "org.mariadb.jdbc/mariadb-java-client", - "module": "org.mariadb.jdbc:mariadb-java-client" + "module": "org.mariadb.jdbc:mariadb-java-client", + "allowed-packages": [ + "org.mariadb" + ] }, { "directory": "org.flywaydb/flyway-core", - "module": "org.flywaydb:flyway-core" + "module": "org.flywaydb:flyway-core", + "allowed-packages": [ + "org.flywaydb", + "org.apache", + "org.slf4j" + ] }, { "directory": "javax.cache/cache-api", - "module": "javax.cache:cache-api" + "module": "javax.cache:cache-api", + "allowed-packages": [ + "javax.cache" + ] }, { "directory": "com.sun.mail/jakarta.mail", - "module": "com.sun.mail:jakarta.mail" + "module": "com.sun.mail:jakarta.mail", + "allowed-packages": [ + "com.sun.mail", + "jakarta" + ] }, { "directory": "org.glassfish.jaxb/jaxb-runtime", - "module": "org.glassfish.jaxb:jaxb-runtime" + "module": "org.glassfish.jaxb:jaxb-runtime", + "allowed-packages": [ + "org.glassfish.jaxb", + "jakarta.xml" + ] }, { "directory" : "org.hibernate/hibernate-core", - "module" : "org.hibernate:hibernate-core" + "module" : "org.hibernate:hibernate-core", + "allowed-packages": [ + "org.hibernate", + "jakarta", + "org.h2.Driver", + "org.postgresql.Driver", + "com.mysql.cj.jdbc.Driver", + "org.hsqldb.jdbc.JDBCDriver", + "com.microsoft.sqlserver.jdbc.SQLServerDriver", + "oracle.jdbc.driver.OracleDriver", + "org.mariadb.jdbc.Driver" + ] }, { "directory": "org.thymeleaf/thymeleaf", - "module": "org.thymeleaf:thymeleaf" + "module": "org.thymeleaf:thymeleaf", + "allowed-packages": [ + "org.thymeleaf" + ] }, { "directory": "org.thymeleaf/thymeleaf-spring6", - "module": "org.thymeleaf:thymeleaf-spring6" + "module": "org.thymeleaf:thymeleaf-spring6", + "allowed-packages": [ + "org.thymeleaf" + ] }, { "directory": "org.freemarker/freemarker", - "module": "org.freemarker:freemarker" + "module": "org.freemarker:freemarker", + "allowed-packages": [ + "org.freemarker" + ] }, { "directory": "com.ecwid.consul/consul-api", - "module": "com.ecwid.consul:consul-api" + "module": "com.ecwid.consul:consul-api", + "allowed-packages": [ + "com.ecwid" + ] }, { "directory": "io.undertow/undertow-core", - "module": "io.undertow:undertow-core" + "module": "io.undertow:undertow-core", + "allowed-packages": [ + "io.undertow" + ] }, { "directory": "org.thymeleaf.extras/thymeleaf-extras-springsecurity6", - "module": "org.thymeleaf.extras:thymeleaf-extras-springsecurity6" + "module": "org.thymeleaf.extras:thymeleaf-extras-springsecurity6", + "allowed-packages": [ + "org.thymeleaf", + "org.springframework" + ] }, { "directory": "org.eclipse.jetty/jetty-server", - "module": "org.eclipse.jetty:jetty-server" + "module": "org.eclipse.jetty:jetty-server", + "allowed-packages": [ + "org.eclipse" + ] }, { "directory": "org.liquibase/liquibase-core", - "module": "org.liquibase:liquibase-core" + "module": "org.liquibase:liquibase-core", + "allowed-packages": [ + "org.liquibase", + "liquibase" + ] }, { "directory": "org.jboss.logging/jboss-logging", - "module": "org.jboss.logging:jboss-logging" + "module": "org.jboss.logging:jboss-logging", + "allowed-packages": [ + "org.jboss" + ] }, { "directory": "com.graphql-java/graphql-java", - "module": "com.graphql-java:graphql-java" + "module": "com.graphql-java:graphql-java", + "allowed-packages": [ + "graphql" + ] }, { "directory": "io.jsonwebtoken/jjwt-jackson", - "module": "io.jsonwebtoken:jjwt-jackson" + "module": "io.jsonwebtoken:jjwt-jackson", + "allowed-packages": [ + "io.jsonwebtoken" + ] }, { "directory": "io.jsonwebtoken/jjwt-orgjson", - "module": "io.jsonwebtoken:jjwt-orgjson" + "module": "io.jsonwebtoken:jjwt-orgjson", + "allowed-packages": [ + "io.jsonwebtoken" + ] }, { "directory": "io.jsonwebtoken/jjwt-gson", - "module": "io.jsonwebtoken:jjwt-gson" + "module": "io.jsonwebtoken:jjwt-gson", + "allowed-packages": [ + "io.jsonwebtoken" + ] }, { "directory": "com.graphql-java/graphql-java-extended-validation", @@ -207,70 +377,121 @@ "requires": [ "com.graphql-java:graphql-java", "org.hibernate.validator:hibernate-validator" + ], + "allowed-packages": [ + "graphql" ] }, { "directory": "net.java.dev.jna/jna", - "module": "net.java.dev.jna:jna" + "module": "net.java.dev.jna:jna", + "allowed-packages": [ + "com.sun.jna" + ] }, { "directory": "com.github.luben/zstd-jni", - "module": "com.github.luben:zstd-jni" + "module": "com.github.luben:zstd-jni", + "allowed-packages": [ + "com.github.luben" + ] }, { "directory": "org.testcontainers/testcontainers", - "module": "org.testcontainers:testcontainers" + "module": "org.testcontainers:testcontainers", + "allowed-packages": [ + "org.testcontainers" + ] }, { "directory": "org.ehcache/ehcache", - "module": "org.ehcache:ehcache" + "module": "org.ehcache:ehcache", + "allowed-packages": [ + "org.ehcache" + ] }, { "directory": "org.mockito/mockito-core", - "module": "org.mockito:mockito-core" + "module": "org.mockito:mockito-core", + "allowed-packages": [ + "org.mockito" + ] }, { "directory": "org.eclipse.jetty/jetty-client", - "module": "org.eclipse.jetty:jetty-client" + "module": "org.eclipse.jetty:jetty-client", + "allowed-packages": [ + "org.eclipse.jetty" + ] }, { "directory": "io.opentelemetry/opentelemetry-exporter-jaeger", - "module": "io.opentelemetry:opentelemetry-exporter-jaeger" + "module": "io.opentelemetry:opentelemetry-exporter-jaeger", + "allowed-packages": [ + "io.opentelemetry" + ] }, { - "directory": "io.opentelemetry/opentelemetry-exporter-logging", - "module": "io.opentelemetry:opentelemetry-exporter-logging" + "directory": "io.opentelemetry/opentelemetry-exporter-logging", + "module": "io.opentelemetry:opentelemetry-exporter-logging", + "allowed-packages": [ + "io.opentelemetry" + ] }, { - "directory": "io.opentelemetry/opentelemetry-exporter-otlp", - "module": "io.opentelemetry:opentelemetry-exporter-otlp" + "directory": "io.opentelemetry/opentelemetry-exporter-otlp", + "module": "io.opentelemetry:opentelemetry-exporter-otlp", + "allowed-packages": [ + "io.opentelemetry" + ] }, { - "directory": "io.opentelemetry/opentelemetry-exporter-zipkin", - "module": "io.opentelemetry:opentelemetry-exporter-zipkin" + "directory": "io.opentelemetry/opentelemetry-exporter-zipkin", + "module": "io.opentelemetry:opentelemetry-exporter-zipkin", + "allowed-packages": [ + "io.opentelemetry" + ] }, { - "directory": "io.opentelemetry/opentelemetry-sdk-metrics", - "module": "io.opentelemetry:opentelemetry-sdk-metrics" + "directory": "io.opentelemetry/opentelemetry-sdk-metrics", + "module": "io.opentelemetry:opentelemetry-sdk-metrics", + "allowed-packages": [ + "io.opentelemetry" + ] }, { "directory": "io.opentelemetry/opentelemetry-sdk-trace", - "module": "io.opentelemetry:opentelemetry-sdk-trace" + "module": "io.opentelemetry:opentelemetry-sdk-trace", + "allowed-packages": [ + "io.opentelemetry" + ] }, { "directory" : "jakarta.servlet/jakarta.servlet-api", - "module" : "jakarta.servlet:jakarta.servlet-api" + "module" : "jakarta.servlet:jakarta.servlet-api", + "allowed-packages": [ + "jakarta.servlet" + ] }, { "directory" : "samples/docker", - "module" : "samples:docker" + "module" : "samples:docker", + "allowed-packages": [ + "samples" + ] }, { "directory" : "org.mariadb/r2dbc-mariadb", - "module" : "org.mariadb:r2dbc-mariadb" + "module" : "org.mariadb:r2dbc-mariadb", + "allowed-packages": [ + "org.mariadb" + ] }, { "directory" : "org.jboss.spec.javax.servlet/jboss-servlet-api_4.0_spec", - "module" : "org.jboss.spec.javax.servlet:jboss-servlet-api_4.0_spec" + "module" : "org.jboss.spec.javax.servlet:jboss-servlet-api_4.0_spec", + "allowed-packages": [ + "org.jboss" + ] } ] diff --git a/metadata/org.hibernate.orm/hibernate-core/6.1.1.Final/reflect-config.json b/metadata/org.hibernate.orm/hibernate-core/6.1.1.Final/reflect-config.json index 8567c9f57..bbd7b7e32 100644 --- a/metadata/org.hibernate.orm/hibernate-core/6.1.1.Final/reflect-config.json +++ b/metadata/org.hibernate.orm/hibernate-core/6.1.1.Final/reflect-config.json @@ -713,36 +713,6 @@ "typeReachable": "org.hibernate.jpa.HibernatePersistenceProvider" } }, - { - "name": "[Lorg.h2.engine.SessionLocal;", - "condition": { - "typeReachable": "org.h2.Driver" - } - }, - { - "name": "[Lorg.h2.expression.Expression;", - "condition": { - "typeReachable": "org.h2.Driver" - } - }, - { - "name": "[Lorg.h2.table.Column;", - "condition": { - "typeReachable": "org.h2.Driver" - } - }, - { - "name": "[Lorg.h2.table.Table;", - "condition": { - "typeReachable": "org.h2.Driver" - } - }, - { - "name": "[Lorg.h2.table.TableFilter;", - "condition": { - "typeReachable": "org.h2.Driver" - } - }, { "name": "[Lorg.hibernate.SessionFactoryObserver;", "condition": { @@ -1983,100 +1953,6 @@ "typeReachable": "org.hibernate.jpa.boot.spi.Bootstrap" } }, - { - "name": "org.h2.Driver", - "condition": { - "typeReachable": "org.h2.Driver" - }, - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "name": "org.h2.command.Parser", - "condition": { - "typeReachable": "org.h2.Driver" - } - }, - { - "name": "org.h2.engine.SessionLocal", - "condition": { - "typeReachable": "org.h2.Driver" - } - }, - { - "name": "org.h2.jdbc.JdbcClob", - "condition": { - "typeReachable": "org.h2.Driver" - } - }, - { - "name": "org.h2.jdbc.JdbcConnection", - "queriedMethods": [ - { - "name": "getSchema", - "parameterTypes": [] - } - ], - "condition": { - "typeReachable": "org.h2.Driver" - } - }, - { - "name": "org.h2.jdbc.JdbcConnection", - "condition": { - "typeReachable": "org.h2.Driver" - } - }, - { - "name": "org.h2.jdbc.JdbcLob", - "condition": { - "typeReachable": "org.h2.Driver" - }, - "methods": [ - { - "name": "free", - "parameterTypes": [] - } - ] - }, - { - "name": "org.h2.jdbc.JdbcStatement", - "condition": { - "typeReachable": "org.h2.Driver" - } - }, - { - "name": "org.h2.message.DbException", - "condition": { - "typeReachable": "org.h2.Driver" - } - }, - { - "name": "org.h2.mvstore.MVStore$TxCounter", - "fields": [ - { - "name": "counter" - } - ], - "condition": { - "typeReachable": "org.h2.Driver" - } - }, - { - "name": "org.h2.mvstore.Page", - "fields": [ - { - "name": "pos" - } - ], - "condition": { - "typeReachable": "org.h2.Driver" - } - }, { "name": "org.hibernate.CacheMode", "condition": { @@ -11730,33 +11606,33 @@ }, { "condition": { - "typeReachable": "org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl" + "typeReachable": "org.hibernate.dialect.MySQLDialect" }, - "name": "org.hibernate.dialect.MariaDB103Dialect", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] + "name": "[Ljava.lang.Class;" }, { "condition": { - "typeReachable": "org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl" + "typeReachable": "com.mysql.cj.jdbc.Driver" }, - "name": "org.hibernate.dialect.MariaDB106Dialect", + "name": "org.hibernate.dialect.MySQLDialect", "methods": [ { "name": "", "parameterTypes": [] + }, + { + "name": "", + "parameterTypes": [ + "org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo" + ] } ] }, { "condition": { - "typeReachable": "org.mariadb.jdbc.Driver" + "typeReachable": "org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl" }, - "name": "org.mariadb.jdbc.Driver", + "name": "org.hibernate.dialect.MySQL57Dialect", "methods": [ { "name": "", @@ -11766,153 +11642,151 @@ }, { "condition": { - "typeReachable": "org.mariadb.jdbc.Driver" + "typeReachable": "org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl" }, - "name": "org.mariadb.jdbc.MariaDbBlob", + "name": "org.hibernate.dialect.MySQL8Dialect", "methods": [ { - "name": "free", + "name": "", "parameterTypes": [] } ] }, { "condition": { - "typeReachable": "org.mariadb.jdbc.Driver" + "typeReachable": "com.mysql.cj.jdbc.Driver" }, - "name": "org.mariadb.jdbc.MariaDbClob" + "name": "org.hibernate.dialect.MySQLDialect" }, { "condition": { - "typeReachable": "org.mariadb.jdbc.Driver" + "typeReachable": "com.mysql.cj.jdbc.Driver" }, - "name": "org.mariadb.jdbc.MariaDbConnection", - "queriedMethods": [ + "name": "org.hibernate.dialect.MySQLDialect", + "methods": [ { - "name": "getSchema", + "name": "", "parameterTypes": [] } ] }, { "condition": { - "typeReachable": "org.mariadb.jdbc.Driver" + "typeReachable": "org.hibernate.boot.internal.MetadataBuilderImpl" }, - "name": "org.mariadb.jdbc.MariaDbStatement" + "name": "org.hibernate.dialect.CockroachDialect", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo" + ] + } + ] }, { "condition": { - "typeReachable": "org.mariadb.jdbc.Driver" + "typeReachable": "org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl" }, - "name": "org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol" + "name": "org.hibernate.dialect.CockroachDialect", + "methods": [ + { + "name": "", + "parameterTypes": [ + "org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo" + ] + } + ] }, { + "name": "org.hibernate.dialect.CockroachDialect", "condition": { - "typeReachable": "org.mariadb.jdbc.Driver" - }, - "name": "org.mariadb.jdbc.internal.util.LogQueryTool" + "typeReachable": "org.hibernate.internal.util.ReflectHelper" + } }, { + "name": "org.hibernate.dialect.CockroachDialect", "condition": { - "typeReachable": "org.mariadb.jdbc.Driver" + "typeReachable": "org.hibernate.boot.registry.selector.internal.StrategySelectorImpl" }, - "name": "org.mariadb.jdbc.internal.util.Options", - "fields": [ - { - "name": "password" - }, + "methods": [ { - "name": "user" + "name": "", + "parameterTypes": [] } ] }, { "condition": { - "typeReachable": "org.mariadb.jdbc.Driver" + "typeReachable": "org.hibernate.dialect.sequence.HSQLSequenceSupport" }, - "name": "org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper" + "name": "[Ljava.lang.Class;" }, { "condition": { - "typeReachable": "org.hibernate.dialect.MySQLDialect" + "typeReachable": "org.hsqldb.jdbc.JDBCDriver" }, - "name": "[Ljava.lang.Class;" + "name": "org.hibernate.dialect.HSQLDialect" }, { "condition": { - "typeReachable": "com.mysql.cj.jdbc.Driver" + "typeReachable": "org.hsqldb.jdbc.JDBCDriver" }, - "name": "com.mysql.cj.jdbc.Clob", + "name": "org.hibernate.dialect.HSQLDialect", "methods": [ { - "name": "free", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "com.mysql.cj.jdbc.Driver" - }, - "name": "com.mysql.cj.jdbc.ConnectionImpl", - "queriedMethods": [ + "name": "", + "parameterTypes": [ + "org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo" + ] + }, { - "name": "getSchema", + "name": "", "parameterTypes": [] } ] }, { "condition": { - "typeReachable": "com.mysql.cj.jdbc.Driver" + "typeReachable": "org.hsqldb.jdbc.JDBCDriver" }, - "name": "com.mysql.cj.jdbc.Driver", + "name": "org.hibernate.internal.CoreMessageLogger_$logger", "methods": [ { "name": "", - "parameterTypes": [] + "parameterTypes": [ + "org.jboss.logging.Logger" + ] } ] }, { "condition": { - "typeReachable": "com.mysql.cj.jdbc.Driver" + "typeReachable": "org.hibernate.dialect.OracleDialect" }, - "name": "com.mysql.cj.log.StandardLogger", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] + "name": "[Ljava.lang.Class;" }, { "condition": { - "typeReachable": "com.mysql.cj.jdbc.Driver" + "typeReachable": "org.hibernate.dialect.temptable.StandardTemporaryTableExporter" }, - "name": "com.mysql.cj.protocol.StandardSocketFactory", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] + "name": "[Ljava.lang.Class;" }, { "condition": { - "typeReachable": "com.mysql.cj.jdbc.Driver" + "typeReachable": "oracle.jdbc.driver.OracleDriver" }, - "name": "org.hibernate.dialect.MySQLDialect", + "name": "org.hibernate.dialect.OracleDialect", "methods": [ - { - "name": "", - "parameterTypes": [] - }, { "name": "", "parameterTypes": [ "org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo" ] + }, + { + "name": "", + "parameterTypes": [] } ] }, @@ -11920,7 +11794,7 @@ "condition": { "typeReachable": "org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl" }, - "name": "org.hibernate.dialect.MySQL57Dialect", + "name": "org.hibernate.dialect.Oracle10gDialect", "methods": [ { "name": "", @@ -11932,7 +11806,7 @@ "condition": { "typeReachable": "org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl" }, - "name": "org.hibernate.dialect.MySQL8Dialect", + "name": "org.hibernate.dialect.Oracle12cDialect", "methods": [ { "name": "", @@ -11941,421 +11815,20 @@ ] }, { + "name": "org.hibernate.dialect.OracleDialect", "condition": { - "typeReachable": "com.mysql.cj.jdbc.Driver" + "typeReachable": "org.hibernate.internal.util.ReflectHelper" + } + }, + { + "condition": { + "typeReachable": "org.hibernate.dialect.SQLServerDialect" }, - "name": "org.hibernate.dialect.MySQLDialect" + "name": "[Ljava.lang.Class;" }, { "condition": { - "typeReachable": "com.mysql.cj.jdbc.Driver" - }, - "name": "org.hibernate.dialect.MySQLDialect", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "org.hibernate.boot.internal.MetadataBuilderImpl" - }, - "name": "org.hibernate.dialect.CockroachDialect", - "methods": [ - { - "name": "", - "parameterTypes": [ - "org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo" - ] - } - ] - }, - { - "condition": { - "typeReachable": "org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl" - }, - "name": "org.hibernate.dialect.CockroachDialect", - "methods": [ - { - "name": "", - "parameterTypes": [ - "org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo" - ] - } - ] - }, - { - "name": "org.hibernate.dialect.CockroachDialect", - "condition": { - "typeReachable": "org.hibernate.internal.util.ReflectHelper" - } - }, - { - "name": "org.hibernate.dialect.CockroachDialect", - "condition": { - "typeReachable": "org.hibernate.boot.registry.selector.internal.StrategySelectorImpl" - }, - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "org.hibernate.dialect.sequence.HSQLSequenceSupport" - }, - "name": "[Ljava.lang.Class;" - }, - { - "condition": { - "typeReachable": "org.hsqldb.jdbc.JDBCDriver" - }, - "name": "[Lorg.hsqldb.Constraint;" - }, - { - "condition": { - "typeReachable": "org.hsqldb.jdbc.JDBCDriver" - }, - "name": "[Lorg.hsqldb.index.Index;" - }, - { - "condition": { - "typeReachable": "org.hsqldb.jdbc.JDBCDriver" - }, - "name": "org.hibernate.dialect.HSQLDialect" - }, - { - "condition": { - "typeReachable": "org.hsqldb.jdbc.JDBCDriver" - }, - "name": "org.hibernate.dialect.HSQLDialect", - "methods": [ - { - "name": "", - "parameterTypes": [ - "org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo" - ] - }, - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "org.hsqldb.jdbc.JDBCDriver" - }, - "name": "org.hibernate.internal.CoreMessageLogger_$logger", - "methods": [ - { - "name": "", - "parameterTypes": [ - "org.jboss.logging.Logger" - ] - } - ] - }, - { - "condition": { - "typeReachable": "org.hsqldb.jdbc.JDBCDriver" - }, - "name": "org.hsqldb.jdbc.JDBCClob", - "methods": [ - { - "name": "free", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "org.hsqldb.jdbc.JDBCDriver" - }, - "name": "org.hsqldb.jdbc.JDBCConnection", - "queriedMethods": [ - { - "name": "getSchema", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "org.hsqldb.jdbc.JDBCDriver" - }, - "name": "org.hsqldb.jdbc.JDBCDriver", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "org.hsqldb.jdbc.JDBCDriver" - }, - "name": "org.hsqldb.persist.HsqlDatabaseProperties", - "fields": [ - { - "name": "THIS_VERSION" - } - ] - }, - { - "condition": { - "typeReachable": "org.hibernate.dialect.OracleDialect" - }, - "name": "[Ljava.lang.Class;" - }, - { - "condition": { - "typeReachable": "org.hibernate.dialect.temptable.StandardTemporaryTableExporter" - }, - "name": "[Ljava.lang.Class;" - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.jdbc.OracleConnection", - "queriedMethods": [ - { - "name": "createOracleArray", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.jdbc.OracleDriver" - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.jdbc.OracleDriver", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.jdbc.driver.OracleStatement" - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.jdbc.driver.OracleStatementWrapper" - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.jdbc.driver.PhysicalConnection", - "queriedMethods": [ - { - "name": "getSchema", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.jdbc.driver.T4C8Oall" - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.jdbc.driver.T4CConnection" - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.jdbc.driver.T4CDriverExtension", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.jdbc.driver.T4CStatement" - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.jdbc.driver.T4CTTIfun" - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.jdbc.driver.T4CTTIoer11" - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.jdbc.internal.OracleConnection$TransactionState", - "methods": [ - { - "name": "values", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.net.ano.Ano", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.net.ano.AuthenticationService", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.net.ano.DataIntegrityService", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.net.ano.EncryptionService", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.net.ano.SupervisorService", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "oracle.sql.CLOB", - "methods": [ - { - "name": "free", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "oracle.jdbc.driver.OracleDriver" - }, - "name": "org.hibernate.dialect.OracleDialect", - "methods": [ - { - "name": "", - "parameterTypes": [ - "org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo" - ] - }, - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl" - }, - "name": "org.hibernate.dialect.Oracle10gDialect", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl" - }, - "name": "org.hibernate.dialect.Oracle12cDialect", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "name": "org.hibernate.dialect.OracleDialect", - "condition": { - "typeReachable": "org.hibernate.internal.util.ReflectHelper" - } - }, - { - "condition": { - "typeReachable": "org.hibernate.dialect.SQLServerDialect" - }, - "name": "[Ljava.lang.Class;" - }, - { - "condition": { - "typeReachable": "org.hibernate.dialect.pagination.SQLServer2005LimitHandler" + "typeReachable": "org.hibernate.dialect.pagination.SQLServer2005LimitHandler" }, "name": "[Ljava.lang.Class;" }, @@ -12365,84 +11838,6 @@ }, "name": "[Ljava.lang.Class;" }, - { - "condition": { - "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" - }, - "name": "com.microsoft.sqlserver.jdbc.SQLServerClob", - "methods": [ - { - "name": "free", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" - }, - "name": "com.microsoft.sqlserver.jdbc.SQLServerConnection", - "queriedMethods": [ - { - "name": "getSchema", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" - }, - "name": "com.microsoft.sqlserver.jdbc.SQLServerConnection" - }, - { - "condition": { - "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" - }, - "name": "com.microsoft.sqlserver.jdbc.SQLServerDriver", - "methods": [ - { - "name": "", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" - }, - "name": "com.microsoft.sqlserver.jdbc.SQLServerException" - }, - { - "condition": { - "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" - }, - "name": "com.microsoft.sqlserver.jdbc.SQLServerStatement" - }, - { - "condition": { - "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" - }, - "name": "com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd" - }, - { - "condition": { - "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" - }, - "name": "com.microsoft.sqlserver.jdbc.SSType$Category", - "methods": [ - { - "name": "values", - "parameterTypes": [] - } - ] - }, - { - "condition": { - "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" - }, - "name": "com.microsoft.sqlserver.jdbc.TDSCommand" - }, { "condition": { "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" diff --git a/tests/src/com.zaxxer/HikariCP/5.0.1/src/test/resources/META-INF/native-image/tests-only/jni-config.json b/tests/src/com.zaxxer/HikariCP/5.0.1/src/test/resources/META-INF/native-image/tests-only/jni-config.json new file mode 100644 index 000000000..e72726726 --- /dev/null +++ b/tests/src/com.zaxxer/HikariCP/5.0.1/src/test/resources/META-INF/native-image/tests-only/jni-config.json @@ -0,0 +1,5 @@ +[ + { + "name": "jdk.internal.loader.ClassLoaders$PlatformClassLoader" + } +] \ No newline at end of file diff --git a/tests/src/org.hibernate.orm/hibernate-core/6.1.1.Final/src/test/resources/META-INF/native-image/dto-runtime-hints/reflect-config.json b/tests/src/org.hibernate.orm/hibernate-core/6.1.1.Final/src/test/resources/META-INF/native-image/dto-runtime-hints/reflect-config.json index fcfc88df5..5ee7d4d56 100644 --- a/tests/src/org.hibernate.orm/hibernate-core/6.1.1.Final/src/test/resources/META-INF/native-image/dto-runtime-hints/reflect-config.json +++ b/tests/src/org.hibernate.orm/hibernate-core/6.1.1.Final/src/test/resources/META-INF/native-image/dto-runtime-hints/reflect-config.json @@ -18,5 +18,676 @@ "name": "org.hibernate.orm.User", "allDeclaredFields": true, "allDeclaredConstructors": true + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.net.ano.DataIntegrityService", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.net.ano.EncryptionService", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.net.ano.SupervisorService", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.sql.CLOB", + "methods": [ + { + "name": "free", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" + }, + "name": "com.microsoft.sqlserver.jdbc.SQLServerConnection", + "queriedMethods": [ + { + "name": "getSchema", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" + }, + "name": "com.microsoft.sqlserver.jdbc.SQLServerConnection" + }, + { + "condition": { + "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" + }, + "name": "com.microsoft.sqlserver.jdbc.SQLServerDriver", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" + }, + "name": "com.microsoft.sqlserver.jdbc.SQLServerException" + }, + { + "condition": { + "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" + }, + "name": "com.microsoft.sqlserver.jdbc.SQLServerStatement" + }, + { + "condition": { + "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" + }, + "name": "com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd" + }, + { + "condition": { + "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" + }, + "name": "com.microsoft.sqlserver.jdbc.SSType$Category", + "methods": [ + { + "name": "values", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" + }, + "name": "com.microsoft.sqlserver.jdbc.TDSCommand" + }, + { + "name": "[Lorg.h2.engine.SessionLocal;", + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "name": "[Lorg.h2.expression.Expression;", + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "name": "[Lorg.h2.table.Column;", + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "name": "[Lorg.h2.table.Table;", + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "name": "[Lorg.h2.table.TableFilter;", + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "name": "org.h2.Driver", + "condition": { + "typeReachable": "org.h2.Driver" + }, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "name": "org.h2.command.Parser", + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "name": "org.h2.engine.SessionLocal", + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "name": "org.h2.jdbc.JdbcClob", + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "name": "org.h2.jdbc.JdbcConnection", + "queriedMethods": [ + { + "name": "getSchema", + "parameterTypes": [] + } + ], + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "name": "org.h2.jdbc.JdbcConnection", + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "name": "org.h2.jdbc.JdbcLob", + "condition": { + "typeReachable": "org.h2.Driver" + }, + "methods": [ + { + "name": "free", + "parameterTypes": [] + } + ] + }, + { + "name": "org.h2.jdbc.JdbcStatement", + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "name": "org.h2.message.DbException", + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "name": "org.h2.mvstore.MVStore$TxCounter", + "fields": [ + { + "name": "counter" + } + ], + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "name": "org.h2.mvstore.Page", + "fields": [ + { + "name": "pos" + } + ], + "condition": { + "typeReachable": "org.h2.Driver" + } + }, + { + "condition": { + "typeReachable": "org.mariadb.jdbc.Driver" + }, + "name": "org.mariadb.jdbc.Driver", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "org.mariadb.jdbc.Driver" + }, + "name": "org.mariadb.jdbc.MariaDbBlob", + "methods": [ + { + "name": "free", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "org.mariadb.jdbc.Driver" + }, + "name": "org.mariadb.jdbc.MariaDbClob" + }, + { + "condition": { + "typeReachable": "org.mariadb.jdbc.Driver" + }, + "name": "org.mariadb.jdbc.MariaDbConnection", + "queriedMethods": [ + { + "name": "getSchema", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "org.mariadb.jdbc.Driver" + }, + "name": "org.mariadb.jdbc.MariaDbStatement" + }, + { + "condition": { + "typeReachable": "org.mariadb.jdbc.Driver" + }, + "name": "org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol" + }, + { + "condition": { + "typeReachable": "org.mariadb.jdbc.Driver" + }, + "name": "org.mariadb.jdbc.internal.util.LogQueryTool" + }, + { + "condition": { + "typeReachable": "org.mariadb.jdbc.Driver" + }, + "name": "org.mariadb.jdbc.internal.util.Options", + "fields": [ + { + "name": "password" + }, + { + "name": "user" + } + ] + }, + { + "condition": { + "typeReachable": "org.mariadb.jdbc.Driver" + }, + "name": "org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper" + }, + { + "condition": { + "typeReachable": "com.mysql.cj.jdbc.Driver" + }, + "name": "com.mysql.cj.jdbc.Clob", + "methods": [ + { + "name": "free", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "com.mysql.cj.jdbc.Driver" + }, + "name": "com.mysql.cj.jdbc.ConnectionImpl", + "queriedMethods": [ + { + "name": "getSchema", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "com.mysql.cj.jdbc.Driver" + }, + "name": "com.mysql.cj.jdbc.Driver", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "com.mysql.cj.jdbc.Driver" + }, + "name": "com.mysql.cj.log.StandardLogger", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "com.mysql.cj.jdbc.Driver" + }, + "name": "com.mysql.cj.protocol.StandardSocketFactory", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.jdbc.OracleConnection", + "queriedMethods": [ + { + "name": "createOracleArray", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.jdbc.OracleDriver" + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.jdbc.OracleDriver", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.jdbc.driver.OracleStatement" + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.jdbc.driver.OracleStatementWrapper" + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.jdbc.driver.PhysicalConnection", + "queriedMethods": [ + { + "name": "getSchema", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.jdbc.driver.T4C8Oall" + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.jdbc.driver.T4CConnection" + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.jdbc.driver.T4CDriverExtension", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.jdbc.driver.T4CStatement" + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.jdbc.driver.T4CTTIfun" + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.jdbc.driver.T4CTTIoer11" + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.jdbc.internal.OracleConnection$TransactionState", + "methods": [ + { + "name": "values", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.net.ano.Ano", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "oracle.jdbc.driver.OracleDriver" + }, + "name": "oracle.net.ano.AuthenticationService", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": " org.postgresql.Driver" + }, + "name": "org.postgresql.Driver", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "org.postgresql.Driver" + }, + "name": "org.postgresql.jdbc.PgConnection", + "queriedMethods": [ + { + "name": "getSchema", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "org.postgresql.Driver" + }, + "name": "org.postgresql.jdbc.PgStatement", + "fields": [ + { + "name": "cancelTimerTask" + }, + { + "name": "statementState" + } + ] + }, + { + "condition": { + "typeReachable": "org.postgresql.Driver" + }, + "name": "org.postgresql.util.PGInterval", + "queriedMethods": [ + { + "name": "", + "parameterTypes": [ + "int", + "int", + "int", + "int", + "int", + "double" + ] + }, + { + "name": "getDays", + "parameterTypes": [] + }, + { + "name": "getHours", + "parameterTypes": [] + }, + { + "name": "getMicroSeconds", + "parameterTypes": [] + }, + { + "name": "getMinutes", + "parameterTypes": [] + }, + { + "name": "getWholeSeconds", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "org.postgresql.Driver" + }, + "name": "org.postgresql.util.PGobject", + "queryAllDeclaredMethods": true, + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "org.hsqldb.jdbc.JDBCDriver" + }, + "name": "[Lorg.hsqldb.Constraint;" + }, + { + "condition": { + "typeReachable": "org.hsqldb.jdbc.JDBCDriver" + }, + "name": "[Lorg.hsqldb.index.Index;" + }, + { + "condition": { + "typeReachable": "org.hsqldb.jdbc.JDBCDriver" + }, + "name": "org.hsqldb.jdbc.JDBCClob", + "methods": [ + { + "name": "free", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "org.hsqldb.jdbc.JDBCDriver" + }, + "name": "org.hsqldb.jdbc.JDBCConnection", + "queriedMethods": [ + { + "name": "getSchema", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "org.hsqldb.jdbc.JDBCDriver" + }, + "name": "org.hsqldb.jdbc.JDBCDriver", + "methods": [ + { + "name": "", + "parameterTypes": [] + } + ] + }, + { + "condition": { + "typeReachable": "org.hsqldb.jdbc.JDBCDriver" + }, + "name": "org.hsqldb.persist.HsqlDatabaseProperties", + "fields": [ + { + "name": "THIS_VERSION" + } + ] + }, + { + "condition": { + "typeReachable": "com.microsoft.sqlserver.jdbc.SQLServerDriver" + }, + "name": "com.microsoft.sqlserver.jdbc.SQLServerClob", + "methods": [ + { + "name": "free", + "parameterTypes": [] + } + ] } ] diff --git a/tests/tck-build-logic/src/main/java/org/graalvm/internal/tck/ConfigFilesChecker.java b/tests/tck-build-logic/src/main/java/org/graalvm/internal/tck/ConfigFilesChecker.java index f0080b2ab..2cfc4e469 100644 --- a/tests/tck-build-logic/src/main/java/org/graalvm/internal/tck/ConfigFilesChecker.java +++ b/tests/tck-build-logic/src/main/java/org/graalvm/internal/tck/ConfigFilesChecker.java @@ -2,12 +2,21 @@ import groovy.json.JsonSlurper; import org.gradle.api.DefaultTask; +import org.gradle.api.file.RegularFileProperty; +import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.TaskAction; import org.gradle.api.tasks.options.Option; +import java.util.Scanner; import java.io.File; import java.io.FileNotFoundException; -import java.util.*; +import java.util.Arrays; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; import java.util.stream.Collectors; /** @@ -17,29 +26,45 @@ * * @author David Nestorovic */ -public class ConfigFilesChecker extends DefaultTask { +public abstract class ConfigFilesChecker extends DefaultTask { - private final List EXPECTED_FILES = Arrays.asList("index.json", "reflect-config.json", "resource-config.json", "serialization-config.json", - "jni-config.json", "proxy-config.json", "predefined-classes-config.json"); + @InputFiles + protected abstract RegularFileProperty getMetadataRoot(); - private final List ILLEGAL_TYPE_VALUES = List.of("java.lang"); + @InputFiles + protected abstract RegularFileProperty getIndexFile(); - private String coordinates; + private final Set EXPECTED_FILES = new HashSet<>(Arrays.asList("index.json", "reflect-config.json", "resource-config.json", "serialization-config.json", + "jni-config.json", "proxy-config.json", "predefined-classes-config.json")); + + private final Set ILLEGAL_TYPE_VALUES = new HashSet<>(List.of("java.lang")); + + private final Set PREDEFINED_ALLOWED_PACKAGES = new HashSet<>(Arrays.asList("java.lang", "java.util")); + + Coordinates coordinates; + List allowedPackages; @Option(option = "coordinates", description = "Coordinates in the form of group:artifact:version") - void setCoordinates(String coordinates) { - this.coordinates = coordinates; + void setCoordinates(String coords) { + this.coordinates = Coordinates.parse(coords); + + File coordinatesMetadataRoot = getProject().file(CoordinateUtils.replace("metadata/$group$/$artifact$/$version$", coordinates)); + getMetadataRoot().set(coordinatesMetadataRoot); + + File index = getProject().file("metadata/index.json"); + getIndexFile().set(index); + + this.allowedPackages = getAllowedPackages(); } @TaskAction void run() throws IllegalArgumentException, FileNotFoundException { - Coordinates coordinates = Coordinates.parse(this.coordinates); if (coordinates.group().equalsIgnoreCase("org.example") || coordinates.group().equalsIgnoreCase("samples")) { return; } - File coordinatesMetadataRoot = getProject().file(CoordinateUtils.replace("metadata/$group$/$artifact$/$version$", coordinates)); + File coordinatesMetadataRoot = getMetadataRoot().get().getAsFile(); if (!coordinatesMetadataRoot.exists()) { throw new IllegalArgumentException("ERROR: Cannot find metadata directory for given coordinates: " + this.coordinates); } @@ -48,23 +73,23 @@ void run() throws IllegalArgumentException, FileNotFoundException { List filesInMetadata = getConfigFilesForMetadataDir(coordinatesMetadataRoot); for (File file : filesInMetadata) { if (file.getName().equalsIgnoreCase("reflect-config.json")) { - containsErrors |= reflectConfigFilesContainsErrors(file); + containsErrors |= reflectConfigFileContainsErrors(file); } if (file.getName().equalsIgnoreCase("resource-config.json")) { - containsErrors |= resourceConfigFilesContainsErrors(file); + containsErrors |= resourceConfigFileContainsErrors(file); } if (file.getName().equalsIgnoreCase("serialization-config.json")) { - containsErrors |= serializationConfigFilesContainsErrors(file); + containsErrors |= serializationConfigFileContainsErrors(file); } if (file.getName().equalsIgnoreCase("proxy-config.json")) { - containsErrors |= proxyConfigFilesContainsErrors(file); + containsErrors |= proxyConfigFileContainsErrors(file); } if (file.getName().equalsIgnoreCase("jni-config.json")) { - containsErrors |= jniConfigFilesContainsErrors(file); + containsErrors |= jniConfigFileContainsErrors(file); } } @@ -82,9 +107,7 @@ private List getConfigFilesForMetadataDir(File root) throws RuntimeExcepti } Arrays.stream(content).forEach(file -> { - String fileName = file.getName(); - - if (EXPECTED_FILES.stream().noneMatch(f -> f.equalsIgnoreCase(fileName))) { + if (EXPECTED_FILES.stream().noneMatch(file.getName()::equalsIgnoreCase)) { throw new IllegalStateException("ERROR: Unexpected file " + file.toURI() + " found in " + root.toURI()); } @@ -95,18 +118,22 @@ private List getConfigFilesForMetadataDir(File root) throws RuntimeExcepti } @SuppressWarnings("unchecked") + // in case when config file is an array of entries private List> getConfigEntries(File file) { - JsonSlurper js = new JsonSlurper(); - return ((List) js.parse(file)).stream().map(e -> (Map)e).collect(Collectors.toList()); + return ((List) new JsonSlurper() + .parse(file)) + .stream() + .map(e -> (Map)e) + .collect(Collectors.toList()); } @SuppressWarnings("unchecked") + // in case when config file is an object private Map getConfigEntry(File file) { - JsonSlurper js = new JsonSlurper(); - return (Map) js.parse(file); + return (Map) new JsonSlurper().parse(file); } - private boolean reflectConfigFilesContainsErrors(File file) { + private boolean reflectConfigFileContainsErrors(File file) { List> entries = getConfigEntries(file); if (entries.size() == 0) { @@ -117,13 +144,14 @@ private boolean reflectConfigFilesContainsErrors(File file) { boolean containsErrors = containsDuplicatedEntries(entries, file); for (var entry : entries) { containsErrors |= checkTypeReachable(entry, file); + containsErrors |= containsEntriesNotFromLibrary(entry, file); } return containsErrors; } @SuppressWarnings("unchecked") - private boolean resourceConfigFilesContainsErrors(File file) { + private boolean resourceConfigFileContainsErrors(File file) { Map entries = getConfigEntry(file); List> bundles = (List>) entries.get("bundles"); Map resources = (Map) entries.get("resources"); @@ -153,6 +181,7 @@ private boolean resourceConfigFilesContainsErrors(File file) { for (var entry : excludes) { containsErrors |= checkTypeReachable(entry, file); + containsErrors |= containsEntriesNotFromLibrary(entry, file); } } } @@ -171,6 +200,7 @@ private boolean checkOldSerializationConfig(File file) { boolean containsErrors = containsDuplicatedEntries(entries, file); for (var entry : entries) { containsErrors |= checkTypeReachable(entry, file); + containsErrors |= containsEntriesNotFromLibrary(entry, file); } return containsErrors; @@ -195,6 +225,7 @@ private boolean checkNewSerializationConfig(File file) { for (var entry : types) { containsErrors |= checkTypeReachable(entry, file); + containsErrors |= containsEntriesNotFromLibrary(entry, file); } } @@ -204,18 +235,19 @@ private boolean checkNewSerializationConfig(File file) { for (var entry : lambdaCapturingTypes) { containsErrors |= checkTypeReachable(entry, file); + containsErrors |= containsEntriesNotFromLibrary(entry, file); } } return containsErrors; } - private boolean serializationConfigFilesContainsErrors(File file) throws FileNotFoundException { + private boolean serializationConfigFileContainsErrors(File file) throws FileNotFoundException { Scanner sc = new Scanner(file); - return sc.nextLine().contains("[") ? checkOldSerializationConfig(file) : checkNewSerializationConfig(file); + return sc.nextLine().contains("[") ? checkOldSerializationConfig(file) : checkNewSerializationConfig(file); } - private boolean proxyConfigFilesContainsErrors(File file) { + private boolean proxyConfigFileContainsErrors(File file) { List> entries = getConfigEntries(file); if (entries.size() == 0) { @@ -226,12 +258,13 @@ private boolean proxyConfigFilesContainsErrors(File file) { boolean containsErrors = containsDuplicatedEntries(entries, file); for (var entry : entries) { containsErrors |= checkTypeReachable(entry, file); + containsErrors |= containsEntriesNotFromLibrary(entry, file); } return containsErrors; } - private boolean jniConfigFilesContainsErrors(File file) { + private boolean jniConfigFileContainsErrors(File file) { List> entries = getConfigEntries(file); if (entries.size() == 0) { @@ -239,7 +272,13 @@ private boolean jniConfigFilesContainsErrors(File file) { return true; } - return containsDuplicatedEntries(entries, file); + boolean containsErrors = containsDuplicatedEntries(entries, file); + for (var entry : entries) { + containsErrors |= checkTypeReachable(entry, file); + containsErrors |= containsEntriesNotFromLibrary(entry, file); + } + + return containsErrors; } private boolean containsDuplicatedEntries(List> entries, File file) { @@ -250,10 +289,11 @@ private boolean containsDuplicatedEntries(List> entries, Fil boolean containsDuplicates = false; for (var entry : duplicates.entrySet()) { if (entry.getValue() > 1) { - String entryName = (String) entry.getKey().get("name"); + String entryName = getEntryName(entry.getKey()); if (entryName == null) { entryName = entry.getKey().toString(); } + containsDuplicates = true; System.out.println("ERROR: In file " + file.toURI() + " there is a duplicated entry " + entryName); } @@ -264,19 +304,17 @@ private boolean containsDuplicatedEntries(List> entries, Fil @SuppressWarnings("unchecked") private boolean checkTypeReachable(Map entry, File file) { - Map condition = (Map) entry.get("condition"); - String entryName = (String) entry.get("name"); + String typeReachable = getEntryTypeReachable(entry); + String entryName = getEntryName(entry); // check if condition entry exists - if (condition == null) { + if (typeReachable == null) { System.out.println("ERROR: In file " + file.toURI() + " there is an entry " + entry + " with missing condition field."); return true; } - String typeReachable = (String) condition.get("typeReachable"); - - // check if both entry name and typeReachable are from java.lang since there are some cases where this is allowed - if (entryName != null && entryName.startsWith("java.lang") && typeReachable.startsWith("java.lang")) { + // check if both entryName and typeReachable are from PREDEFINED_ALLOWED_PACKAGES since there are some cases where this is allowed + if (entryName != null && PREDEFINED_ALLOWED_PACKAGES.stream().anyMatch(typeReachable::contains) && PREDEFINED_ALLOWED_PACKAGES.stream().anyMatch(entryName::contains)) { return false; } @@ -295,8 +333,69 @@ private boolean checkTypeReachable(Map entry, File file) { return false; } + private boolean containsEntriesNotFromLibrary(Map entry, File file) { + String typeReachable = getEntryTypeReachable(entry); + String entryName = getEntryName(entry); + + // this is not a valid situation since every entry must have typeReachable + if (typeReachable == null) { + return true; + } + + // valid case is when both typeReachable and entryName are from ALLOWED_PACKAGES + if (entryName != null && PREDEFINED_ALLOWED_PACKAGES.stream().anyMatch(typeReachable::contains) && PREDEFINED_ALLOWED_PACKAGES.stream().anyMatch(entryName::contains)) { + return false; + } + + // if typeReachable is not from allowedPackages we have to report an error + if (this.allowedPackages.stream().noneMatch(typeReachable::contains)) { + System.out.println("ERROR: In file " + file.toURI() + "\n" + + "Entry: " + entryName + "\n" + + "TypeReachable: " + typeReachable + "\n" + + "doesn't belong to any of the specified packages: " + this.allowedPackages + "\n"); + return true; + } + + return false; + } + + @SuppressWarnings("unchecked") + private String getEntryTypeReachable(Map entry) { + Map condition = (Map) entry.get("condition"); + + // check if condition entry exists + if (condition == null) { + return null; + } + + return (String) condition.get("typeReachable"); + } + + private String getEntryName(Map entry) { + return (String) entry.get("name"); + } + private boolean listNullOrEmpty(List list) { return list == null || list.size() == 0; } + @SuppressWarnings("unchecked") + private List getAllowedPackages() { + File indexFile = getIndexFile().get().getAsFile(); + String groupId = coordinates.group(); + + List> entries = getConfigEntries(indexFile); + + for (var entry : entries) { + if (entry.get("module").toString().startsWith(groupId)) { + if (entry.get("allowed-packages") == null) { + throw new IllegalStateException("Missing allowed-packages property for " + groupId); + } + + return (List) entry.get("allowed-packages"); + } + } + + throw new IllegalStateException("Missing library name in: " + indexFile.toURI() + " for coordinates " + coordinates); + } }