Bug 321742 - assert statement marks expression after colon as Dead code.
Summary: assert statement marks expression after colon as Dead code.
Status: CLOSED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-04 11:17 EDT by davisebugzilla CLA
Modified: 2010-08-04 13:45 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description davisebugzilla CLA 2010-08-04 11:17:12 EDT
Build Identifier: M20100211-1343

AFAIK, this is a legal assert.
try {
        flt = fConvert(sb.toString());
    } catch (NumberFormatException ex) {
        assert true: "Unexpected NumberFormatException while parsing " + s1;
    }
It generates the following error in Problems.
Description: Dead code
Resource: TargetResultsComparator.java
Path: /src/java/com/primerabio/ice/client/table
Location: line 49
Type: Java Problem



Reproducible: Always

Steps to Reproduce:
1.Use 'assert true: "Unexpected NumberFormatException while parsing " + s1;'
2.
3.
Comment 1 davisebugzilla CLA 2010-08-04 11:24:04 EDT
This is a stupid bug and I am embarrassed that I put in assert true when I should have used assert false.

Sorry for the bother.
Comment 2 Olivier Thomann CLA 2010-08-04 13:45:20 EDT
Closing as INVALID.