Title: Address Issue 118: Support Record Declarations by rahlk · Pull Request #121 · codellm-devkit/codeanalyzer-java · GitHub
Open Graph Title: Address Issue 118: Support Record Declarations by rahlk · Pull Request #121 · codellm-devkit/codeanalyzer-java
X Title: Address Issue 118: Support Record Declarations by rahlk · Pull Request #121 · codellm-devkit/codeanalyzer-java
Description: Summary
Added support for parsing and analyzing record declarations in codeanalyzer-java. This includes integration with the symbol table and call graph analysis, ensuring record components and implicit methods are correctly handled.
Motivation and Context
Previously, codeanalyzer-java did not correctly process Java record declarations, leading to:
Incomplete symbol tables (records were missing).
Call graphs that failed to include methods defined inside records.
Inability to track record components properly.
This update ensures:
record declarations are parsed correctly.
Record components are included in the symbol table.
Methods inside records appear in the call graph.
Implicit methods (equals(), hashCode(), toString()) are accounted for.
A new RecordComponent entity is introduced to represent individual components of a record.
How Has This Been Tested?
Implemented two new test cases:
symbolTableShouldHaveRecords(): Verifies that records are correctly stored in the symbol table.
symbolTableShouldHaveDefaultRecordComponents(): Ensures default record components are recognized and stored.
Added a test application:
Path: src/test/resources/test-applications/record-class-test
Contains sample records to validate parsing and analysis.
Tests pass successfully, confirming that records are now processed correctly.
Breaking Changes
Yes, this is a breaking change:
The analysis.json format has been updated:
A new field record_components is now included in Type entity.
This is captured as a new entity RecordComponent that has been introduced:
package com.ibm.cldk.entities;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class RecordComponent {
private String comment;
private String name;
private String type;
private List
Open Graph Description: Summary Added support for parsing and analyzing record declarations in codeanalyzer-java. This includes integration with the symbol table and call graph analysis, ensuring record components and imp...
X Description: Summary Added support for parsing and analyzing record declarations in codeanalyzer-java. This includes integration with the symbol table and call graph analysis, ensuring record components and imp...
Opengraph URL: https://github.com/codellm-devkit/codeanalyzer-java/pull/121
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f6ad1090-ab7a-c5e0-a3f5-9cdc76f1ef84 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9DCA:101E3:7D029:AA64B:698F1B1F |
| html-safe-nonce | 5b64b9ddad02aca1be62614bf585f51f9fadcea57cd67ddf5766818dc326ac24 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RENBOjEwMUUzOjdEMDI5OkFBNjRCOjY5OEYxQjFGIiwidmlzaXRvcl9pZCI6IjMwNzc3OTE2OTUxNDE1NDI2ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9cf73927fe5c458f4ca2890c5849ab785129e8c3026d1a9fd9240945caedafcd |
| hovercard-subject-tag | pull_request:2343063564 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/codellm-devkit/codeanalyzer-java/pull/121/files |
| twitter:image | https://avatars.githubusercontent.com/u/1433964?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1433964?s=400&v=4 |
| og:image:alt | Summary Added support for parsing and analyzing record declarations in codeanalyzer-java. This includes integration with the symbol table and call graph analysis, ensuring record components and imp... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2da1a0d1318592c9965539b12269c4641177dfabfc86c3807992efb13e1d96ff |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/codellm-devkit/codeanalyzer-java git https://github.com/codellm-devkit/codeanalyzer-java.git |
| octolytics-dimension-user_id | 197800760 |
| octolytics-dimension-user_login | codellm-devkit |
| octolytics-dimension-repository_id | 731300153 |
| octolytics-dimension-repository_nwo | codellm-devkit/codeanalyzer-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 731300153 |
| octolytics-dimension-repository_network_root_nwo | codellm-devkit/codeanalyzer-java |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c9646ffd6f86b00952c2b39e3c62e15904eff1e5 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width