6464import jakarta .persistence .AttributeConverter ;
6565import jakarta .persistence .SharedCacheMode ;
6666
67- import static java .util .Collections .emptyList ;
6867
6968/**
7069 * A convenience API making it easier to bootstrap an instance of Hibernate.
@@ -199,11 +198,10 @@ public Configuration(MetadataSources metadataSources) {
199198 }
200199
201200 private static BootstrapServiceRegistry getBootstrapRegistry (ServiceRegistry serviceRegistry ) {
202- if ( serviceRegistry instanceof BootstrapServiceRegistry ) {
203- return ( BootstrapServiceRegistry ) serviceRegistry ;
201+ if ( serviceRegistry instanceof BootstrapServiceRegistry bootstrapServiceRegistry ) {
202+ return bootstrapServiceRegistry ;
204203 }
205- else if ( serviceRegistry instanceof StandardServiceRegistry ) {
206- final StandardServiceRegistry ssr = (StandardServiceRegistry ) serviceRegistry ;
204+ else if ( serviceRegistry instanceof StandardServiceRegistry ssr ) {
207205 return (BootstrapServiceRegistry ) ssr .getParentServiceRegistry ();
208206 }
209207
@@ -669,7 +667,7 @@ public Configuration addResource(String resourceName) throws MappingException {
669667 * @throws MappingException Indicates problems locating the resource or
670668 * processing the contained mapping document.
671669 */
672- public Configuration addClass (Class entityClass ) throws MappingException {
670+ public Configuration addClass (Class <?> entityClass ) throws MappingException {
673671 if ( entityClass == null ) {
674672 throw new IllegalArgumentException ( "The specified class cannot be null" );
675673 }
@@ -688,7 +686,7 @@ public Configuration addClass(Class entityClass) throws MappingException {
688686 *
689687 * @return {@code this} for method chaining
690688 */
691- public Configuration addAnnotatedClass (Class annotatedClass ) {
689+ public Configuration addAnnotatedClass (Class <?> annotatedClass ) {
692690 metadataSources .addAnnotatedClass ( annotatedClass );
693691 return this ;
694692 }
@@ -1153,7 +1151,7 @@ public Map<String, NamedResultSetMappingDescriptor> getSqlResultSetMappings() {
11531151 }
11541152
11551153 public java .util .Collection <NamedEntityGraphDefinition > getNamedEntityGraphs () {
1156- return namedEntityGraphMap == null ? emptyList () : namedEntityGraphMap .values ();
1154+ return namedEntityGraphMap .values ();
11571155 }
11581156
11591157
0 commit comments