redhat-developer / redhat-developer/vscode-java
Visual Studio Code's Java Compiler Not Showing Certain Errors
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.3k
- Forks
- 546
- Merge medio
- 20 h 1 min
- PR fusionados (30 d)
- 11
Descripción
Description of the Issue
When running Java code I have noticed that certain compile time errors will not be displayed.
Environment
- Operating System: Windows x64 10
- JDK version: 11.0.4.11
- Visual Studio Code version: 1.41.1
- Java extension version: 0.8.1
- Java Debugger extension version: 0.23.0
Steps To Reproduce
-
Declare the HashMap like,
HashMap<dataTypeA, dataTypeB> name = new HashMap<dataTypeC, dataTypeD>();
Where dataType A - D could be any data type I want it to be. -
The bug only occurs when dataTypeC is different from dataTypeA and or dataTypeD is different from dataTypeB.
Current Result
The compiler displays,
`Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at Test.main(Test.java:10)`
Expected Result
The compiler should display,
Unresolved compilation problems:
Type mismatch: cannot convert from HashMap<dataTypeA,dataTypeB> to HashMap<dataTypeC,dataTypeD>
The method put(dataTypeA,dataTypeB) in the type HashMap<dataTypeC,dataTypeD> is not applicable for the arguments (dataTypeA,dataTypeB)
Additional Informations
If I want to see the error message then I have to read the class file in order to determine what the error is and what line it is on. The bug will only occur if the data structure is declared as a class member. I have been able to reproduce this bug with other data structures such as ArrayList, 1D list, and 2D list.
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
Comienza reproduciendo la incompatibilidad de tipos genéricos de HashMap en Visual Studio Code con una declaración de miembro de clase, utilizando las versiones indicadas de Java y de la extensión. Compara la salida mostrada del compilador con los diagnósticos esperados de incompatibilidad de tipos y de argumentos de método; se considera completado cuando se muestran esos errores y sus ubicaciones en el código fuente, incluidos los otros casos de colecciones indicados.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java, vscode
- Área
- developer-experience, tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100