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.
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.
Created attachment 31190 [details] test condition if
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.
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.
Created attachment 38654 [details] IDE snapshot
This a different issue. The problem is the println messages are not being created.
This issue is most likely related to 82874
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; } } }
Nested Combined fragments was now being handled. Now they are.
verified in build 070223_1. sunflower, I don't mark it verified yet. please reverify and mark update it if satisfied. thanks.
verified