Replaced use of inefficient keyset with use of entryset.
This commit is contained in:
parent
b6c2d697ab
commit
9672399666
|
@ -283,12 +283,12 @@ public class ExceptionContext implements Serializable {
|
|||
private void serializeContext(ObjectOutputStream out)
|
||||
throws IOException {
|
||||
// Step 1.
|
||||
final int len = context.keySet().size();
|
||||
final int len = context.size();
|
||||
out.writeInt(len);
|
||||
for (String key : context.keySet()) {
|
||||
for (Map.Entry<String, Object> entry : context.entrySet()) {
|
||||
// Step 2.
|
||||
out.writeObject(key);
|
||||
final Object value = context.get(key);
|
||||
out.writeObject(entry.getKey());
|
||||
final Object value = entry.getValue();
|
||||
if (value instanceof Serializable) {
|
||||
// Step 3a.
|
||||
out.writeObject(value);
|
||||
|
|
Loading…
Reference in New Issue