HHH-5580 - Refactoring
This commit is contained in:
parent
13c9fd4f9d
commit
f3a6476a66
|
@ -304,12 +304,14 @@ public class AuditReaderImpl implements AuditReaderImplementor {
|
|||
if (revisionInfo != null) {
|
||||
// If revision exists.
|
||||
Set<String> entityNames = verCfg.getModifiedEntityNamesReader().getModifiedEntityNames(revisionInfo);
|
||||
// Generate result that contains entity names and corresponding Java classes.
|
||||
Set<Pair<String, Class>> result = new HashSet<Pair<String, Class>>();
|
||||
for (String entityName : entityNames) {
|
||||
result.add(Pair.make(entityName, Tools.getEntityClass(sessionImplementor, session, entityName)));
|
||||
if (entityNames != null) {
|
||||
// Generate result that contains entity names and corresponding Java classes.
|
||||
Set<Pair<String, Class>> result = new HashSet<Pair<String, Class>>();
|
||||
for (String entityName : entityNames) {
|
||||
result.add(Pair.make(entityName, Tools.getEntityClass(sessionImplementor, session, entityName)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return Collections.EMPTY_SET;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ public class ModifiedEntityNamesReader {
|
|||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public Set<String> getModifiedEntityNames(Object revisionEntity) {
|
||||
Set<String> modifiedEntityNames = (Set<String>) modifiedEntityNamesGetter.get(revisionEntity);
|
||||
return modifiedEntityNames != null ? modifiedEntityNames : Collections.EMPTY_SET;
|
||||
return (Set<String>) modifiedEntityNamesGetter.get(revisionEntity);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue