All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.snapscript.studio.agent.debug.ThreadStackGenerator Maven / Gradle / Ivy

There is a newer version: 1.4.6
Show newest version
package org.snapscript.studio.agent.debug;

import org.snapscript.core.stack.ThreadStack;

public class ThreadStackGenerator {

   private final ThreadStack stack;
   
   public ThreadStackGenerator(ThreadStack stack) {
      this.stack = stack;
   }
   
   public String generate() {
      StackTraceElement[] elements = stack.build();
      
      if(elements.length > 0) {
         StringBuilder builder = new StringBuilder();
         
         for(StackTraceElement element : elements){
            builder.append(element);
            builder.append("\n");
         }
         return builder.toString();
      }
      return "";
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy