Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 545249

Summary: [12] AST View should not show the implicit break statement in the switch case statements
Product: [Eclipse Project] JDT Reporter: Sarika Sinha <sarika.sinha>
Component: UIAssignee: Kalyan Prasad Tatavarthi <kalyan_prasad>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P5 CC: daniel_megert, noopur_gupta, sarika.sinha
Version: 4.11Flags: sarika.sinha: review+
Target Milestone: 4.12 RC1   
Hardware: PC   
OS: All   
See Also: https://git.eclipse.org/r/142706
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=48895c900c6071a0e445995a0cb5ed8bca2b432a
Whiteboard:
Bug Depends on: 544748    
Bug Blocks: 539081, 545120    

Description Sarika Sinha CLA 2019-03-11 01:57:57 EDT
In the case of switchLabeledRule (->), Compiler adds implicit break statement for code to geneerate the required code. AST view can use the IsImplicitFlag from DOM to be able to decide to show break statements or not.
Comment 1 Sarika Sinha CLA 2019-03-18 23:41:01 EDT
As discussed in Bug 539080 :
 If implicit break does not have a label or optional expression then we need not show in the AST view, if it has additional label or expression node it should be shown.
Comment 2 Noopur Gupta CLA 2019-03-20 03:53:14 EDT
Another option could be to always show the implicit/explicit BreakStatement in AST view and also show the isImplicit boolean within that in the view. 

AST view is a developer productivity tool and should show the nodes in a way that will help the developers in understanding the correct AST structure.

Kalyan, please evaluate the two possibilities for all the cases where BreakStatement can be shown and go ahead with the one which helps during development.
Comment 3 Eclipse Genie CLA 2019-04-16 05:45:30 EDT
New Gerrit change created: https://git.eclipse.org/r/140658
Comment 4 Noopur Gupta CLA 2019-04-17 05:22:49 EDT
(In reply to Eclipse Genie from comment #3)
> New Gerrit change created: https://git.eclipse.org/r/140658

Sarika, please check if it works as expected for the API in AST view.
Comment 5 Kalyan Prasad Tatavarthi CLA 2019-05-15 05:20:39 EDT
(In reply to Noopur Gupta from comment #4)
> (In reply to Eclipse Genie from comment #3)
> > New Gerrit change created: https://git.eclipse.org/r/140658
> 
> Sarika, please check if it works as expected for the API in AST view.

This patch does not support highlighting of the ASTNode if code is selected.
For this to happen, the Existing AST needs to be traversed and rewritten with the nodes associated with Implicit break which is time consuming. As this is a low priority issue I am moving it out of 4.12
Comment 6 Eclipse Genie CLA 2019-05-24 01:53:21 EDT
New Gerrit change created: https://git.eclipse.org/r/142706
Comment 7 Sarika Sinha CLA 2019-05-24 06:04:02 EDT
Looks good for RC1.
+1 !