Methods Summary |
---|
public static void | addToGlobalIgnore(java.lang.Object o)
// check for dupes...
for(Enumeration e = globalIgnoreVec.elements(); e.hasMoreElements(); )
if(o == e.nextElement())
return;
globalIgnoreVec.addElement(o);
|
public java.lang.String | getClassName()
Assertion.check(className);
return className;
|
public java.lang.String | getFileName()
Assertion.check(fileName != null);
return fileName;
|
public int | getLineNumber()
return lineNumber;
|
public java.lang.String | getMethodName()
Assertion.check(methodName);
return methodName;
|
private boolean | ignoreVec(java.lang.String s)
Assertion.check(ignoreVec);
final int size = ignoreVec.size();
Assertion.check(size > 0);
for(int i = 0; i < size; i++)
if(s.indexOf((String)(ignoreVec.elementAt(i))) >= 0)
return true;
return false;
|
private java.lang.String | parseAndRemoveLineInfo(java.lang.String s)
// lineInfo --> debug build: "(ReporterTester.java:26)"
// release build: "(Unknown Source)"
// I think this is a possibility: (foo.java) or (foo.java:) -- but can't reproduce...
fileName = "";//NOI18N
lineNumber = -1;
int left = s.indexOf('(");
int right = s.indexOf(')");
if(left < 0 || right < 0 || right <= left)
throw new CallerInfoException(badFormat + " -- no parenthesis in line:" + s);//NOI18N
String lineInfo = s.substring(left + 1, right);
s = s.substring(0, left);
if(lineInfo.length() <= 0)
return s; //()
if(lineInfo.equals("Unknown Source"))//NOI18N
return s;
int colon = lineInfo.indexOf(':");
if(colon < 0)
{
// (foo.java)
fileName = lineInfo;
return s;
}
if(colon == lineInfo.length() - 1)
{
// (foo.java:)
fileName = lineInfo.substring(0, colon);
return s;
}
// (foo.java:125)
fileName = lineInfo.substring(0, colon);
try
{
lineNumber = Integer.parseInt(lineInfo.substring(colon + 1));
}
catch(NumberFormatException e)
{
// it's already set to -1
}
return s;
|
void | parseCallerInfo(java.lang.String stackDumpLine)
/* format of line:
// "at netscape.blizzard.util.ReporterTester.goo(ReporterTester.java:26)"
// "at netscape.blizzard.util.ReporterTester.goo(ReporterTester.java:)"
// "at netscape.blizzard.util.ReporterTester.goo(ReporterTester.java)"
// "at netscape.blizzard.util.ReporterTester.goo(Unknown Source)"*/
if(!stackDumpLine.startsWith("at "))//NOI18N
throw new CallerInfoException(badFormat + " -- no \"at \" at start of line (" + stackDumpLine +")");//NOI18N
stackDumpLine = stackDumpLine.substring(3);
String classInfo = parseAndRemoveLineInfo(stackDumpLine);
parseClassInfo(classInfo);
|
private void | parseClassInfo(java.lang.String s)
// format: netscape.blizzard.foo.goo.aMethod
if(s.indexOf('.") < 0)
throw new CallerInfoException(badFormat + " -- no \".\" in the fully-qualified method name");//NOI18N
if(s.indexOf('.") == 0)
throw new CallerInfoException(badFormat + " fully-qualified method name starts with a dot");//NOI18N
int index = s.lastIndexOf('.");
className = s.substring(0, index);
methodName = s.substring(index + 1);
|
public java.lang.String | toString()
Assertion.check(className);
Assertion.check(methodName);
Assertion.check(fileName != null);
StringBuffer sb = new StringBuffer();
sb.append(className);
sb.append(".");//NOI18N
sb.append(methodName);
if(fileName.length() > 0)
sb.append("(" + fileName + ":" + lineNumber + ")");//NOI18N
else
sb.append("(Unknown Source");//NOI18N
return sb.toString();
|
public java.lang.String | toStringDebug()
Assertion.check(className);
Assertion.check(methodName);
Assertion.check(fileName != null);
StringBuffer sb = new StringBuffer(getClass().getName());
sb.append(" dump:");//NOI18N
sb.append("\nClass Name: ");//NOI18N
sb.append(className);
sb.append("\nMethod Name: ");//NOI18N
sb.append(methodName);
sb.append("\nFile Name: ");//NOI18N
if(fileName.length() > 0)
{
sb.append(fileName);
sb.append("\nLine Number: ");//NOI18N
sb.append(lineNumber);
}
else
sb.append("unknown");//NOI18N
return sb.toString();
|