Skip to content

Commit

Permalink
Fix depreciation warnings from jdk21
Browse files Browse the repository at this point in the history
  • Loading branch information
nixel2007 committed Jun 6, 2024
1 parent dd5b714 commit 1623f32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
@Component
@Slf4j
@RequiredArgsConstructor
@SuppressWarnings("removal") // SensitivityWatchEventModifier is deprecated in jdk21
public class ConfigurationFileSystemWatcher {

private final LanguageServerConfiguration configuration;
Expand Down Expand Up @@ -131,6 +132,8 @@ private void registerWatchService(File configurationFile) {

registeredPath = configurationDir;

// TODO: SensitivityWatchEventModifier is deprecated in java 21 and marked for removal.
// We need to drop usage of it here when we change our baseline to jdk 21
watchKey = registeredPath.register(
watchService,
new WatchEvent.Kind[]{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private boolean checkIgnoreOn(

private void addIgnoredRange(DiagnosticCode diagnosticKey, int ignoreRangeStart, int ignoreRangeEnd) {
// convert antlr4 line numbers (1..n) to lsp (0..n)
Range<Integer> ignoreRange = Range.between(ignoreRangeStart - 1, ignoreRangeEnd - 1);
Range<Integer> ignoreRange = Range.of(ignoreRangeStart - 1, ignoreRangeEnd - 1);
final List<Range<Integer>> ranges = diagnosticIgnorance.computeIfAbsent(diagnosticKey, s -> new ArrayList<>());
ranges.add(ignoreRange);
}
Expand Down

0 comments on commit 1623f32

Please sign in to comment.