00001 package gov.nasa.arc.ase.jpf.jvm; 00002 00003 import gov.nasa.arc.ase.jpf.*; 00004 import gov.nasa.arc.ase.util.Debug; 00005 import java.io.*; 00006 00007 class ErrorTrail implements ErrorTrailInterface, Serializable { 00008 private String[] lines; 00009 private int current = 0; 00010 00011 ErrorTrail(int size) { 00012 lines = new String[size]; 00013 } 00014 void add(String line) { 00015 if(current < lines.length) 00016 lines[current++] = line; 00017 } 00018 public void print() { 00019 for(int idx = 0; idx < lines.length; idx++) 00020 Debug.println(Debug.ERROR, lines[idx]); 00021 } 00022 public void print(PrintStream out) { 00023 for(int idx = 0; idx < lines.length; idx++) 00024 out.println(lines[idx]); 00025 } 00026 }