From af14da6a13aecf7885375b4fd13afdb2f58bd827 Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Mon, 20 Aug 2018 08:24:15 -0700 Subject: [PATCH] [starvation] stop considering View.get... as blocking. Reviewed By: ddino Differential Revision: D9397992 fbshipit-source-id: da6d5a987 --- infer/src/concurrency/RacerDConfig.ml | 8 ------- .../java/starvation/VisDispFrame.java | 24 ------------------- .../codetoanalyze/java/starvation/issues.exp | 1 - 3 files changed, 33 deletions(-) delete mode 100644 infer/tests/codetoanalyze/java/starvation/VisDispFrame.java diff --git a/infer/src/concurrency/RacerDConfig.ml b/infer/src/concurrency/RacerDConfig.ml index aa2c921f7..0d1868129 100644 --- a/infer/src/concurrency/RacerDConfig.ml +++ b/infer/src/concurrency/RacerDConfig.ml @@ -711,13 +711,6 @@ module Models = struct is_call_of_class ~actuals_pred ["android.os.IBinder"] "transact" |> Staged.unstage - (** is it a call to android.view.View.getWindowVisibleDisplayFrame? *) - let is_getWindowVisibleDisplayFrame = - is_call_of_class ~search_superclasses:false ["android.view.View"] - "getWindowVisibleDisplayFrame" - |> Staged.unstage - - (** is it a call to Future.get()? *) let is_future_get = is_call_of_class ~search_superclasses:false ~actuals_pred:empty_or_excessive_timeout @@ -747,7 +740,6 @@ module Models = struct ; (is_countdownlatch_await, High) ; (is_thread_sleep, High) ; (is_object_wait, High) - ; (is_getWindowVisibleDisplayFrame, Medium) ; (is_asyncTask_get, Low) ; (is_future_get, Low) ] in diff --git a/infer/tests/codetoanalyze/java/starvation/VisDispFrame.java b/infer/tests/codetoanalyze/java/starvation/VisDispFrame.java deleted file mode 100644 index b0259e127..000000000 --- a/infer/tests/codetoanalyze/java/starvation/VisDispFrame.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2018-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import android.view.View; -import android.graphics.Rect; -import android.support.annotation.UiThread; - -class VisDispFrame { - View view; - Rect rect; - - @UiThread - void callsGetVisibleDisplayFrameOnUiThreadBad() { - view.getWindowVisibleDisplayFrame(rect); - } - - void callsGetVisibleDisplayFrameOk() { - view.getWindowVisibleDisplayFrame(rect); - } -} diff --git a/infer/tests/codetoanalyze/java/starvation/issues.exp b/infer/tests/codetoanalyze/java/starvation/issues.exp index 46f1f4004..1874a41e9 100644 --- a/infer/tests/codetoanalyze/java/starvation/issues.exp +++ b/infer/tests/codetoanalyze/java/starvation/issues.exp @@ -41,4 +41,3 @@ codetoanalyze/java/starvation/SuppLint.java, SuppLint.onUiThreadBad():void, 26, codetoanalyze/java/starvation/ThreadSleep.java, ThreadSleep.indirectSleepOnUIThreadBad():void, 25, STARVATION, no_bucket, ERROR, [[Trace 1] `void ThreadSleep.indirectSleepOnUIThreadBad()`,locks `this.ThreadSleep.lock` in class `ThreadSleep*`,[Trace 2] `void ThreadSleep.lockAndSleepOnNonUIThread()`,locks `this.ThreadSleep.lock` in class `ThreadSleep*`,Method call: `void ThreadSleep.sleepOnAnyThreadOk()`,calls `void Thread.sleep(long)` from `void ThreadSleep.sleepOnAnyThreadOk()`] codetoanalyze/java/starvation/ThreadSleep.java, ThreadSleep.sleepOnUIThreadBad():void, 18, STARVATION, no_bucket, ERROR, [`void ThreadSleep.sleepOnUIThreadBad()`,calls `void Thread.sleep(long)` from `void ThreadSleep.sleepOnUIThreadBad()`] codetoanalyze/java/starvation/UIDeadlock.java, UIDeadlock.onUIThreadBad():void, 26, DEADLOCK, no_bucket, ERROR, [[Trace 1] `void UIDeadlock.onUIThreadBad()`,locks `this` in class `UIDeadlock*`,locks `this.UIDeadlock.lockB` in class `UIDeadlock*`,[Trace 2] `void UIDeadlock.notOnUIThreadBad()`,locks `this.UIDeadlock.lockB` in class `UIDeadlock*`,locks `this` in class `UIDeadlock*`] -codetoanalyze/java/starvation/VisDispFrame.java, VisDispFrame.callsGetVisibleDisplayFrameOnUiThreadBad():void, 18, STARVATION, no_bucket, ERROR, [`void VisDispFrame.callsGetVisibleDisplayFrameOnUiThreadBad()`,calls `void View.getWindowVisibleDisplayFrame(Rect)` from `void VisDispFrame.callsGetVisibleDisplayFrameOnUiThreadBad()`]