This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 182791 - No operations detected for ternary operator in a special case.
Summary: No operations detected for ternary operator in a special case.
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-25 14:57 UTC by Daniel Prusa
Modified: 2014-07-31 08:58 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Prusa 2010-03-25 14:57:25 UTC
Step Over Expression and (smart) Step Into do not work in the following code:

public class Main {
  private static boolean flag = false;

  public static void main(String[] args) {
    boolean b;
    b = flag ? isOdd(3) : isOdd(4); // Step Over Expression fails
    b = false ? isOdd(3) : isOdd(4); // Step Over Expression fails
  }

  public static boolean isOdd(int number) {
    return number % 2 == 1;
  }

}
Comment 1 Martin Entlicher 2011-05-02 09:47:20 UTC
The first case was already fixed by the fix of issue #197751.
The second case is still not recognized, because the compiler resolves the condition and in the bytecode there is only one method call. Therefore the matching algorithm fails.
Comment 2 Martin Entlicher 2014-07-30 22:11:45 UTC
Fixed by changeset:   277005:79820f947a60
http://hg.netbeans.org/core-main/rev/79820f947a60
Comment 3 Quality Engineering 2014-07-31 08:58:39 UTC
Integrated into 'main-silver', will be available in build *201407310738* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/79820f947a60
User: mentlicher@netbeans.org
Log: #182791: Detect boolean literal in the condition of a ternary operator.