package org.greenrobot.greendao.identityscope; import java.lang.ref.Reference; import java.lang.ref.WeakReference; import java.util.Iterator; import java.util.concurrent.locks.ReentrantLock; import org.greenrobot.greendao.internal.LongHashMap; /* loaded from: classes2.dex */ public class IdentityScopeLong implements IdentityScope { private final LongHashMap> a = new LongHashMap<>(); private final ReentrantLock b = new ReentrantLock(); @Override // org.greenrobot.greendao.identityscope.IdentityScope /* renamed from: b, reason: merged with bridge method [inline-methods] */ public T a(Long l) { return b(l.longValue()); } @Override // org.greenrobot.greendao.identityscope.IdentityScope /* renamed from: c, reason: merged with bridge method [inline-methods] */ public void remove(Long l) { this.b.lock(); try { this.a.b(l.longValue()); } finally { this.b.unlock(); } } @Override // org.greenrobot.greendao.identityscope.IdentityScope public void clear() { this.b.lock(); try { this.a.a(); } finally { this.b.unlock(); } } @Override // org.greenrobot.greendao.identityscope.IdentityScope public void lock() { this.b.lock(); } /* JADX WARN: Multi-variable type inference failed */ @Override // org.greenrobot.greendao.identityscope.IdentityScope public /* bridge */ /* synthetic */ void put(Long l, Object obj) { a2(l, (Long) obj); } @Override // org.greenrobot.greendao.identityscope.IdentityScope public void unlock() { this.b.unlock(); } /* JADX WARN: Multi-variable type inference failed */ @Override // org.greenrobot.greendao.identityscope.IdentityScope public /* bridge */ /* synthetic */ void a(Long l, Object obj) { b(l, (Long) obj); } public T b(long j) { Reference a = this.a.a(j); if (a != null) { return a.get(); } return null; } @Override // org.greenrobot.greendao.identityscope.IdentityScope /* renamed from: a, reason: avoid collision after fix types in other method and merged with bridge method [inline-methods] */ public T get(Long l) { return a(l.longValue()); } public T a(long j) { this.b.lock(); try { Reference a = this.a.a(j); if (a != null) { return a.get(); } return null; } finally { this.b.unlock(); } } public void b(Long l, T t) { b(l.longValue(), (long) t); } public void b(long j, T t) { this.a.a(j, new WeakReference(t)); } /* renamed from: a, reason: avoid collision after fix types in other method */ public void a2(Long l, T t) { a(l.longValue(), (long) t); } public void a(long j, T t) { this.b.lock(); try { this.a.a(j, new WeakReference(t)); } finally { this.b.unlock(); } } @Override // org.greenrobot.greendao.identityscope.IdentityScope public void a(Iterable iterable) { this.b.lock(); try { Iterator it = iterable.iterator(); while (it.hasNext()) { this.a.b(it.next().longValue()); } } finally { this.b.unlock(); } } @Override // org.greenrobot.greendao.identityscope.IdentityScope public void a(int i) { this.a.a(i); } }