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

(-)a/ide.kit/test/qa-functional/src/org/netbeans/test/ide/BlacklistedClassesHandlerSingleton.java (-1 / +8 lines)
Lines 72-77 Link Here
72
import java.util.logging.Level;
72
import java.util.logging.Level;
73
import java.util.logging.LogRecord;
73
import java.util.logging.LogRecord;
74
import java.util.logging.Logger;
74
import java.util.logging.Logger;
75
import org.netbeans.ProxyClassLoader;
76
import org.openide.util.Exceptions;
75
77
76
/**
78
/**
77
 * BlacklistedClassesHandler performs processing of log messages to identify
79
 * BlacklistedClassesHandler performs processing of log messages to identify
Lines 342-347 Link Here
342
                    if (className.matches(".*\\$\\d+")) {
344
                    if (className.matches(".*\\$\\d+")) {
343
                        return;
345
                        return;
344
                    }
346
                    }
347
                    System.err.println("XXX initiated loading of " + className);
345
                    if (blacklist.containsKey(className)) { //violator
348
                    if (blacklist.containsKey(className)) { //violator
346
                        Exception exc = new BlacklistedClassesViolationException(record.getParameters()[0].toString());
349
                        Exception exc = new BlacklistedClassesViolationException(record.getParameters()[0].toString());
347
                        // Check for AntProjectModule.checkForXalan() - fails on MacOSX
350
                        // Check for AntProjectModule.checkForXalan() - fails on MacOSX
Lines 406-416 Link Here
406
    }
409
    }
407
410
408
    public void register() {
411
    public void register() {
412
        try {
413
            Class.forName("org.netbeans.ProxyClassLoader");
414
        } catch (ClassNotFoundException x) {
415
            assert false : x;
416
        }
409
        Logger logger = Logger.getLogger("org.netbeans.ProxyClassLoader"); // NOI18N
417
        Logger logger = Logger.getLogger("org.netbeans.ProxyClassLoader"); // NOI18N
410
        logger.addHandler(this);
418
        logger.addHandler(this);
411
        logger.setLevel(Level.ALL);
419
        logger.setLevel(Level.ALL);
412
        logger.setUseParentHandlers(false);
420
        logger.setUseParentHandlers(false);
413
        System.setProperty("org.netbeans.ProxyClassLoader.level", "ALL"); // NOI18N
414
    }
421
    }
415
422
416
    public void unregister() {
423
    public void unregister() {
(-)a/o.n.bootstrap/src/org/netbeans/ProxyClassLoader.java (-11 / +5 lines)
Lines 76-89 Link Here
76
public class ProxyClassLoader extends ClassLoader {
76
public class ProxyClassLoader extends ClassLoader {
77
77
78
    private static final Logger LOGGER = Logger.getLogger(ProxyClassLoader.class.getName());
78
    private static final Logger LOGGER = Logger.getLogger(ProxyClassLoader.class.getName());
79
    private static final boolean LOG_LOADING;
80
    private static final ClassLoader TOP_CL = ProxyClassLoader.class.getClassLoader();
79
    private static final ClassLoader TOP_CL = ProxyClassLoader.class.getClassLoader();
81
80
82
    static {
83
        boolean prop1 = System.getProperty("org.netbeans.ProxyClassLoader.level") != null;
84
        LOG_LOADING = prop1 || LOGGER.isLoggable(Level.FINE);
85
    }
86
87
    /** All known packages */
81
    /** All known packages */
88
    private final Map<String, Package> packages = new HashMap<String, Package>();
82
    private final Map<String, Package> packages = new HashMap<String, Package>();
89
83
Lines 187-195 Link Here
187
    @Override
181
    @Override
188
    protected synchronized Class loadClass(String name, boolean resolve)
182
    protected synchronized Class loadClass(String name, boolean resolve)
189
                                            throws ClassNotFoundException {
183
                                            throws ClassNotFoundException {
190
        if (LOG_LOADING && !name.startsWith("java.")) {
184
        if (LOGGER.isLoggable(Level.FINEST) && !name.startsWith("java.")) {
191
            LOGGER.log(Level.FINEST, "{0} initiated loading of {1}",
185
            LOGGER.log(Level.FINEST, "{0} initiated loading of {1}", new Object[] {this, name});
192
                    new Object[] {this, name});
193
        }
186
        }
194
        
187
        
195
        Class cls = null;
188
        Class cls = null;
Lines 304-311 Link Here
304
                throw (NoClassDefFoundError) new NoClassDefFoundError(e.getMessage() + " while loading " + pkg + name +
297
                throw (NoClassDefFoundError) new NoClassDefFoundError(e.getMessage() + " while loading " + pkg + name +
305
                        "; see http://wiki.netbeans.org/DevFaqTroubleshootClassNotFound").initCause(e); // NOI18N
298
                        "; see http://wiki.netbeans.org/DevFaqTroubleshootClassNotFound").initCause(e); // NOI18N
306
            }
299
            }
307
            if (LOG_LOADING && !name.startsWith("java.")) LOGGER.log(Level.FINEST, "{0} loaded {1}",
300
            if (LOGGER.isLoggable(Level.FINEST) && !name.startsWith("java.")) {
308
                        new Object[] {this, name});
301
                LOGGER.log(Level.FINEST, "{0} loaded {1}", new Object[] {this, name});
302
            }
309
        }
303
        }
310
        return cls; 
304
        return cls; 
311
    }
305
    }

Return to bug 194549