* @param event
* @return
*/
public EMethodEntryEvent createMethodEntryEvent(BreakpointEvent event)
{
EMethodEntryEvent ret=new EMethodEntryEvent();
loadEventTimeData(ret);
loadStackTraceAndLocation(ret, event.thread());
lastLocations.put(ret.getStackFrame().getThread().getName(), ret.getStackFrame());
//cargar argumentos
ret.setArguments(new HashSet<EArgument>());
try {
EArgument arg = null;
for(ELocalVariable param : ret.getStackFrame().getMethod().getParameters())
{
arg = new EArgument();
arg.setMethodEntryEvent(ret);
arg.setParameter(param);
if(event.thread().frame(0).visibleVariableByName(param.getName())==null)
System.out.println("parametro no encontrado en " + event.location().method() + ":" + param.getName());
else
arg.setValue(getValue(event.thread().frame(0).getValue(event.thread().frame(0).visibleVariableByName(param.getName()))));
ret.getArguments().add(arg);
}
}
catch(Exception e)
{
System.out.println(ret.getStackFrame().getMethod().getName());
System.out.println(ret.getStackFrame().getMethod().getParameters());
throw new RuntimeException("No se pudieron obtener los argumentos durante el evento "
+ ret, e);
}
JPAManager.getJPAManager().getEntityManager().persist(ret);