[inefficientKeysetIterator] Turn on by default and fix msg

Reviewed By: jvillard

Differential Revision: D16339180

fbshipit-source-id: c71c7394d
master
Ezgi Çiçek 5 years ago committed by Facebook Github Bot
parent 6c9e4e52c6
commit 998e7c8fe3

@ -98,8 +98,9 @@ OPTIONS
--no-default-checkers
Deactivates: Default checkers: --biabduction,
--fragment-retains-view, --linters, --liveness, --racerd, --siof,
--starvation, --uninit (Conversely: --default-checkers)
--fragment-retains-view, --inefficient-keyset-iterator, --linters,
--liveness, --racerd, --siof, --starvation, --uninit (Conversely:
--default-checkers)
--eradicate
Activates: the eradicate @Nullable checker for Java annotations
@ -140,10 +141,10 @@ OPTIONS
Activates: Enable --immutable-cast and disable all other checkers
(Conversely: --no-immutable-cast-only)
--inefficient-keyset-iterator
Activates: Check for inefficient uses of keySet iterator instead
of entrySet iterator. (Conversely:
--no-inefficient-keyset-iterator)
--no-inefficient-keyset-iterator
Deactivates: Check for inefficient uses of keySet iterator that
access both the key and the value. (Conversely:
--inefficient-keyset-iterator)
--inefficient-keyset-iterator-only
Activates: Enable --inefficient-keyset-iterator and disable all

@ -287,9 +287,9 @@ OPTIONS
--no-default-checkers
Deactivates: Default checkers: --biabduction,
--fragment-retains-view, --linters, --liveness, --racerd, --siof,
--starvation, --uninit (Conversely: --default-checkers)
See also infer-analyze(1).
--fragment-retains-view, --inefficient-keyset-iterator, --linters,
--liveness, --racerd, --siof, --starvation, --uninit (Conversely:
--default-checkers) See also infer-analyze(1).
--no-default-linters
Deactivates: Use the default linters for the analysis.
@ -621,10 +621,10 @@ OPTIONS
Activates: Enable --immutable-cast and disable all other checkers
(Conversely: --no-immutable-cast-only) See also infer-analyze(1).
--inefficient-keyset-iterator
Activates: Check for inefficient uses of keySet iterator instead
of entrySet iterator. (Conversely:
--no-inefficient-keyset-iterator) See also infer-analyze(1).
--no-inefficient-keyset-iterator
Deactivates: Check for inefficient uses of keySet iterator that
access both the key and the value. (Conversely:
--inefficient-keyset-iterator) See also infer-analyze(1).
--inefficient-keyset-iterator-only
Activates: Enable --inefficient-keyset-iterator and disable all

@ -287,9 +287,9 @@ OPTIONS
--no-default-checkers
Deactivates: Default checkers: --biabduction,
--fragment-retains-view, --linters, --liveness, --racerd, --siof,
--starvation, --uninit (Conversely: --default-checkers)
See also infer-analyze(1).
--fragment-retains-view, --inefficient-keyset-iterator, --linters,
--liveness, --racerd, --siof, --starvation, --uninit (Conversely:
--default-checkers) See also infer-analyze(1).
--no-default-linters
Deactivates: Use the default linters for the analysis.
@ -621,10 +621,10 @@ OPTIONS
Activates: Enable --immutable-cast and disable all other checkers
(Conversely: --no-immutable-cast-only) See also infer-analyze(1).
--inefficient-keyset-iterator
Activates: Check for inefficient uses of keySet iterator instead
of entrySet iterator. (Conversely:
--no-inefficient-keyset-iterator) See also infer-analyze(1).
--no-inefficient-keyset-iterator
Deactivates: Check for inefficient uses of keySet iterator that
access both the key and the value. (Conversely:
--inefficient-keyset-iterator) See also infer-analyze(1).
--inefficient-keyset-iterator-only
Activates: Enable --inefficient-keyset-iterator and disable all

@ -655,8 +655,8 @@ and ( annotation_reachability
"the detection of object cast from immutable type to mutable type. For instance, it will \
detect cast from ImmutableList to List, ImmutableMap to Map, and ImmutableSet to Set."
and inefficient_keyset_iterator =
mk_checker ~long:"inefficient-keyset-iterator" ~default:false
"Check for inefficient uses of keySet iterator instead of entrySet iterator."
mk_checker ~long:"inefficient-keyset-iterator" ~default:true
"Check for inefficient uses of keySet iterator that access both the key and the value."
and linters = mk_checker ~long:"linters" ~default:true "syntactic linters"
and litho = mk_checker ~long:"litho" "Experimental checkers supporting the Litho framework"
and liveness =

@ -92,6 +92,7 @@ codetoanalyze/java/infer/GuardedByExample.java, codetoanalyze.java.infer.Guarded
codetoanalyze/java/infer/GuardedByExample.java, codetoanalyze.java.infer.GuardedByExample.writeFBadWrongLock():void, 2, UNSAFE_GUARDED_BY_ACCESS, no_bucket, ERROR, [start of procedure writeFBadWrongLock()]
codetoanalyze/java/infer/HashMapExample.java, codetoanalyze.java.infer.HashMapExample.getAfterClearBad():void, 5, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure getAfterClearBad()]
codetoanalyze/java/infer/HashMapExample.java, codetoanalyze.java.infer.HashMapExample.getAfterRemovingTheKeyBad():void, 5, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure getAfterRemovingTheKeyBad()]
codetoanalyze/java/infer/HashMapExample.java, codetoanalyze.java.infer.HashMapExample.getFromKeySetGood_FP(java.util.HashMap):void, 2, INEFFICIENT_KEYSET_ITERATOR, no_bucket, ERROR, [Accessing a value using a key that was retrieved from a `keySet` iterator. It is more efficient to use an iterator on the `entrySet` of the map, avoiding the extra `HashMap.get(key)` lookup.]
codetoanalyze/java/infer/HashMapExample.java, codetoanalyze.java.infer.HashMapExample.getFromKeySetGood_FP(java.util.HashMap):void, 3, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure getFromKeySetGood_FP(...),Taking true branch]
codetoanalyze/java/infer/HashMapExample.java, codetoanalyze.java.infer.HashMapExample.getOneIntegerWithoutCheck():int, 6, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure getOneIntegerWithoutCheck()]
codetoanalyze/java/infer/HashMapExample.java, codetoanalyze.java.infer.HashMapExample.getTwoIntegersWithOneCheck(java.lang.Integer,java.lang.Integer):void, 8, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure getTwoIntegersWithOneCheck(...),Taking true branch,Taking true branch]

Loading…
Cancel
Save