History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-14658
Type: Bug Bug
Status: Open Open
Assignee: Maxim Shafirov
Reporter: Serge Baranov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

False positive "condition is always true" inspection in finally block

Created: 31 Aug 07 03:10   Updated: 31 Aug 07 13:20
Component/s: Code Analysis. Inspection

Build: 7,234
Severity: Medium


 Description  « Hide
public class ConstantConditionBug {
  public static void main(String[] args) {
    for (int i = 0; i < 2; i++) {
      boolean doLockRelease = true;
      try {
        doLockRelease = false;
        break;
      } finally {
        if (doLockRelease) {
          System.out.println("bug");
        } else {
          System.out.println("no bug");
        }
      }
    }
  }
}

IDEA reports that doLockRelease is always true



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.