New issue
Advanced search Search tips

Issue 807705 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Feb 2018
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature



Sign in to add a comment

Redundant Assignments

Reported by wangsong...@gmail.com, Jan 31 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
Platform: chrome://android

Steps to reproduce the problem:
Our tool DeepTect detect redundant assignments: 
chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackScroller.java

private static void initContants() {
//This controls the viscous fluid effect (how much of it)
  sViscousFluidScale = 8.0f;
  // must be set to 1.0 (used in viscousFluid())
  sViscousFluidNormalize = 1.0f;
  sViscousFluidNormalize = 1.0f / viscousFluid(1.0f);
 }

In the above code snippet, the variable "sViscousFluidNormalize" is assigned twice consecutively, which makes the first assignment redundant.

What is the expected behavior?

What went wrong?
Our tool DeepTect detect redundant assignments: 
chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackScroller.java

private static void initContants() {
//This controls the viscous fluid effect (how much of it)
  sViscousFluidScale = 8.0f;
  // must be set to 1.0 (used in viscousFluid())
  sViscousFluidNormalize = 1.0f;
  sViscousFluidNormalize = 1.0f / viscousFluid(1.0f);
 }

In the above code snippet, the variable "sViscousFluidNormalize" is assigned twice consecutively, which makes the first assignment redundant.

Did this work before? N/A 

Chrome version: 63.0.3239.132  Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 
Status: WontFix (was: Unconfirmed)
Actually read the comment. That the variable is used in the method call and therefore needs to be assigned before hand.

Sounds like your tool returns false positives.

Comment 2 Deleted

Thanks for your quick feedback, I just checked the code and you are right. This is good case to improve my tool.

Sign in to add a comment