Skip to content

Conversation

@gavinking
Copy link
Member

[Please describe here what your change is about]


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.


@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Sep 3, 2025

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
    ↳ Offending commits: [4384cc7, 5b55041, 6b0c15f, e6d4cc2, 7eb1110, 5ad5d42]

› This message was automatically generated.

@gavinking gavinking marked this pull request as ready for review September 3, 2025 11:07
if ( LOG.isTraceEnabled() ) {
LOG.trace( "Persisting " + infoString( persister, id, source.getFactory() ) );
if ( log.isTraceEnabled() ) {
log.trace( "Persisting " + infoString( persister, id, source.getFactory() ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
if ( LOG.isTraceEnabled() ) {
LOG.trace( "Deleting " + infoString( persister, entityEntry.getId(), session.getFactory() ) );
if ( log.isTraceEnabled() ) {
log.trace( "Deleting " + infoString( persister, entityEntry.getId(), session.getFactory() ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
if ( status == Status.DELETED ) {
if ( !persister.isMutable() ) {
LOG.trace( "Updating immutable, deleted entity: " + info );
log.trace( "Updating immutable, deleted entity: " + info );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
}
else if ( !entry.isModifiableEntity() ) {
LOG.trace( "Updating non-modifiable, deleted entity: " + info );
log.trace( "Updating non-modifiable, deleted entity: " + info );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
}
else {
LOG.trace( "Updating deleted entity: " + info );
log.trace( "Updating deleted entity: " + info );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
if ( log.isTraceEnabled() ) {
if ( Hibernate.isInitialized( obj ) ) {
LOG.tracev( "Starting serialization of object [{0}]", obj );
log.tracev( "Starting serialization of object [{0}]", obj );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
if ( LOG.isTraceEnabled() ) {
LOG.tracev( "Getting version: {0}", infoString( this, id, getFactory() ) );
if ( log.isTraceEnabled() ) {
log.tracev( "Getting version: {0}", infoString( this, id, getFactory() ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
if ( LOG.isTraceEnabled() ) {
LOG.tracev( "Fetching entity: {0}", infoString( this, id, getFactory() ) );
if ( log.isTraceEnabled() ) {
log.tracev( "Fetching entity: {0}", infoString( this, id, getFactory() ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
Comment on lines +76 to +77
log.trace( "Collection fully initialized: "
+ collectionInfoString( collectionDescriptor, collection, key, session ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
Comment on lines +140 to +141
log.trace( "Caching collection: "
+ collectionInfoString( collectionDescriptor, collection, key, session ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
and stricter enforcement of @DiscriminatorValue requirement
(I don't think this is a substantive change to behavior, but it might be).
@beikov
Copy link
Member

beikov commented Sep 3, 2025

I personally would prefer to stick to UPPER_CASE for static final variables like LOG instead of lower case log. That is a common naming scheme and helps quickly understand that something is a constant without checking the definition, so -1 on the naming change from me.

Comment on lines +52 to +53
log.trace( "Collection dereferenced: "
+ collectionInfoString( loadedPersister, collection, entry.getLoadedKey(), session ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
Comment on lines +118 to +119
log.trace( "Found collection with unloaded owner: "
+ collectionInfoString( loadedPersister, collection, loadedKey, session ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
Comment on lines +167 to +168
log.trace( "Skipping uninitialized bytecode-lazy collection: "
+ collectionInfoString( persister, collection, collectionEntry.getCurrentKey(), session ) );

Check failure

Code scanning / CodeQL

Insertion of sensitive information into log files High

This
potentially sensitive information
is written to a log file.
@gavinking
Copy link
Member Author

I personally would prefer to stick to UPPER_CASE for static final variables like LOG instead of lower case log. That is a common naming scheme and helps quickly understand that something is a constant without checking the definition, so -1 on the naming change from me.

I really don't think it matters much at all if these are lower or upper case. I very slightly prefer lowercase because it makes the log statements stand out somewhat less. (Logging crap is ugly enough without having it shouting at me.)

But I do think it's a good idea to be at least consistent across the whole code base. And we're not consistent right now.

Whatever, I'm not going to redo this work. But I'm not going try to to stop you renaming everything to uppercase, as long as you do it everywhere.

@gavinking
Copy link
Member Author

replaced by #10879

@gavinking gavinking closed this Sep 5, 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.

2 participants