[Soot-list] Bug in exception handling?

Marc-André Laverdière marc-andre.laverdiere-papineau at polymtl.ca
Mon Mar 10 13:14:35 EDT 2014


Hello Sooters,

I got a weird exception loading the bytecode from a method body (it is
precompiled and from a FLOSS project I am not too familiar with)

java.lang.RuntimeException: Exception reference used other than as the
first statement of an exception handler.
	at
soot.jimple.toolkits.typing.fast.AugEvalFunction.eval_(AugEvalFunction.java:160)
	at ...
soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:117)
	at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:87)

The corresponding code snippet:
String newId = null;
try {
    String latestId = new DocumentRevisionDAO(new
Locale(user.getLanguage()), em).findLatestDocMId(pWorkspaceId,
template.getDocumentType());
    String inputMask = template.getMask();
    String convertedMask = Tools.convertMask(inputMask);
    newId = Tools.increaseId(latestId, convertedMask);
} catch (ParseException | NoResultException ex) {
    //may happen when a different mask has been used for the same
document type
    //or
    //may happen when no document of the specified type has been created
}

This form is new in Java 7.
http://docs.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html

This looks like a bug to me, but I'm not familiar with that piece of
code. Would anybody confirm?

Regards,

-- 
Marc-André Laverdière-Papineau
Doctorant - PhD Candidate


More information about the Soot-list mailing list