Skip to content

Commit

Permalink
fix: Allow classes compiled without locals to be hooked
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinbyrne committed Mar 19, 2021
1 parent 4241c08 commit 0e0a0d3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main/java/com/appland/appmap/output/v1/Parameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ public Parameters(CtBehavior behavior) {
LocalVariableAttribute locals = (LocalVariableAttribute) codeAttribute.getAttribute(
javassist.bytecode.LocalVariableAttribute.tag);

// We should be able to handle methods without debug
// information. However, as of 20200822, other errors come up if
// do hook them, so bail out here.
if (locals == null) {
throw new NoSourceAvailableException("No local variables for " + fqn);
}

CtClass[] paramTypes = null;
try {
Expand All @@ -71,7 +65,7 @@ public Parameters(CtBehavior behavior) {

String[] paramNames = null;
int numParams = paramTypes.length;
if (numParams > 0) {
if (locals != null && numParams > 0) {
int numLocals = locals.tableLength();

// This is handy when debugging this code, but produces too much
Expand Down

0 comments on commit 0e0a0d3

Please sign in to comment.