Skip to content

Commit

Permalink
[apache#1495] fix(core): Change the HashMap to ConcurrentMap in Proto…
Browse files Browse the repository at this point in the history
…EntitySerDe (apache#1525)

### What changes were proposed in this pull request?
Fix ConcurrentModificationException threw in function
`ProtoEntitySerDe:getProtoClass()`

### Why are the changes needed?

Fix: apache#1495

### Does this PR introduce _any_ user-facing change?

NO

### How was this patch tested?

The TrinoQueryIT tester has been run successfully many times. However,
before this change, it sometimes fails due to a
ConcurrentModificationException
  • Loading branch information
diqiu50 authored Jan 16, 2024
1 parent 2cc679d commit 075db16
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public class ProtoEntitySerDe implements EntitySerDe {
private final Map<Class<? extends Entity>, Class<? extends Message>> entityToProto;

public ProtoEntitySerDe() {
this.entityToSerDe = Maps.newHashMap();
this.entityToProto = Maps.newHashMap();
this.entityToSerDe = Maps.newConcurrentMap();
this.entityToProto = Maps.newConcurrentMap();
}

@Override
Expand Down

0 comments on commit 075db16

Please sign in to comment.