Bug 23118

Summary: AST: BreakStatement & ContinueStatement: wrong length
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: akiezun
Version: 2.0   
Target Milestone: 2.1 M1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Martin Aeschlimann CLA 2002-09-03 11:13:03 EDT
2.1 20020728
The length of a does not include the semicolon belonging to the break statement.
Same problem with the continue statement.
Comment 1 Adam Kiezun CLA 2002-09-03 11:21:34 EDT
here're some more for the test suite:
1. while 	
2. for
3. switch
4. local type creation

Comment 2 Olivier Thomann CLA 2002-09-03 11:31:17 EDT
Please let me know which test suite I should run to double check that the fixes 
are working.
I don't understand why the switch statement is a problem. This statement is not 
followed by a semi-colon.
Comment 3 Adam Kiezun CLA 2002-09-03 11:40:19 EDT
stupid me - i was wrong in all 4 cases :)
sorry

anyways, the test suites are: 
org.eclipse.jdt.ui.tests.all.AllAllTests
org.eclipse.jdt.ui.tests.AutomatedSuite
Comment 4 Martin Aeschlimann CLA 2002-09-03 12:04:24 EDT
from my side, no test cases directly covers this bug, I could add one for it.
however,
  org.eclipse.jdt.ui.tests.astrewrite.ASTRewritingTest
  in org.eclipse.jdt.ui.tests
contains over 40 test cases covering almost all nodes and doing things using 
their positions.
Comment 5 Adam Kiezun CLA 2002-09-03 12:17:07 EDT
to make sure that this bug dies a nasty death and never shows up again i added:
StructureSelectionActionTests::test34()
StructureSelectionActionTests::test35()
Comment 6 Olivier Thomann CLA 2002-09-03 12:22:25 EDT
Which version of JDT/UI should I use in my workspace to run these tests?
Are they green? Any known problems except this position issue?
Comment 7 Adam Kiezun CLA 2002-09-03 12:39:56 EDT
grab the latest

they're disabled until this report is closed and they can be run green.
in general, when you run our test suites you'll see messages dumped to the 
console.
sth like this (just more):

org.eclipse.jdt.ui.tests.actions.StructureSelectionActionTests::test35 disabled 
(regression test for bug#23118)

org.eclipse.jdt.ui.tests.actions.StructureSelectionActionTests::test34 disabled 
(regression test for bug#23118)

org.eclipse.jdt.ui.tests.actions.StructureSelectionActionTests::test33 disabled 
(regression test for bug#22939)

org.eclipse.jdt.ui.tests.actions.StructureSelectionActionTests::test32 disabled 
(regression test for bug#22939)
Comment 8 Olivier Thomann CLA 2002-09-03 16:27:12 EDT
Fixed and released in 2.1 stream. I ran these two tests successfully 
org.eclipse.jdt.ui.tests.actions.StructureSelectionActionTests::test35 disabled 
(regression test for bug#23118)

org.eclipse.jdt.ui.tests.actions.StructureSelectionActionTests::test34 disabled 
(regression test for bug#23118)

+ the ones I added in ASTConverterTests.
Comment 9 David Audel CLA 2002-09-19 04:43:45 EDT
Verified.
Comment 10 Olivier Thomann CLA 2002-09-19 11:07:51 EDT
Regression tests added (test0373, test0374)