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 78408 - RE Operation: (Drawing) two consecutive 'if' statements are laid on each other
Summary: RE Operation: (Drawing) two consecutive 'if' statements are laid on each other
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Reverse Engineering (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Trey Spiva
URL:
Keywords:
Depends on: 82874
Blocks:
  Show dependency tree
 
Reported: 2006-06-19 23:18 UTC by bugbridge
Modified: 2007-02-26 11:19 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test condition if (70.74 KB, application/octet-stream)
2006-06-19 23:21 UTC, Peter Lam
Details
IDE snapshot (43.11 KB, image/png)
2007-02-19 10:22 UTC, Alexandr Scherbatiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bugbridge 2006-06-19 23:18:57 UTC
Original status: 1-Dispatched; Suggested Status: NEW

These items should be added to the Status Whiteboard: UML_UST
Original submitter: sunflower

Description:
Steps to reproduce:

- Do Reverse Engineering of 'testConditionIf' method and create a Sequence diagram:

  ---------------------------------------------------------------
 public void testConditionIf(){
        
        int a = 10;
        int b = 20;
        
        if ( a > b ){
            a +=1;
        }else{
            b +=1;
        }
        
        if ( ( a + b ) != ( a * b ) ){
            a +=1;
        }else{
            b +=1;
        }
        
    }
  ---------------------------------------------------------------     
 
 - The second 'alt' Combined fragment is laid on the first
   Combined fragment (See attached picture).
   They are not consecutive.


Comments:
The same for the next code:
 ---------------------------------------------------------------
    public void testBlockSwitch(){
        
        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 0:  day = DAY.TUESDAY;
                case 1:  day = DAY.MONDAY; break;
                default: day = DAY.SUNDAY;
            }
            break;
            default:      name = day.getClass().getName();
        }
    }
 ---------------------------------------------------------------
One of inner 'switch' is layed laid on the another on the Sequence diagram.
Comment 1 Peter Lam 2006-06-19 23:21:21 UTC
Created attachment 31190 [details]
test condition if
Comment 2 Trey Spiva 2007-02-16 23:14:08 UTC
The location of a combined fragment is based on the messages that are surrounded by the combined 
fragment.  When a combined fragment did not surround any messages, we where not doing a very good 
job of determining the location the combined fragments.

Now we are trying to place the combined fragment relative to the messages before the combined 
fragment. 
Comment 3 Alexandr Scherbatiy 2007-02-19 10:20:05 UTC
The issue is reproduced for the following method:
-----------------------------------------------------
    public void test(int[] m){
        
        if(m.length == 2){
            
            if(m[0] < m [1]){
                System.out.println(m[0]);
            }
            
            if (m[0] > m [1]){
                System.out.println(m[1]);
            }
            
            if(m[0] == m [1]){
                System.out.println(m[0] + m[1]);
            }                        
        }
                
    }
-----------------------------------------------------
See the attached snapshot.
Comment 4 Alexandr Scherbatiy 2007-02-19 10:22:36 UTC
Created attachment 38654 [details]
IDE snapshot
Comment 5 Trey Spiva 2007-02-20 17:51:20 UTC
This a different issue.  The problem is the println messages are not being created.
Comment 6 Trey Spiva 2007-02-20 18:26:11 UTC
This issue is most likely related to 82874
Comment 7 Trey Spiva 2007-02-20 19:25:24 UTC
While the problem with the use case is that the println statements are not showing.  The following use 
case is still relevant.

public void test(int[] m){
        
        int a = -1;
        if(m.length == 2){
            
            if(m[0] < m [1]){
                a = m[1] - m[0];
             }
            
            if (m[0] > m [1]){
                a = m[0] - m[1];
             }
            
            if(m[0] == m [1]){
                a = 0;
            }                        
        }
                
    }
Comment 8 Trey Spiva 2007-02-21 00:46:01 UTC
Nested Combined fragments was now being handled.  Now they are.
Comment 9 Peter Lam 2007-02-24 02:07:26 UTC
verified in build 070223_1.
sunflower, I don't mark it verified yet. please reverify and mark update it if
satisfied. thanks.
Comment 10 Alexandr Scherbatiy 2007-02-26 11:19:21 UTC
verified