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.
p = ref.get();
}
if (p == null) {
final Lookup lookup = MimeLookup.getLookup (mimeType);
Lookup lookup = MimeLookup.getLookup (mimeType);
final ParserFactory parserFactory = lookup.lookup (ParserFactory.class);
ParserFactory parserFactory = lookup.lookup (ParserFactory.class);
if (parserFactory == null) {
int numberOfAttempts = 0;
while (parserFactory == null) {
// We live in a nice dynamic system, correct?
// Let's try again and keep our fingers crossed!
// http://netbeans.org/bugzilla/show_bug.cgi?id=210236
if (numberOfAttempts++ > 5) {
// Enough is enough!
throw new IllegalArgumentException("No parser for mime type: " + mimeType);
try {
Thread.sleep(3000);
} catch (InterruptedException ex) {
// Who cares?
lookup = MimeLookup.getLookup (mimeType);
parserFactory = lookup.lookup (ParserFactory.class);
p = parserFactory.createParser(Collections.<Snapshot>emptyList());
cachedParsers.put(mimeType, new TimedWeakReference<Parser>(p));