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.

View | Details | Raw Unified | Return to bug 32586
Collapse All | Expand All

(-)FilterNode.java (-18 / +26 lines)
Lines 1261-1262 Link Here
1261
        private Object replaceNodes (Object orig) {
1261
        private Object replaceNodes (Object orig, Class clazz ) {
1262
            if (orig == node.getOriginal()) {
1262
            if (isNodeQuery( clazz ) && orig == node.getOriginal() && clazz.isInstance( node )) {
1263
--
Line 1314 Link Here
1314
            return replaceNodes (checkNode ().lookup (clazz));
1314
            return replaceNodes (checkNode ().lookup (clazz), clazz );
1315
--
Line 1317 Link Here
1317
        /** Finds out whether a query for a class can be influenced 
1318
         * by a state of the "nodes" lookup and whether we should 
1319
         * initialize listening
1320
         */
1321
        private static boolean isNodeQuery (Class c) {
1322
            return Node.class.isAssignableFrom (c) || c.isAssignableFrom (Node.class);
1323
        }
1324
        
Line 1318 Link Here
1318
            return new FilterItem (checkNode ().lookupItem (template));
1326
            Item i = checkNode ().lookupItem (template);
1319
--
1327
            return isNodeQuery (template.getType ()) ? new FilterItem (i, template.getType()) : i;
Lines 1388-1391 Link Here
1388
                ArrayList ll = new ArrayList (c.size ());
1397
                if (isNodeQuery (template.getType ())) {
1389
                Iterator it = c.iterator();
1398
                    ArrayList ll = new ArrayList (c.size ());
1390
                while (it.hasNext()) {
1399
                    Iterator it = c.iterator();
1391
                    ll.add (replaceNodes (it.next ()));
1400
                    while (it.hasNext()) {
1392
--
1401
                        ll.add (replaceNodes (it.next (), template.getType()));
1402
                    }
1403
                    return ll;
1404
                } else {
1405
                    return c;
Lines 1393-1394 Link Here
1393
                
1394
                return ll;
Line 1427 Link Here
1439
            private Class clazz;
Line 1428 Link Here
1428
            FilterItem (Item d) {
1441
            FilterItem (Item d, Class clazz) {
1429
--
Line 1430 Link Here
1443
                this.clazz = clazz;
Line 1441 Link Here
1441
                return replaceNodes (delegate.getInstance ());
1455
                return replaceNodes (delegate.getInstance (), clazz);
1442
--

Return to bug 32586