internal static TypeWrapper LoadClassNoThrow(ClassLoaderWrapper classLoader, string name) { try { TypeWrapper wrapper = classLoader.LoadClassByDottedNameFast(name); if (wrapper == null) { string elementTypeName = name; if (elementTypeName.StartsWith("[")) { int skip = 1; while (elementTypeName[skip++] == '[') { ; } elementTypeName = elementTypeName.Substring(skip, elementTypeName.Length - skip - 1); } #if STATIC_COMPILER classLoader.IssueMessage(Message.ClassNotFound, elementTypeName); #else Tracer.Error(Tracer.ClassLoading, "Class not found: {0}", elementTypeName); #endif wrapper = new UnloadableTypeWrapper(name); } return(wrapper); } catch (RetargetableJavaException x) { // HACK keep the compiler from warning about unused local GC.KeepAlive(x); #if !STATIC_COMPILER && !FIRST_PASS && !STUB_GENERATOR && !NOEMIT if (Tracer.ClassLoading.TraceError) { java.lang.ClassLoader cl = (java.lang.ClassLoader)classLoader.GetJavaClassLoader(); if (cl != null) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); string sep = ""; while (cl != null) { sb.Append(sep).Append(cl); sep = " -> "; cl = cl.getParent(); } Tracer.Error(Tracer.ClassLoading, "ClassLoader chain: {0}", sb); } Exception m = ikvm.runtime.Util.mapException(x.ToJava()); Tracer.Error(Tracer.ClassLoading, m.ToString() + Environment.NewLine + m.StackTrace); } #endif // !STATIC_COMPILER && !FIRST_PASS && !STUB_GENERATOR return(new UnloadableTypeWrapper(name)); } }