Skip to content

Commit

Permalink
TRUNK-6134: Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher committed Sep 9, 2022
1 parent a111ee9 commit c3a6ecf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import org.hibernate.CallbackException;
import org.hibernate.EmptyInterceptor;
import org.hibernate.collection.spi.PersistentCollection;
import org.hibernate.collection.internal.PersistentSet;
import org.hibernate.type.Type;
import org.openmrs.Auditable;
import org.openmrs.OpenmrsObject;
Expand Down Expand Up @@ -183,9 +183,9 @@ private boolean changePropertyValue(Object[] currentState, String[] propertyName
}

private void handleCollectionChange(Object collection) {
if (collection instanceof PersistentCollection) {
PersistentCollection persistentCollection = (PersistentCollection) collection;
if (persistentCollection.getKey().equals("role")) {
if (collection instanceof PersistentSet) {
PersistentSet persistentCollection = (PersistentSet) collection;
if ("org.openmrs.User.roles".equals(persistentCollection.getRole())) {
Object owner = persistentCollection.getOwner();
if (owner instanceof User) {
User user = (User) owner;
Expand Down

0 comments on commit c3a6ecf

Please sign in to comment.