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 29339
Collapse All | Expand All

(-)core/bootstrap/src/org/netbeans/ProxyClassLoader.java (-5 / +13 lines)
Lines 133-148 Link Here
133
    protected synchronized final Class loadClass(String name, boolean resolve)
133
    protected synchronized final Class loadClass(String name, boolean resolve)
134
                                            throws ClassNotFoundException {
134
                                            throws ClassNotFoundException {
135
        zombieCheck(name);
135
        zombieCheck(name);
136
        String filename = name.replace('.', '/').concat(".class"); // NOI18N
136
        StringBuffer sb = new StringBuffer (name.length() + 6);
137
        int idx = filename.lastIndexOf('/'); // NOI18N
137
        sb.append(name);
138
        int i = 0;
139
        int idx=-1;
140
        while (true) {
141
            i = sb.indexOf (".", i); //NOI18N
142
            if (i==-1) break;
143
            sb.setCharAt (i, '/'); 
144
            idx=i;
145
        }
138
        if (idx == -1) throw new ClassNotFoundException("Will not load classes from default package"); // NOI18N
146
        if (idx == -1) throw new ClassNotFoundException("Will not load classes from default package"); // NOI18N
139
        String pkg = filename.substring(0, idx + 1); // "org/netbeans/modules/foo/"
147
        sb.append (".class"); //NOI18N
140
        Class c = smartLoadClass(name, filename, pkg);
148
        String pkg = sb.substring (0, idx+1);  // "org/netbeans/modules/foo/"
149
        Class c = smartLoadClass(name, sb.toString(), pkg);
141
        if(c == null) throw new ClassNotFoundException(name);
150
        if(c == null) throw new ClassNotFoundException(name);
142
        if (resolve) resolveClass(c);
151
        if (resolve) resolveClass(c);
143
        return c;
152
        return c;
144
    }
153
    }
145
    
146
    /** This ClassLoader can't load anything itself. Subclasses
154
    /** This ClassLoader can't load anything itself. Subclasses
147
     * may override this method to do some class loading themselves. The
155
     * may override this method to do some class loading themselves. The
148
     * implementation should not throw any exception, just return
156
     * implementation should not throw any exception, just return

Return to bug 29339