Title: JavaAnalysis.get_test_methods() gives incorrect name when comment placed between @Test annotation and non-public test method · Issue #147 · codellm-devkit/python-sdk · GitHub
Open Graph Title: JavaAnalysis.get_test_methods() gives incorrect name when comment placed between @Test annotation and non-public test method · Issue #147 · codellm-devkit/python-sdk
X Title: JavaAnalysis.get_test_methods() gives incorrect name when comment placed between @Test annotation and non-public test method · Issue #147 · codellm-devkit/python-sdk
Description: Describe the bug The get_test_methods() method of the JavaAnalysis analyzer in the Python SDK gives an incorrect test method name of void when a comment is placed between the JUnit @Test annotation and a test method that is not marked pu...
Open Graph Description: Describe the bug The get_test_methods() method of the JavaAnalysis analyzer in the Python SDK gives an incorrect test method name of void when a comment is placed between the JUnit @Test annotation...
X Description: Describe the bug The get_test_methods() method of the JavaAnalysis analyzer in the Python SDK gives an incorrect test method name of void when a comment is placed between the JUnit @Test annotation...
Opengraph URL: https://github.com/codellm-devkit/python-sdk/issues/147
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JavaAnalysis.get_test_methods() gives incorrect name when comment placed between @Test annotation and non-public test method","articleBody":"**Describe the bug**\nThe `get_test_methods()` method of the `JavaAnalysis` analyzer in the Python SDK gives an incorrect test method name of `void` when a comment is placed between the JUnit `@Test` annotation and a test method that is not marked `public`.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Run the below code:\n```py\nfrom cldk import CLDK\nsrc = \"\"\"class ExampleTest {\n @Test\n // this valid comment breaks test method name detection; try removing it\n void exampleTest() { }\n}\n\"\"\"\nja = CLDK(language=\"java\").analysis(source_code=src)\ntests = ja.get_test_methods()\nprint(tests)\n```\n\n**Expected behavior**\nThe output should be a dictionary along the lines of `{'exampleTest': '...'}`\nInstead, the following is output: `{'void': '...'}`\n\n**Additional context**\nDoing either of the following allows the analyzer to properly detect the name:\n1. Adding a `public` qualifier (e.g. edit line 5 to be `public void exampleTest() { }`\n2. Removing the comment (e.g. remove line 4)\n\nThis pattern can be seen in production code; for example, in [this snippet](https://github.com/apache/commons-lang/blob/facd363b6eac2ee1c37c3de88fa6ac8746811c16/src/test/java/org/apache/commons/lang3/StringUtilsEqualsIndexOfTest.java#L584-L586) from the Apache commons-lang project.","author":{"url":"https://github.com/NateLevin1","@type":"Person","name":"NateLevin1"},"datePublished":"2025-12-11T17:58:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/147/python-sdk/issues/147"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6feae5f7-90f5-8baf-3770-f9b0a736a651 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BFA0:5C746:38F908:50A493:698DE58A |
| html-safe-nonce | b06402e5d280c3838eaddf7cc24626a7278c1a46b8ee9a9de3d644753db37850 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkEwOjVDNzQ2OjM4RjkwODo1MEE0OTM6Njk4REU1OEEiLCJ2aXNpdG9yX2lkIjoiMjAxNTcyNDY3NzYzNzAxMTMwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1d54683bee7f3376dbe9cb7576e385206dd9ca633c12f4cefe89c8cfda373d98 |
| hovercard-subject-tag | issue:3720409854 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/codellm-devkit/python-sdk/147/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3d008109fe5443a0e45340ae4a1b197ff00df2708a3cc5cfeb25e3f8b0b148d7/codellm-devkit/python-sdk/issues/147 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3d008109fe5443a0e45340ae4a1b197ff00df2708a3cc5cfeb25e3f8b0b148d7/codellm-devkit/python-sdk/issues/147 |
| og:image:alt | Describe the bug The get_test_methods() method of the JavaAnalysis analyzer in the Python SDK gives an incorrect test method name of void when a comment is placed between the JUnit @Test annotation... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NateLevin1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 929d0ce8b653d60df0698366d7e9012f9423ea1bace40816e16e5b007242aae4 |
| turbo-cache-control | no-preview |
| go-import | github.com/codellm-devkit/python-sdk git https://github.com/codellm-devkit/python-sdk.git |
| octolytics-dimension-user_id | 197800760 |
| octolytics-dimension-user_login | codellm-devkit |
| octolytics-dimension-repository_id | 826048982 |
| octolytics-dimension-repository_nwo | codellm-devkit/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 826048982 |
| octolytics-dimension-repository_network_root_nwo | codellm-devkit/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5048f761cd42a133ec9ccbf7ca847affc26d4937 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width