Skip to content

Constructor declaration gets mangled with comment in resulting symbol_table #90

Closed
@amiigas

Description

Describe the bug

After generating analysis.json for daytrader8 project, the resulting symbol_table contains a constructor declaration code that is mangled with a single line comment that is placed at the end of line in the source code.

Steps To Reproduce

  1. Get a copy of daytrader8 project
  2. Run the following command to generate analysis.json:
java -jar ./codeanalyzer-1.0.8.jar -i <PATH/TO/sample.daytrader8> -o <OUTPUT_DIR>
  1. Search for a constructor of MarketSummaryDataBean in callable_declarations and observe:
"<init>(BigDecimal, BigDecimal, double, Collection, Collection)": {
  "declaration": "public // , Collection topVolume\nMarketSummaryDataBean(BigDecimal TSIA, BigDecimal openTSIA, double volume, Collection<QuoteDataBean> topGainers, Collection<QuoteDataBean> topLosers)",

Observed behavior

The comment is placed inside the code despite not being there in the source code. Source:

public MarketSummaryDataBean(BigDecimal TSIA, BigDecimal openTSIA, double volume, Collection<QuoteDataBean> topGainers, Collection<QuoteDataBean> topLosers// , Collection topVolume

Expected behavior

The resulting analysis.json contains the constructor declaration without the comment or comment in the right place (the same as in source).

Screenshots

None

Environment (please complete the following information):

  • OS: macOS 15.1.1
  • Version of Java: IBM Semeru Runtime Open Edition 21.0.3.0
  • Version of Maven: Apache Maven 3.9.8
  • Version of Gradle: Not installed

Additional context

None

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions