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)
|
private void serializeContext(ObjectOutputStream out)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
// Step 1.
|
// Step 1.
|
||||||
final int len = context.keySet().size();
|
final int len = context.size();
|
||||||
out.writeInt(len);
|
out.writeInt(len);
|
||||||
for (String key : context.keySet()) {
|
for (Map.Entry<String, Object> entry : context.entrySet()) {
|
||||||
// Step 2.
|
// Step 2.
|
||||||
out.writeObject(key);
|
out.writeObject(entry.getKey());
|
||||||
final Object value = context.get(key);
|
final Object value = entry.getValue();
|
||||||
if (value instanceof Serializable) {
|
if (value instanceof Serializable) {
|
||||||
// Step 3a.
|
// Step 3a.
|
||||||
out.writeObject(value);
|
out.writeObject(value);
|
||||||
|
|
Loading…
Reference in New Issue