diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/internal/tools/query/UpdateBuilder.java b/hibernate-envers/src/main/java/org/hibernate/envers/internal/tools/query/UpdateBuilder.java index a5148cf419..5426d4724a 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/internal/tools/query/UpdateBuilder.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/internal/tools/query/UpdateBuilder.java @@ -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 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( ", " ); } diff --git a/hibernate-osgi/src/main/java/org/hibernate/osgi/OsgiServiceUtil.java b/hibernate-osgi/src/main/java/org/hibernate/osgi/OsgiServiceUtil.java index febdeeb6d9..915584ae20 100644 --- a/hibernate-osgi/src/main/java/org/hibernate/osgi/OsgiServiceUtil.java +++ b/hibernate-osgi/src/main/java/org/hibernate/osgi/OsgiServiceUtil.java @@ -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 entry : serviceTrackers.entrySet() ) { + entry.getValue().close(); } serviceTrackers.clear(); }