Baseflow / Baseflow/PhotoView

variable 'pendingScaleType' always be null

Open
#722 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
18.8k
Forks
3.9k
PR merge metrics
No merged PRs in 30d

Description

In class PhotoView, variable 'pendingScaleType' is always null.
There isn't any assigment in source code. Thus in method 'init()'

```java
if (pendingScaleType != null) {
setScaleType(pendingScaleType);
pendingScaleType = null;
}
```

called in constructor method, the snippet cannot be executed in.

Similarly, overrided method 'setScaleType()' has if branch.

```java
@Override
public void setScaleType(ScaleType scaleType) {
if (attacher == null) {
pendingScaleType = scaleType;
} else {
attacher.setScaleType(scaleType);
}
}
```

'attacher' is initialized in 'init()' method called by whichever constructor method. So 'attcher' is impossible null, and 'pendingScaleType' assignment branch cannot be executed.

Am I wrong??!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.