devlauer / plantuml-generator

utility and maven plugin project for generating plantuml class diagrams and sequence diagrams out of java classes
https://devlauer.github.io/plantuml-generator/plantuml-generator/latest/index.html
Apache License 2.0
87 stars 27 forks source link

Parameter names are missing #154

Closed SirNoName2705 closed 8 months ago

SirNoName2705 commented 8 months ago

Description

We are currently facing an issue with the Maven plugin used in our project. Specifically, the class diagrams generated do not retain the original names of the method parameters. This is causing a lack of clarity and making the diagrams less useful for our documentation and analysis purposes.

Expected Behavior

When generating class diagrams, the method parameters should retain their original names as defined in the source code. This ensures that the diagrams accurately reflect the codebase and are more understandable for developers and stakeholders.

Actual Behavior

The generated class diagrams are missing the original parameter names of methods. Instead, they appear to be either replaced with generic or placeholder names. eg: paramUser1

Possible Solution

Is there a specific setting or configuration within the Maven plugin that can be adjusted to ensure that parameter names are correctly included in the class diagrams? Any guidance or recommendations would be appreciated.

Additional Information

Thank you for looking into this issue. Any assistance in resolving it would be greatly appreciated.

devlauer commented 8 months ago

Thanks for the hint! The project uses reflection on the compiled classes to determine the details for the PlantUML generation. Since the project originally used Java 7 as its base, it was not possible to get this information via reflection. When the project moved on to Java 8, from which the information is potentially available, this point was not changed. As a result, a synthetic name is used in all versions <=2.4.0 even if the parameter names are available. I have now fixed this in version 2.4.1. If the parameter information is made available via the compiler, the original parameter names from the source code are used. If these are not available, synthetic names are still used as before. I have briefly described how to enable the availability of parameter names via the compiler in Maven in the documentation here (at the end of the page): (https://devlauer.github.io/plantuml-generator/plantuml-generator-maven-plugin/latest/class-diagram.html)

The version 2.4.1 is released and should be available through maven central in the next hours. Therefore I am closing this issue. If there is still a problem or a question, please open it again.