Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
View | Details | Raw Unified | Return to bug 96565
Collapse All | Expand All

(-)src/java/org/netbeans/server/componentsmatch/Matcher.java (-7 / +23 lines)
 Lines 38-44    Link Here 
38
    static List<Package> allPackages;
38
    static List<Package> allPackages;
39
39
40
    static Matcher defaultMatcher;
40
    static Matcher defaultMatcher;
41
    // XXX I am not sure if it is best ide to check netbeans.org prefixes
41
    static final String ORG_NETBEANS_MODULES = "org.netbeans.modules";    
42
    // XXX I am not sure if it is the best idea to check netbeans.org prefixes
42
    // it is not applicable to other product (rave, etc)
43
    // it is not applicable to other product (rave, etc)
43
    static final String[] NB_ORG_PREFIXES = new String[] {
44
    static final String[] NB_ORG_PREFIXES = new String[] {
44
        "org.openide.","org.netbeans.","org.apache.tools.ant.module.","org.openidex."
45
        "org.openide.","org.netbeans.","org.apache.tools.ant.module.","org.openidex."
 Lines 85-90    Link Here 
85
            Package pack = getPackage(packageName);
86
            Package pack = getPackage(packageName);
86
            if (pack != null) {
87
            if (pack != null) {
87
                return pack.getFirstComponent();
88
                return pack.getFirstComponent();
89
            } else {
90
                 // try merge other packages
91
                 if (checkNetBeansOrgSubPackage(packageName)) {
92
                    pack = getPackageMerger().getPackage(packageName);
93
                    if (pack != null) {
94
                        Component comp = pack.getFirstComponent();
95
                        if (comp != null ) {
96
                            String cname = comp.getComponent();
97
                            String subName = comp.getSubComponent();
98
                            if (!((cname.equals("core") || cname.equals("openide")) &&
99
                                    subName.equals("code"))) {
100
                                return comp;
101
                            } 
102
                        }
103
                    }
104
                 } 
105
                
88
            }
106
            }
89
        }
107
        }
90
        return null;
108
        return null;
 Lines 97-111    Link Here 
97
             int lastDot = name.lastIndexOf('.');
115
             int lastDot = name.lastIndexOf('.');
98
             if (lastDot != -1) {
116
             if (lastDot != -1) {
99
                 name = name.substring(0,lastDot);
117
                 name = name.substring(0,lastDot);
118
                 if (name.equals(ORG_NETBEANS_MODULES)) {
119
                     return null;
120
                 }
100
                 pack = getPackage(name);
121
                 pack = getPackage(name);
101
             }
122
             }
102
         }
123
         }
103
         if (pack == null) {
124
  
104
             // try merge other packages
105
             if (checkNetBeansOrgSubPackage(name)) {
106
                pack = getPackageMerger().getPackage(name);
107
             }
108
         }
109
         return pack;
125
         return pack;
110
    }
126
    }
111
    
127
    
(-)test/org/netbeans/server/componentsmatch/MatcherTest.java (+4 lines)
 Lines 74-78    Link Here 
74
        assertEquals("j2ee",comp.getComponent());
74
        assertEquals("j2ee",comp.getComponent());
75
        assertEquals("refactoring",comp.getSubComponent());
75
        assertEquals("refactoring",comp.getSubComponent());
76
76
77
       comp = matcher.match(new StackTraceElement[] {
78
            new StackTraceElement("org.netbeans.modules.reallyunknownmodule.Aaa","getDefault()","file",45)
79
        }); 
80
        assertNull(comp);
77
    }
81
    }
78
}
82
}

Return to bug 96565
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo