home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
SunExecutionContextParser.java
< prev
next >
Wrap
Text File
|
1998-09-27
|
2KB
|
85 lines
package com.symantec.itools.lang;
import java.io.BufferedReader;
import java.io.StringReader;
/**
* @author Symantec Internet Tools Division
* @version 1.0
* @since VCafe 3.0
*/
public class SunExecutionContextParser
extends ExecutionContextParser
{
protected SunExecutionContextParser()
{
}
/**
* @param stackTrace TODO
* @param level TODO
* @since VCafe 3.0
*/
public void parse(String stackTrace, int level)
{
BufferedReader reader;
reader = new BufferedReader(new StringReader(stackTrace));
// skip past
// at com.symantec.itools.lang.Debug.getStackTrace(Debug.java:xxx)
// at com.symantec.itools.lang.Debug.getExecutionContext(Debug.java:xxx)
level += 2;
try
{
String str;
int i;
int j;
// get rid of "Throwable"
if(reader.readLine() == null)
{
return;
}
// remove unwanted lines
// if the JIT is on we will return at this point
for(i = 0; i < level; i++)
{
if(reader.readLine() == null)
{
return;
}
}
// get rid of class the "at " & ")"
str = reader.readLine().trim();
str = str.substring(3, str.length() - 1);
// get the info - : tells us where the line number is
j = str.indexOf(':');
i = str.indexOf('(');
// is the JIT on?
if(j != -1)
{
// if it is on we can get the line number & the file
line = new Integer(str.substring(j + 1)).intValue();
file = str.substring(i + 1, j);
}
str = str.substring(0, i);
i = str.lastIndexOf('.');
method = str.substring(i + 1);
clazz = str.substring(0, i);
}
catch(Throwable ex)
{
}
}
}