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.
Platform derived from 080324, JDK 6u3, Ubuntu. I had just tried to create a j2seproject. After clicking Finish, the dialog box "Opening <project>" opened but never closed. Thread dumps reveal some kind of deadlock, apparently in class loading, apparently between class LibraryAccessor { public static LibraryAccessor DEFAULT; static { try { Object o = Class.forName("org.netbeans.api.project.libraries.Library", true, ...); } catch (...) } } and class Library { static { LibraryAccessor.DEFAULT = new LibraryAccessor () {...}; } } Yarda do you know of any reason why this accessor pattern could deadlock in this way?
Created attachment 59139 [details] Thread dumps
The accessor pattern is deadlock prone. The deadlock can be fixed like it is done in JavaSourceAccessor. ACCESSOR: public static synchronized JavaSourceAccessor getINSTANCE () { if (INSTANCE == null) { try { Class.forName("org.netbeans.api.java.source.JavaSource", true, JavaSourceAccessor.class.getClassLoader()); //NOI18N assert INSTANCE != null; } catch (ClassNotFoundException e) { Exceptions.printStackTrace(e); } } return INSTANCE; } public static void setINSTANCE (JavaSourceAccessor instance) { assert instance != null; INSTANCE = instance; } private static volatile JavaSourceAccessor INSTANCE; JavaSource static init just calls setINSTANCE().
Fixed in: 605701ceff59