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 79081

Summary: RE Operation: Nested switch blocks are parsed incorrectly
Product: uml Reporter: Alexandr Scherbatiy <sunflower>
Component: Reverse EngineeringAssignee: issues@uml <issues>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: nested switch blocks
nested switch blocks (Latest IDE)
NPE when RE the operation with switch block
The sequence diagram in NB6 is incorrect too. It is different from nb5.5.1. Attached the diagram which is generated with build 070718

Description Alexandr Scherbatiy 2006-06-26 13:22:50 UTC
Steps to reproduce:


- Do Reverse Engineering of 'void test()'  method from
  'Test' class and create a Sequence diagram:
  ---------------------------------------------------------------     
  public class Test {
    enum DAY {
        SUNDAY,
        MONDAY,
        TUESDAY,
        WEDNESDAY,
        THURSDAY,
        FRIDAY,
        SATURDAY
    }
    
    public void test(){
        
        int n = 20;
        String name = "";
        DAY day = DAY.MONDAY;
        
        switch(day){
            case SUNDAY:  name = day.toString();
            switch(n){
                case 0:  day = DAY.SUNDAY;
                case 1:  day = DAY.MONDAY; break;
                default: day = DAY.TUESDAY;
            }
            
            case MONDAY:  name = day.name();
            switch(n){
                case 2:  day = DAY.TUESDAY;
                case 3:  day = DAY.MONDAY; break;
                default: day = DAY.SUNDAY;
            }
            break;
            default:  name = day.getClass().getName();
        }
    }      
  }

  ---------------------------------------------------------------     

  The outer Combined fragment has 3 interaction operands on the Sequence 
  diagram.
  The fist operand has '[n]' expression  instead of '[ day = SUNDAY ]'.
  The second operand has '[n]' expression  instead of '[ day = MONDAY ]'.
Comment 1 Alexandr Scherbatiy 2006-06-26 13:24:57 UTC
Created attachment 31376 [details]
nested switch blocks
Comment 2 Alexandr Scherbatiy 2007-02-26 11:05:32 UTC
Created attachment 38898 [details]
nested switch blocks (Latest IDE)
Comment 3 Alexandr Scherbatiy 2007-02-28 14:02:12 UTC
Created attachment 38976 [details]
NPE when RE the operation with switch block
Comment 4 Sherry Zhou 2007-07-18 23:46:14 UTC
Created attachment 45353 [details]
The sequence diagram in NB6 is incorrect too. It is different from nb5.5.1. Attached the diagram which is generated with build 070718
Comment 5 Sergey Petrov 2008-05-14 15:17:53 UTC
as for graphics issue: it's much better now(look), but not yet perfect, at least nested cfs are located inside correct
operands, but still may be sometimes in wrong ordering with messages. in fact it's the issue with combined fragments
which do not contain messages, usually with primitive types.
yet have [n] instead of correct expressions, it's second issue is model and both amy need to be separated.