Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Commit

Permalink
Add getNumberOfFrames method for EvoCrash LogParser.
Browse files Browse the repository at this point in the history
  • Loading branch information
pderakhshanfar committed Jun 14, 2018
1 parent 800239b commit 9d35a2d
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions client/src/main/java/org/evosuite/coverage/evocrash/LogParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,26 @@ public static String getTargetClass(String logPath, int lineNumber){

return targetClass;
}



public static int getNumberOfFrames(String logPath){
int counter = -1;
try {
// Opening the log file
File file = new File(logPath);
BufferedReader br = new BufferedReader(new FileReader(file));
// Skipping the first line in the crash stack trace
while(br.readLine() != null)
counter++;
br.close();
return counter;
//going to parse the stack frames
} catch (Exception e){
LoggingUtils.getEvoLogger().error("* LogParser: Failed to parse the log file to get the target class!");
}finally {
return counter;
}
}

//*******************************************************************************
// This block prepares the stack trace to be used by the fitness function

Expand Down

0 comments on commit 9d35a2d

Please sign in to comment.