SONARJAVA-5698 Report Eclipse parser type errors#5261
Conversation
| JAVA_IS_AUTOSCAN("java.is_autoscan"), | ||
| JAVA_ANALYSIS_MAIN_SUCCESS_SIZE_CHARS("java.analysis.main.success.size_chars"), | ||
| JAVA_ANALYSIS_MAIN_SUCCESS_TIME_MS("java.analysis.main.success.time_ms"), | ||
| JAVA_ANALYSIS_MAIN_SUCCESS_TYPE_ERROR_COUNT("java.analysis.main.success.type_error_count"), |
There was a problem hiding this comment.
Lets change TelemetryKeyTest so that it makes sure all java.analysis keys are tested. This would involve extracting the lists in testCompoundKeys and validating and the product of their lengths is equal to the number of java.analysis keys.
| } | ||
|
|
||
| public record JavaAnalysisKeys(SpeedKeys success, SpeedKeys parseErrors, SpeedKeys exceptions) { | ||
| public record SizeAndTimeKeys(TelemetryKey sizeCharsKey, TelemetryKey timeMsKey) implements SpeedKeys { |
There was a problem hiding this comment.
I prefer {} on the same line here and below.
| public record SizeAndTimeKeys(TelemetryKey sizeCharsKey, TelemetryKey timeMsKey) implements SpeedKeys { | ||
| } | ||
|
|
||
| public record SizeTimeAndTypeErrorKeys(TelemetryKey sizeCharsKey, TelemetryKey timeMsKey, TelemetryKey typeErrorCountKey) implements SpeedKeys { |
There was a problem hiding this comment.
Please fix spacing before implements
| new SpeedKeys(JAVA_ANALYSIS_MAIN_SUCCESS_SIZE_CHARS, JAVA_ANALYSIS_MAIN_SUCCESS_TIME_MS), | ||
| new SpeedKeys(JAVA_ANALYSIS_MAIN_PARSE_ERRORS_SIZE_CHARS, JAVA_ANALYSIS_MAIN_PARSE_ERRORS_TIME_MS), | ||
| new SpeedKeys(JAVA_ANALYSIS_MAIN_EXCEPTIONS_SIZE_CHARS, JAVA_ANALYSIS_MAIN_EXCEPTIONS_TIME_MS)); | ||
| new SizeTimeAndTypeErrorKeys(JAVA_ANALYSIS_MAIN_SUCCESS_SIZE_CHARS, JAVA_ANALYSIS_MAIN_SUCCESS_TIME_MS, |
There was a problem hiding this comment.
Let's update the unit test for these data structures.
| assertThat(telemetryMap).containsEntry("java.analysis.test.success.type_error_count", "199"); | ||
| } | ||
|
|
||
| private static int lineNumberOfTheMethodWithNoSonar(FileSystem fs) throws IOException { |
There was a problem hiding this comment.
Thank you for fixing this!
To avoid problems caused by refactoring. let's add the following comment on the test test_issues_creation_on_test_file:
// Renaming this test will break stuff. The name is used to locate the line number.
|




SONARJAVA-5698