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 78526 - Select in Model action selects Outer class for Inner classes
Summary: Select in Model action selects Outer class for Inner classes
Status: RESOLVED WONTFIX
Alias: None
Product: uml
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P4 blocker (vote)
Assignee: issues@uml
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-20 12:21 UTC by bugbridge
Modified: 2009-01-14 17:33 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bugbridge 2006-06-20 12:21:33 UTC
Step to reproduce:

- Create a java project
- Create a uml project and associate it to the java project
- Create a class diagram
- Add class to the diagram and name it 'Outer'
- Go to the source code of the class
- Add inner 'Inner' class to the 'Outer' class
  -----------------------------------------------------------
  public class Outer {
    
    class Inner {
        
        double add(double a, double b){
            return a + b;
        }
        
    }
    
  }
  -----------------------------------------------------------

- Go to the body of the 'Inner' class and press <Ctrl+Shift+4>

  'Outer' class is selected under UML model tree instead of
  'Outer|Inner' class.

Evaluation:
The way it works is that DataObject cookie from activated node is retrieved to
determine its associated UML project, and then the tree is searched to locate
the model element based on the selected source node package hirachy and name.
The data object is available regardless of the document open status, user can
select the source node (even package node) from java project tree and locate its
model element. This feature does not and should not go with the granularity at
the editor cursor level, it is consistent with NB 'Select in Project' behavior.
Please re-evaluate and provide your feedbacks, thanks.

Evaluation (Entry 2):
'Select in Model' and 'Select in Project' search for different node types.

'Select in Project' looks for source file node.
and 'Select in Model' should look for class element node.

let's try the following example:
source file test.java with the following java code (without public classes):
-------------------------------
class MyTest {
}

class HisTest {
}
-------------------------------
Result:
'Select in Project' will correctly find test.java source node.
'Select in Model' will find nothing!
May be It should look from which class source declaration it was invoked?
And use Public class only if it was invoked outside any class?

Evaluation (Entry 3):
I probably missed something, but I tried the case, 'Select in Model' does find
something, it selects the outer class element node as stated in original
description. The reason is that we can only detect the data object associated
with the activated node, in this case, editor, the data object is the outer
class source file and search from there. Once user gets to the outer class
element node, it should be easy to expand and find the inner class node.

I'm not sure if we should go extra miles to locate the element at the cursor
point, data object approach works generically, even when editor is not open.
User can select a java node on java project tree and locate its corresponding
model element, but again at outer class level.
Comment 1 Trey Spiva 2006-08-11 22:19:21 UTC
I am ok that we only find the outer class.  The example where none of the
classes are the name of the source file is a valid issue.  However, I think this
is a very low priority use case.
Comment 2 Trey Spiva 2006-08-11 22:19:49 UTC
I am ok that we only find the outer class.  The example where none of the
classes are the name of the source file is a valid issue.  However, I think this
is a very low priority use case.
Comment 3 Andrew Korostelev 2006-08-14 09:59:56 UTC
'Select in Model' function works incorrectly in several cases.
Bug describes incorrect behaviour that may confuse user.
Thus it can't be P4.
Change it to P3.
Comment 4 Trey Spiva 2006-08-14 14:14:55 UTC
Select in model may not work correctly for other cases, but this issue is a low
priority issue.  I am changing it to p4.  If it does not work for other cases, I
am assuming you have created other issues.
Comment 5 Sergey Petrov 2009-01-14 17:33:24 UTC
corner or minor case