{"action":"created","issue":{"url":"https://api.github.com/repos/sdaschner/jaxrs-analyzer/issues/32","labels_url":"https://api.github.com/repos/sdaschner/jaxrs-analyzer/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/sdaschner/jaxrs-analyzer/issues/32/comments","events_url":"https://api.github.com/repos/sdaschner/jaxrs-analyzer/issues/32/events","html_url":"https://github.com/sdaschner/jaxrs-analyzer/issues/32","id":109557732,"number":32,"title":"Maven log shows the following error: \"Could not analyze the method: javassist.CtMethod.\"","user":{"login":"jeff9finger","id":12804917,"avatar_url":"https://avatars.githubusercontent.com/u/12804917?v=3","gravatar_id":"","url":"https://api.github.com/users/jeff9finger","html_url":"https://github.com/jeff9finger","followers_url":"https://api.github.com/users/jeff9finger/followers","following_url":"https://api.github.com/users/jeff9finger/following{/other_user}","gists_url":"https://api.github.com/users/jeff9finger/gists{/gist_id}","starred_url":"https://api.github.com/users/jeff9finger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeff9finger/subscriptions","organizations_url":"https://api.github.com/users/jeff9finger/orgs","repos_url":"https://api.github.com/users/jeff9finger/repos","events_url":"https://api.github.com/users/jeff9finger/events{/privacy}","received_events_url":"https://api.github.com/users/jeff9finger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-10-02T19:35:01Z","updated_at":"2015-12-10T08:48:59Z","closed_at":null,"body":"Testing fix for #30 (which now does not fail the build), but the file generated is not correct and the maven log file shows the above error (among others).\r\n\r\nHere is the maven configuration.\r\n\r\n[DEBUG] -----------------------------------------------------------------------\r\n[DEBUG] Goal:          com.sebastian-daschner:jaxrs-analyzer-maven-plugin:0.9-SNAPSHOT:analyze-jaxrs ()\r\n[DEBUG] Style:         Regular\r\n[DEBUG] Configuration: <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<configuration>\r\n  <backend default-value=\"plaintext\">${jaxrs-analyzer.backend}</backend>\r\n  <buildDirectory>${project.build.directory}</buildDirectory>\r\n  <deployedDomain default-value=\"example.com\">${jaxrs-analyzer.deployedDomain}</deployedDomain>\r\n  <outputDirectory>${project.build.outputDirectory}</outputDirectory>\r\n  <project>${project}</project>\r\n  <remoteRepos>${project.remotePluginRepositories}</remoteRepos>\r\n  <repoSession>${repositorySystemSession}</repoSession>\r\n</configuration>\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sdaschner/jaxrs-analyzer/issues/comments/163535739","html_url":"https://github.com/sdaschner/jaxrs-analyzer/issues/32#issuecomment-163535739","issue_url":"https://api.github.com/repos/sdaschner/jaxrs-analyzer/issues/32","id":163535739,"user":{"login":"sdaschner","id":6815170,"avatar_url":"https://avatars.githubusercontent.com/u/6815170?v=3","gravatar_id":"","url":"https://api.github.com/users/sdaschner","html_url":"https://github.com/sdaschner","followers_url":"https://api.github.com/users/sdaschner/followers","following_url":"https://api.github.com/users/sdaschner/following{/other_user}","gists_url":"https://api.github.com/users/sdaschner/gists{/gist_id}","starred_url":"https://api.github.com/users/sdaschner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdaschner/subscriptions","organizations_url":"https://api.github.com/users/sdaschner/orgs","repos_url":"https://api.github.com/users/sdaschner/repos","events_url":"https://api.github.com/users/sdaschner/events{/privacy}","received_events_url":"https://api.github.com/users/sdaschner/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T08:48:59Z","updated_at":"2015-12-10T08:48:59Z","body":"And a short description of the analysis, although I'm sure you already got it anyway :-)\r\n\r\nThe main purpose of the Bytecode analysis is to check where the state of a method's return value \"come from\". This includes the object itself and all methods called on it plus the actual arguments of these and so on, all done recursively. The main target was to automatically \"understand\" code like `return Response.status(Response.Status.ACCEPTED).header(...` in the method bodies.\r\n\r\nAs I want to save runtime of the analysis, I'm only interested in statements which are actually \"relevant\" for the returned value. Example:\r\n```\r\npublic Response something() {\r\n    int status = 200; // relevant\r\n    System.out.println(\"Hello World\"); // not relevant\r\n    doSomethingImportant(); // not relevant\r\n    return Response.status(status).build(); // relevant\r\n}\r\n```\r\n\r\nIn order to get the relevant statements, I'm starting from the return statements (`ARETURN` opcodes in this case). As one \"Java statement\" (i.e. in mostly all cases one line until `;`) can include method calls and `LOAD` instructions of variables, I need to track them recursively and mark them as relevant (and subsequent \"relevants\" as well).\r\n\r\nNow the interesting part for the error is how the \"Java statement\" lines are recognized in the plain sequence of Bytecode instructions: The point is, that before and after every \"statement\" the runtime stack of the JVM would be empty. For `System.out.println(\"Hello World\");` this would add `java/lang/System.out`'s `PrintStream`, add `\"Hello World\"` and finally invoking `PrintStream#println` which pops the print stream and the string from the stack again -> `println` is `void`, no returned value and empty stack again. This is true for more complex statements as well.\r\n\r\nIn order to do this the `StackSizeSimulator` simulates the number of stack elements before and after every opcode. This list is used later to have the beginning and end of every \"Java statement\" needed for reducing the relevant instructions.\r\n\r\nThe error now occurs at this point where the `StackSizeSimulator` wants to simulate the stack sizes of the original set of instructions -- nothing reduced yet, but including the pseudo `ExceptionHandlerInstruction`, because they are needed for obvious reasons. The simulator sees a `POP` instruction where the stack size is already `0`... And this is the big question why the set of instruction is not consistent at this point -- maybe because some `ExceptionHandlerInstruction` is missing (which would have added one element). \r\n\r\nSo what really would help me is to have the original set of instructions plus (even more important) the original Java code of the method (which is collected into the set of instructions). Somewhere in between this lays the error. Feel free to mail me some code or dummy examples as it probably contains sensitive information, but the method code has to be complete and result in an error -- the examples with the `...` unfortunately don't lead to an error...\r\n\r\nHope this helps :-)"}}