ClassElement getClass(Identifier name) fixed to match implementation in SourceElementImpl in java module
1.1 --- a/clazz/src/org/netbeans/modules/clazz/SourceElementImpl.java Thu Nov 07 16:00:05 2002 +0000
1.2 +++ b/clazz/src/org/netbeans/modules/clazz/SourceElementImpl.java Thu Nov 07 17:11:18 2002 +0000
1.3 @@ -141,7 +141,22 @@
1.4 * @return the element or null if such class does not exist
1.5 */
1.6 public ClassElement getClass (Identifier name) {
1.7 - return (ClassElement)getAllClassesMap ().get(name);
1.8 + ClassElement el = getClassElement();
1.9 + String srcName = name.getSourceName();
1.10 + String fullName = name.getFullName();
1.11 + Identifier idEl = el.getName();
1.12 + String srcEl = idEl.getSourceName();
1.13 + String fullEl = idEl.getFullName();
1.14 +
1.15 + if (srcEl.equals(srcName)) {
1.16 + if (srcName.equals(fullName) || fullEl.equals(fullName))
1.17 + return el;
1.18 + else
1.19 + return null;
1.20 + } else if (fullEl.equals(fullName)) {
1.21 + return el;
1.22 + }
1.23 + return null;
1.24 }
1.25
1.26 /** @return Top level class which we are asociated with
1.27 @@ -295,25 +310,3 @@
1.28 return new SourceElement(this);
1.29 }
1.30 }
1.31 -
1.32 -/*
1.33 -* Log
1.34 -* 11 src-jtulach1.10 1/20/00 David Simonek #2119 bugfix
1.35 -* 10 src-jtulach1.9 10/23/99 Ian Formanek NO SEMANTIC CHANGE - Sun
1.36 -* Microsystems Copyright in File Comment
1.37 -* 9 src-jtulach1.8 9/14/99 David Simonek classes with no package
1.38 -* now supported correctly
1.39 -* 8 src-jtulach1.7 8/9/99 Ian Formanek Generated Serial Version
1.40 -* UID
1.41 -* 7 src-jtulach1.6 7/8/99 Petr Hamernik runAtomic simple
1.42 -* implementation
1.43 -* 6 src-jtulach1.5 6/9/99 Ian Formanek ---- Package Change To
1.44 -* org.openide ----
1.45 -* 5 src-jtulach1.4 4/1/99 Jan Jancura Object browser support
1.46 -* 4 src-jtulach1.3 3/26/99 David Simonek properties, actions
1.47 -* completed, more robust now
1.48 -* 3 src-jtulach1.2 2/17/99 Petr Hamernik serialization changed.
1.49 -* 2 src-jtulach1.1 2/11/99 David Simonek
1.50 -* 1 src-jtulach1.0 1/29/99 David Simonek
1.51 -* $
1.52 -*/