Skip to content

Commit

Permalink
Merge pull request #85 from stg-tud/fix/object-type-lookup
Browse files Browse the repository at this point in the history
Fix off-by-one error in ObjectType to ID mapping
  • Loading branch information
errt authored Apr 1, 2021
2 parents bc2e9bf + 2c40fd8 commit dda4a09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OPAL/br/src/main/scala/org/opalj/br/Type.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1060,8 +1060,8 @@ object ObjectType {
@volatile private[this] var objectTypes: Array[ObjectType] = new Array[ObjectType](0)

private[this] def updateObjectTypes(): Unit = {
if (nextId.get >= objectTypes.length) {
val newObjectTypes = JArrays.copyOf(this.objectTypes, nextId.get + 1)
if (nextId.get > objectTypes.length) {
val newObjectTypes = JArrays.copyOf(this.objectTypes, nextId.get)
cacheRWLock.readLock().lock()
try {
cache.values.forEach { wot
Expand Down

0 comments on commit dda4a09

Please sign in to comment.