microsoft / microsoft/vscode-java-debug
Debugger opens *.class file despite there being an overridden *.java file in the project's src folder
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 591
- Forks
- 429
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 19
Descripción
When debugging a project where I have put copies of Java files from a dependency in my project's src folder (but in another module) to adjust its behavior, and placing break points in these overwritten Java files, the debugger always opens the *.class file of the dependency, which does not contain my changes.
Example project which works: https://github.com/marecabo/java-debug-demo/tree/works
Example project where this issue occurs: https://github.com/marecabo/java-debug-demo/tree/does-not-work
Environment
- Operating System:
RHEL 8.9 - JDK version:
openjdk 21.0.2 2024-01-16 LTS - Visual Studio Code version:
1.88.1 - Java extension version:
v1.29.0 - Java Debugger extension version:
v0.57.0
Steps To Reproduce
- Checkout example project:
git clone -b does-not-work https://github.com/marecabo/java-debug-demo.git - Place a breakpoint in
other/src/main/java/tech/tablesaw/table/Relation.java:261.
This file overrides a file from a dependency and changes its behavior, see https://github.com/marecabo/java-debug-demo/commit/40bb99b2a213d8f93fe56e77a961562c2be7ac8f
- Debug
run/src/main/java/com/project/my/run/Main.java
Current Result
Relation.class is opened which obviously does not show the changes I made in Relation.java. The execution marker (yellow highligted line) is - however - at the line number of the original breakpoint in other/src/main/java/tech/tablesaw/table/Relation.java:261, even if that line in Relation.class only contains } or is even empty.
Expected Result
other/src/main/java/tech/tablesaw/table/Relation.java is opened with my changes.
Additional Informations
So far I found out, that this issue only occurs, when the overridden Java file is not located in the same maven module, where the main class which is debugged resides. As a workaround, moving the overridden Relation.java file to the run module is enough to make it work as expected.
Thanks for your work at this extension.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Clone el repositorio java-debug-demo vinculado en la rama does-not-work y reproduzca el breakpoint en other/src/main/java/tech/tablesaw/table/Relation.java mientras depura run/src/main/java/com/project/my/run/Main.java. Compare esto con la rama works e inspeccione el archivo adjunto language-support-for-java.log. Se considera terminado cuando el depurador abre Relation.java del otro módulo con los cambios del usuario en lugar de la Relation.class de la dependencia.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java, typescript
- Área
- devtools
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100