Skip to content

Conversation

dreab8
Copy link
Member

@dreab8 dreab8 commented Sep 24, 2025

https://hibernate.atlassian.net/browse/HHH-19388


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


metadataSources.addInputStream( getClass().getResourceAsStream( "no-file-level-catalog-and-schema.hbm.xml" ) );
metadataSources.addInputStream( getClass().getResourceAsStream( "database-object-using-catalog-placeholder.hbm.xml" ) );
metadataSources.addInputStream( getClass().getResourceAsStream( "database-object-using-schema-placeholder.hbm.xml" ) );
metadataSources.addInputStream( getClass().getResourceAsStream( "database-object-using-catalog-placeholder.orm.xml" ) );

Check warning

Code scanning / CodeQL

Unsafe use of getResource Warning test

The idiom getClass().getResource() is unsafe for classes that may be extended.
metadataSources.addInputStream( getClass().getResourceAsStream( "database-object-using-catalog-placeholder.hbm.xml" ) );
metadataSources.addInputStream( getClass().getResourceAsStream( "database-object-using-schema-placeholder.hbm.xml" ) );
metadataSources.addInputStream( getClass().getResourceAsStream( "database-object-using-catalog-placeholder.orm.xml" ) );
metadataSources.addInputStream( getClass().getResourceAsStream( "database-object-using-schema-placeholder.orm.xml" ) );

Check warning

Code scanning / CodeQL

Unsafe use of getResource Warning test

The idiom getClass().getResource() is unsafe for classes that may be extended.
Comment on lines +25 to +27
context.getBootstrapContext().getClassLoaderService()
.classForName( databaseObjectRegistration.definition() )
.newInstance();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
Class.newInstance
should be avoided because it has been deprecated.
@dreab8 dreab8 marked this pull request as ready for review September 29, 2025 15:17
@sebersole
Copy link
Member

Pulled locally and applied some minor fix ups. Applied manually upstream.

@sebersole sebersole closed this Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants