-
Notifications
You must be signed in to change notification settings - Fork 370
Ability to toggle cache on/off #1706
base: cache
Are you sure you want to change the base?
Conversation
|
||
Cache<Indexable, TransactionViewModel> cache = tangle.getCache(TransactionViewModel.class); | ||
if (cache != null) { | ||
if (cache.get(hash) == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: These nested if statements could be combined
import com.iota.iri.model.persistables.ObsoleteTag; | ||
import com.iota.iri.model.persistables.Tag; | ||
import com.iota.iri.model.persistables.Transaction; | ||
import com.iota.iri.model.persistables.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import java.util.HashMap; | ||
import java.util.HashSet; | ||
|
||
import org.junit.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue found: Avoid unused imports such as 'org.junit'
if (cache == null) { | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So store
doesn't do anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
Description
Because we want to run JMH tests in cache on/off states, we need to check if cache is
null
for when it's off.Type of change
How Has This Been Tested?
Checklist: