HHH-10715 Use the more efficient iterators

This commit is contained in:
Sanne Grinovero 2020-10-10 21:55:51 +01:00
parent 20ae8d1ee0
commit 9e1af2ffc6
2 changed files with 5 additions and 4 deletions

View File

@ -47,10 +47,11 @@ public class UpdateBuilder {
sb.append( "update " ).append( entityName ).append( " " ).append( alias );
sb.append( " set " );
int i = 1;
for ( String property : updates.keySet() ) {
for ( java.util.Map.Entry<String, Object> entry : updates.entrySet() ) {
final String property = entry.getKey();
final String paramName = generateParameterName();
sb.append( alias ).append( "." ).append( property ).append( " = " ).append( ":" ).append( paramName );
updateParamValues.put( paramName, updates.get( property ) );
updateParamValues.put( paramName, entry.getValue() );
if ( i < updates.size() ) {
sb.append( ", " );
}

View File

@ -87,8 +87,8 @@ public class OsgiServiceUtil implements Stoppable {
@Override
public void stop() {
for (String key : serviceTrackers.keySet()) {
serviceTrackers.get( key ).close();
for ( java.util.Map.Entry<String, org.osgi.util.tracker.ServiceTracker> entry : serviceTrackers.entrySet() ) {
entry.getValue().close();
}
serviceTrackers.clear();
}