Skip to content

Relative paths in pmd report result in missing code snippets #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adangel opened this issue Nov 24, 2022 · 1 comment · Fixed by #117
Closed

Relative paths in pmd report result in missing code snippets #116

adangel opened this issue Nov 24, 2022 · 1 comment · Fixed by #117
Assignees
Labels
bug Something isn't working
Milestone

Comments

@adangel
Copy link
Member

adangel commented Nov 24, 2022

PMD6 reports absolute paths, PMD7 seems to report only relative paths (relative to the current working directory).

  • pmd6: /home/runner/work/pmd/target/repositories/openjdk-11/src/java.base/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java
  • pmd7: target/repositories/openjdk-11/src/java.base/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java

The regression tester should be able to deal with both situations. It will relativize the paths on its own (relative to the project root, that is /home/runner/work/pmd/target/repositories/openjdk-11).

The problem is, that we generate wrong links to the source code, e.g. https://github.com/openjdk/jdk/tree/jdk-11+28/target/repositories/openjdk-11/src/java.base/share/classes/java/util/AbstractMap.java#L609 instead of https://github.com/openjdk/jdk/tree/jdk-11+28/src/java.base/share/classes/java/util/AbstractMap.java#L609

@adangel adangel added the bug Something isn't working label Nov 24, 2022
@adangel adangel added this to the next milestone Nov 24, 2022
@adangel adangel self-assigned this Nov 24, 2022
@adangel adangel changed the title Relative paths in pmd-report.xml result in missing code snippets Relative paths in pmd report result in missing code snippets Nov 24, 2022
@adangel
Copy link
Member Author

adangel commented Nov 24, 2022

Another example: comparison between master and pmd/7.0.x is also broken: https://chunk.io/pmd/239601d3404a4537945d24b60b36b275/diff2/Schedul-o-matic-9000/index.html#section-violations

grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant