Skip to content

Conversation

@marko-bekhta
Copy link
Member

@marko-bekhta marko-bekhta commented Oct 31, 2025

[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.


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

/******************************************
*
*/
User user1 = s1.get( User.class, 1 ); // into persistent context

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'User user1' is never read.
scope.inTransaction( s1 -> {

Company company1 = s1.get( Company.class, 1 );
Company company1 = s1.get( Company.class, 1 );

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'Company company1' is never read.
scope.inTransaction( s1 -> {

Company company1 = s1.get( Company.class, 1 );
Company company1 = s1.get( Company.class, 1 );

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'Company company1' is never read.
assertEquals( 2, readWriteVersionedCacheableItem.getTags().size() );
// open another session
s2 = scope.getSessionFactory().openSession();
s2.beginTransaction();

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning test

Variable
s2
may be null at this access as suggested by
this
null guard.
return key;
var it = cache.entrySet().iterator();
try {
it.remove();

Check warning

Code scanning / CodeQL

Call to Iterator.remove may fail Warning test

This call may fail when iterating over
the collection
, since it does not support element removal.
cache.put( new Simple( 1 ), managedEntity );
public void testManagedEntityAssociatedWithNewAndExistingMergeEntities(SessionFactoryScope scope) {
scope.inSession( session -> {
MergeContext cache = new MergeContext( (EventSource) session, new DoNothingEntityCopyObserver() );

Check failure

Code scanning / CodeQL

Container contents are never accessed Error test

The contents of this container are never accessed.
}
public void testManagedAssociatedWith2ExistingMergeEntities(SessionFactoryScope scope) {
scope.inSession( session -> {
MergeContext cache = new MergeContext( (EventSource) session, new DoNothingEntityCopyObserver() );

Check failure

Code scanning / CodeQL

Container contents are never accessed Error test

The contents of this container are never accessed.
}
public void testRemoveNonExistingEntity(SessionFactoryScope scope) {
scope.inSession( session -> {
MergeContext cache = new MergeContext( (EventSource) session, new DoNothingEntityCopyObserver() );

Check failure

Code scanning / CodeQL

Container contents are never accessed Error test

The contents of this container are never accessed.
public void resetListener() {
@BeforeEach
void setUp(SessionFactoryScope scope) {
SessionFactoryImplementor sessionFactory = scope.getSessionFactory();

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'SessionFactoryImplementor sessionFactory' is never read.
entityManagerFactory.unwrap( SessionFactoryImplementor.class ).getEventListenerRegistry()
.prependListeners( EventType.LOAD, new SecuredLoadEntityListener() );

Customer customer = entityManager.find( Customer.class, customerId );

Check notice

Code scanning / CodeQL

Unread local variable Note test

Variable 'Customer customer' is never read.
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.

1 participant