/// <summary>Print short string, to optimize dumping.</summary> /// <remarks>Print short string, to optimize dumping.</remarks> /// <hide></hide> public virtual void printShortString(java.io.PrintWriter pw) { pw.print("{alpha="); pw.print(mAlpha); pw.print(" matrix="); mMatrix.printShortString(pw); pw.print('}'); }
/// <hide>Just for debugging; not internationalized.</hide> public static void formatDuration(long duration, java.io.PrintWriter pw, int fieldLen ) { lock (sFormatSync) { int len = formatDurationLocked(duration, fieldLen); pw.print(new string(sFormatStr, 0, len)); } }
/// <hide>Just for debugging; not internationalized.</hide> public static void formatDuration(long time, long now, java.io.PrintWriter pw) { if (time == 0) { pw.print("--"); return; } formatDuration(time - now, pw, 0); }
public bool Run() { string code = editor.Document.TextContent; // check if we already have compiled this code before int hashCode = code.GetHashCode(); if (database != null && this.hashCode == hashCode) { return(false); } this.hashCode = hashCode; java.io.StringReader reader = new java.io.StringReader(code); try { java.io.StringWriter writer = new java.io.StringWriter(); try { java.io.PrintWriter log = new java.io.PrintWriter(writer); try { Database db; db = JPortal.run(name, reader, log); if (db != null) { database = db; } } finally { log.flush(); log.close(); } string result = writer.ToString(); char[] sep = { '\n' }; string[] lines = result.Split(sep); for (int i = 0; i < lines.Length; i++) { string line = lines[i].Trim(); if (line.Length == 0) { continue; } form.LogInfo = line; } } finally { writer.close(); } } finally { reader.close(); } return(database != null); }
private void RunCompile(Source source) { source.Clear(); java.io.StringWriter writer = new java.io.StringWriter(); try { java.io.PrintWriter log = new java.io.PrintWriter(writer); try { string currDir = Directory.GetCurrentDirectory(); try { FileInfo info = new FileInfo(source.FileName); LogVerbose = "Changing to " + info.DirectoryName; Directory.SetCurrentDirectory(info.DirectoryName); LogVerbose = "Compiling " + info.Name; bbd.jportal.Database database = JPortal.run(info.FullName, log); RunGenerators(database, log); } finally { Directory.SetCurrentDirectory(currDir); } } finally { log.flush(); log.close(); } string result = writer.ToString(); char[] sep = { '\n' }; string[] lines = result.Split(sep); for (int i = 0; i < lines.Length; i++) { string line = lines[i].Trim(); if (line.Length == 0) { continue; } if (line.IndexOf("Code: ") == 0) { source.Add(line.Substring(6).Trim()); } else if (line.IndexOf("DDL: ") == 0) { source.Add(line.Substring(5).Trim()); } LogInfo = line; } } finally { writer.close(); } }
public virtual void FixtureTearDown() { StopGFXDServer(m_defaultDriverType); com.pivotal.gemfirexd.@internal.shared.common.sanity.SanityManager .SET_DEBUG_STREAM(null); if (s_logFileWriter != null) { s_logFileWriter.close(); s_logFileWriter = null; } }
/// <summary>Print short representation to given writer.</summary> /// <remarks>Print short representation to given writer.</remarks> /// <hide></hide> public void printShortString(java.io.PrintWriter pw) { pw.print('['); pw.print(left); pw.print(','); pw.print(top); pw.print("]["); pw.print(right); pw.print(','); pw.print(bottom); pw.print(']'); }
public virtual void printStackTrace(java.io.PrintWriter arg0) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) { @__env.CallVoidMethod(this.JvmHandle, global::java.lang.Throwable._printStackTrace13407, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); } else { @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::java.lang.Throwable.staticClass, global::java.lang.Throwable._printStackTrace13407, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); } }
public virtual void list(java.io.PrintWriter arg0) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) { @__env.CallVoidMethod(this.JvmHandle, global::java.util.Properties._list15609, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); } else { @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::java.util.Properties.staticClass, global::java.util.Properties._list15609, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)); } }
protected virtual void dump(java.io.FileDescriptor arg0, java.io.PrintWriter arg1, java.lang.String[] arg2) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) { @__env.CallVoidMethod(this.JvmHandle, global::android.os.Binder._dump6148, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2)); } else { @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.os.Binder.staticClass, global::android.os.Binder._dump6148, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2)); } }
internal static void printStackTrace(Exception x, java.io.PrintWriter printWriter) { #if !FIRST_PASS lock (printWriter) { foreach (string line in BuildStackTrace(x)) { printWriter.println(line); } } #endif }
public virtual void dump(java.io.PrintWriter pw) { int N = mSlots.Length; pw.println("Icon list:"); { for (int i = 0; i < N; i++) { pw.printf(" %2d: (%s) %s\n", i, mSlots[i], mIcons[i]); } } }
public virtual void print(java.io.PrintWriter printWriter, int digits) { string format = string.format("%%5.%df ", digits); for (int i = 0; i < getRowCount(); i++) { for (int j = 0; j < getColCount(); j++) { printWriter.format(format, get(i, j)); } if (getRowCount() > 1) { printWriter.println(); } } }
internal static void InternalSetup(Type type) { string logFileName; if (s_testOutDir != null && s_testOutDir.Length > 0) { logFileName = s_testOutDir + '/' + type.FullName + ".txt"; } else { logFileName = type.FullName + ".txt"; } // use a java PrintWriter to also set the SanityManager output stream // to this file s_logFileWriter = new java.io.PrintWriter(logFileName); com.pivotal.gemfirexd.@internal.shared.common.sanity.SanityManager .SET_DEBUG_STREAM(s_logFileWriter); }
void sendFileUsingWriter(HttpServletResponse resp, string filename) { java.io.PrintWriter writer = resp.getWriter(); try { resp.setContentType(this.getServletContext().getMimeType(filename)); StreamReader fis = null; char[] buf = new char[4 * 1024]; // 4K buffer try { fis = new StreamReader(filename); int charsRead; while ((charsRead = fis.Read(buf, 0, buf.Length)) != -1 && charsRead != 0) { writer.write(buf, 0, charsRead); } } finally { if (fis != null) { fis.Close(); } } } catch (System.IO.FileNotFoundException e) { resp.setStatus(404, "Object Not Found."); HttpException myExp = new HttpException(404, "File '" + filename + "' not found."); writer.print(((HttpException)myExp).GetHtmlErrorMessage()); writer.flush(); } catch (Exception e) { Trace.WriteLine(String.Format("ERROR in Static File Reading {0},{1}", e.GetType(), e.Message)); resp.setStatus(500); HttpException myExp = new HttpException("Exception in Reading static file", e); writer.print(((HttpException)myExp).GetHtmlErrorMessage()); writer.flush(); } }
/// <summary>Handy function to get a loggable stack trace from a Throwable</summary> /// <param name="tr">An exception to log</param> public static string getStackTraceString(System.Exception tr) { if (tr == null) { return(string.Empty); } // This is to reduce the amount of log spew that apps do in the non-error // condition of the network being unavailable. System.Exception t = tr; while (t != null) { if (t is java.net.UnknownHostException) { return(string.Empty); } t = t.InnerException; } java.io.StringWriter sw = new java.io.StringWriter(); java.io.PrintWriter pw = new java.io.PrintWriter(sw); XobotOS.Runtime.Util.PrintStackTrace(tr, pw); return(sw.ToString()); }
/// <hide></hide> public virtual void dumpGfxInfo(java.io.FileDescriptor fd) { java.io.FileOutputStream fout = new java.io.FileOutputStream(fd); java.io.PrintWriter pw = new java.io.PrintWriter(fout); try { lock (this) { if (mViews != null) { pw.println("View hierarchy:"); int count = mViews.Length; int viewsCount = 0; int displayListsSize = 0; int[] info = new int[2]; { for (int i = 0; i < count; i++) { android.view.ViewRootImpl root = mRoots[i]; root.dumpGfxInfo(pw, info); string name = root.GetType().FullName + '@' + Sharpen.Util.IntToHexString(GetHashCode ()); pw.printf(" %s: %d views, %.2f kB (display lists)\n", name, info[0], info[1] / 1024.0f ); viewsCount += info[0]; displayListsSize += info[1]; } } pw.printf("\nTotal ViewRootImpl: %d\n", count); pw.printf("Total Views: %d\n", viewsCount); pw.printf("Total DisplayList: %.2f kB\n\n", displayListsSize / 1024.0f); } } } finally { pw.flush(); } }
private void RunGenerators(bbd.jportal.Database database, java.io.PrintWriter log) { object[] args = { database, typeof(string), log }; string name = source.ToString("S"); for (int i = 0; i < generatorList.Count; i++) { string generatorKey = string.Format("{0}.{1}Generator", name, generatorList.GetKey(i)); if (project.Switch.IndexOfKey(generatorKey) == -1) { continue; } bool required = bool.Parse((string)project.Switch[generatorKey]); if (required == false) { continue; } string directoryKey = string.Format("{0}.{1}Directory", source.ToString("S"), generatorList.GetKey(i)); if (project.Switch.IndexOfKey(generatorKey) != -1) { args[1] = project.Switch[directoryKey]; } MethodInfo method = generatorList.GetByIndex(i) as MethodInfo; if (method == null) { LogWarn = "No proper generator for " + name; continue; } try { method.Invoke(null, args); } catch { LogVerbose = "Generation failed for " + name; } } }
private bool RunJavac() { List <String> paramList = new List <String>(); temp = GetFullPath(Path.Combine("obj", platform, configuration)); paramList.Add("-d"); paramList.Add(temp); if (sources != null) { for (int i = 0; i < sources.Length; i++) { string sourceFile = GetFullPath(sources[i].ItemSpec); RemoveBOM(sourceFile); paramList.Add(sourceFile); } } String[] parameters = paramList.ToArray(); PrintWriter pw = new PrintWriter(new LogWriter(Log), true); int result = Javac.compile(parameters, pw); pw.close(); return(result == 0); }
private bool RunJavac() { List<string> paramList = new List<string>(); paramList.Add("-bootclasspath"); paramList.Add(Path.Combine(GetStubPath(), "rt.jar")); string stubpath = GetStubPath(); StringBuilder sb = new StringBuilder(); foreach (string file in Directory.GetFiles(stubpath, "*.jar")) { if (Path.GetFileName(file) != "rt.jar") { if (sb.Length != 0) { sb.Append(Path.PathSeparator); } sb.Append(file); } } if (sb.Length != 0) { paramList.Add("-classpath"); paramList.Add(sb.ToString()); } string classes = GetClassesPath(); Directory.CreateDirectory(classes); paramList.Add("-d"); paramList.Add(classes); if (emitDebugInformation) { paramList.Add("-g"); } if (sources != null) { for (int i = 0; i < sources.Length; i++) { string sourceFile = Path.GetFullPath(sources[i].ItemSpec); RemoveBOM(sourceFile); paramList.Add(sourceFile); } } using (PrintWriter pw = new PrintWriter(new LogWriter(Log), true)) { //StringBuilder sb = new StringBuilder(); //foreach (string str in paramList) //{ // sb.Append('"').Append(str).Append("\" "); //} //ProcessStartInfo psi = new ProcessStartInfo(Path.Combine(GetAssemblyPath(), "javac.exe"), sb.ToString()); //psi.UseShellExecute = false; //using (Process p = Process.Start(psi)) //{ // p.WaitForExit(); // if (p.ExitCode != 0) // { // return false; // } //} //return true; return Javac.compile(paramList.ToArray(), pw) == 0; } }
public static void PrintStackTrace(Exception e, java.io.PrintWriter pw) { pw.println(e.StackTrace); }
public virtual void dump(java.io.FileDescriptor fd, java.io.PrintWriter fout, string [] args) { throw new System.NotImplementedException(); }
// Generating method code for printScriptStackTrace public virtual void PrintScriptStackTrace(java.io.PrintWriter writer) { WObj.printScriptStackTrace(writer); }
public abstract void dump(string prefix, java.io.FileDescriptor fd, java.io.PrintWriter writer, string[] args);
/// <summary>Handy function to get a loggable stack trace from a Throwable</summary> /// <param name="tr">An exception to log</param> public static string getStackTraceString(System.Exception tr) { if (tr == null) { return string.Empty; } // This is to reduce the amount of log spew that apps do in the non-error // condition of the network being unavailable. System.Exception t = tr; while (t != null) { if (t is java.net.UnknownHostException) { return string.Empty; } t = t.InnerException; } java.io.StringWriter sw = new java.io.StringWriter(); java.io.PrintWriter pw = new java.io.PrintWriter(sw); XobotOS.Runtime.Util.PrintStackTrace(tr, pw); return sw.ToString(); }
public override void printStackTrace__java_io_PrintWriter(java.io.PrintWriter arg) { }
protected internal override void dump(java.io.FileDescriptor fd, java.io.PrintWriter fout, string[] args) { throw new System.NotImplementedException(); }
private bool RunJavac() { List<String> paramList = new List<String>(); temp = GetFullPath(Path.Combine("obj", platform, configuration)); paramList.Add("-d"); paramList.Add(temp); if (sources != null) { for (int i = 0; i < sources.Length; i++) { string sourceFile = GetFullPath(sources[i].ItemSpec); RemoveBOM(sourceFile); paramList.Add(sourceFile); } } String[] parameters = paramList.ToArray(); PrintWriter pw = new PrintWriter(new LogWriter(Log), true); int result = Javac.compile(parameters, pw); pw.close(); return result == 0; }
/// <exception cref="System.IO.IOException"></exception> private Console(java.io.InputStream @in, java.io.OutputStream @out) { // We don't care about stderr, because this class only uses stdin and stdout. this._reader = new java.io.Console.ConsoleReader(@in); this._writer = new java.io.Console.ConsoleWriter(@out); }
/// <hide>Just for debugging; not internationalized.</hide> public static void formatDuration(long duration, java.io.PrintWriter pw) { formatDuration(duration, pw, 0); }
private bool RunJavac() { List <string> paramList = new List <string>(); paramList.Add("-bootclasspath"); paramList.Add(Path.Combine(GetStubPath(), "rt.jar")); string stubpath = GetStubPath(); StringBuilder sb = new StringBuilder(); foreach (string file in Directory.GetFiles(stubpath, "*.jar")) { if (Path.GetFileName(file) != "rt.jar") { if (sb.Length != 0) { sb.Append(Path.PathSeparator); } sb.Append(file); } } if (sb.Length != 0) { paramList.Add("-classpath"); paramList.Add(sb.ToString()); } string classes = GetClassesPath(); Directory.CreateDirectory(classes); paramList.Add("-d"); paramList.Add(classes); if (emitDebugInformation) { paramList.Add("-g"); } if (sources != null) { for (int i = 0; i < sources.Length; i++) { string sourceFile = Path.GetFullPath(sources[i].ItemSpec); RemoveBOM(sourceFile); paramList.Add(sourceFile); } } using (PrintWriter pw = new PrintWriter(new LogWriter(Log), true)) { //StringBuilder sb = new StringBuilder(); //foreach (string str in paramList) //{ // sb.Append('"').Append(str).Append("\" "); //} //ProcessStartInfo psi = new ProcessStartInfo(Path.Combine(GetAssemblyPath(), "javac.exe"), sb.ToString()); //psi.UseShellExecute = false; //using (Process p = Process.Start(psi)) //{ // p.WaitForExit(); // if (p.ExitCode != 0) // { // return false; // } //} //return true; return(Javac.compile(paramList.ToArray(), pw) == 0); } }
public void dump(string prefix, java.io.FileDescriptor fd, java.io.PrintWriter writer , string[] args) { throw new System.NotImplementedException(); }
internal void handleDumpService(android.app.ActivityThread.DumpComponentInfo info ) { android.app.Service s = mServices.get(info.token); if (s != null) { java.io.PrintWriter pw = new java.io.PrintWriter(new java.io.FileOutputStream(info .fd.getFileDescriptor())); s.dump(info.fd.getFileDescriptor(), pw, info.args); pw.flush(); try { info.fd.close(); } catch (System.IO.IOException) { } } }
public virtual void printStackTrace(java.io.PrintWriter s) { }
internal void handleDumpActivity(android.app.ActivityThread.DumpComponentInfo info ) { android.app.ActivityThread.ActivityClientRecord r = mActivities.get(info.token); if (r != null && r.activity != null) { java.io.PrintWriter pw = new java.io.PrintWriter(new java.io.FileOutputStream(info .fd.getFileDescriptor())); r.activity.dump(info.prefix, info.fd.getFileDescriptor(), pw, info.args); pw.flush(); try { info.fd.close(); } catch (System.IO.IOException) { } } }