Refactored PathAnnotationInspection to use the unified AddAnnotationModCommandAction for handling path annotation quick fixes, reducing code duplication and improving maintainability.
GitOrigin-RevId: 36536b1859861095ded37a0abb22c77c0de75634
Moved path annotation tests from the base test class to a dedicated test file for clarity and maintainability.
GitOrigin-RevId: 0f6a440caff8aaf3c74c092334c771cf20404e6d
Implemented a registry for virtual `@LocalPath` annotations to associate path semantics with methods without modifying them directly. Updated `PathAnnotationInspection` to handle these virtual annotations and added comprehensive unit tests to validate the behavior.
GitOrigin-RevId: 10b8d9f5af3fe6f707aa275f6e0546a082ede71e
Updated the inspection logic to properly warn about mismatched or missing annotations in return types, such as `@NativePath`, `@LocalPath`, `@MultiRoutingFileSystemPath`, and `@Filename`. This ensures consistent validation for annotated method return values.
GitOrigin-RevId: 496a217dfd22b477eac3927850e3384a7721d268
Simplified path annotation inspection by introducing a unified `PathAnnotationInfo` structure with quick-fix mappings. Replaced verbose `when` conditions with a cleaner compatibility map for annotation checks, improving readability and maintainability. Updated associated tests to reflect the refined logic and new message structure.
GitOrigin-RevId: bd19014a0f951cd0fd5a7043b098638eab547085
Expanded validation to handle return expressions and added stricter checks for mismatched path annotations. Introduced quick fixes for missing annotations and extended test cases to reflect the new behaviors, ensuring comprehensive coverage.
GitOrigin-RevId: 0a77c6ccba44d0bf925755be69efa5688623d057
Introduce comprehensive tests to validate the correct handling of method parameters and return types for various path annotations, including @MultiRoutingFileSystemPath, @NativePath, @LocalPath, and @Filename. Ensure proper interactions and warnings for incompatible annotation usage.
GitOrigin-RevId: ad0aa2a6ef309ddd4a82993c09626f81378dc7c3
Updated PathAnnotationInspection to improve handling of `Path.toString()` calls by using `getUCallExpression` for better resolution. Enhanced test coverage to include cases with inlined `Path.toString()` calls, ensuring no unnecessary warnings are produced.
GitOrigin-RevId: 9a1ef8f82475dec1b182e5a8efd412081772149b
Enhanced `PathAnnotationInspection` to recognize `Path.toString()` as `@MultiRoutingFileSystemPath` and `System.getProperty("user.home")` as `@LocalPath`. Added tests to validate the new behavior, ensuring compatibility and correctness in these scenarios.
GitOrigin-RevId: b0f845f9e57dbe8c41270c3c96cb94b68a344b6d
* Simplify path validation by consolidating first and subsequent argument checks
* Allow `@LocalPath` annotation to be used directly in `Path.of()`
* Make error messages more specific about required annotations
* Reduce code duplication in validation logic
GitOrigin-RevId: 03e09d19dd17b374e921b0a387fa5cf19dfed5df
Introduce `doTestQuickFix` to streamline testing of quick fixes by automating setup, application, and result verification.
GitOrigin-RevId: 9c97298d992be5e4734de3aa119bfec310267dba
Introduce tests to validate correct behavior of PathAnnotationInspection when using `Paths.get`. Verify proper highlighting of non-annotated strings as first arguments and ensure no false positives for correctly annotated or valid usage scenarios.
GitOrigin-RevId: 0d7956531ae5c5679c00016325e8a78130f13864
Removed the `testMixedParameterTypes` test and replaced it with new focused test cases in `PathAnnotationInspectionPathOfTest`. The new tests cover scenarios for the `Path.of` constructor with annotated and non-annotated arguments to ensure proper inspection behavior.
GitOrigin-RevId: a4b26c0980d5dbbcfec4f0d360d50a6966d672d7
Updated `PathAnnotationInspection` to properly handle parameters of type `java.nio.file.Path`. Introduced logic to bypass validation for such parameters in methods like resolve, `resolveSibling`, `startsWith`, and `endsWith`. Added comprehensive tests to ensure correct behavior with mixed parameter types and scenarios.
GitOrigin-RevId: 77a468a2399cdc126d8e52a7687e5d066268be77
Extend PathAnnotationInspection to handle @LocalPath annotations, ensuring proper validation and highlighting of incorrect usages. Introduced relevant quick fixes and tests to validate the behavior, including scenarios involving `Path.of`, `Path.resolve`, and `FileSystem.getPath`.
GitOrigin-RevId: ab1154185a151f0c6add29321f4b91ea638ff9d1
Add support to recognize valid string literals and constant initializers representing filenames in `Path.resolve()`. Update inspection logic and test cases to exclude warnings for such cases, improving annotation handling and reducing false positives.
Generated by Junie.
GitOrigin-RevId: b8293d0c5f29a010ec34dcc4329551d5839e2be5
Introduce unit tests to verify quick fixes in PathAnnotationInspection. These include tests for adding annotations like `@MultiRoutingFileSystemPath` and `@NativePath` to resolve warnings and errors. Ensure proper functionality of related inspections and fixes.
Generated by Junie.
GitOrigin-RevId: 15e7033203a78e3a221d8825b896054bc0867570
Reorganized imports in `PathAnnotationInspectionJavaTest.kt` for clarity and consistency. Adjusted warning descriptors to improve readability in annotated string path scenarios.
GitOrigin-RevId: 96b9df9cc62ba7b5aa7f0d713621b9afd23b9478
Refactored `PathAnnotationInspection` to handle string literals and constant variables representing valid filenames. Introduced checks to identify valid filenames in `Path.of()` and `FileSystem.getPath()` methods, avoiding unnecessary warnings. Added related test cases to ensure correct behavior and extended validation coverage.
Generated by Junie.
GitOrigin-RevId: bcb7313bb4d2001f369c4b2b26b72d167c07599b
Enhanced `Path.of()` to validate argument annotations properly. Introduced checks for `@MultiRoutingFileSystemPath` and `@Filename` in 'more' parameters while ensuring accurate error reporting for invalid or missing annotations.
Generated by Junie.
GitOrigin-RevId: f2c68b79e982f5a97b8f0749725b4c271fd86285
Add checks to ensure arguments of FileSystem.getPath() are annotated correctly. First argument must use @NativePath, while additional arguments can be annotated with @NativePath or @Filename. Updated tests verify proper inspections and error reporting.
Generated by Junie.
GitOrigin-RevId: f89d99fc8b4783763c875c0445aa083aeb4d51eb
Extend PathAnnotationInspection to recognize and handle @Filename annotations, ensuring strings representing filenames are correctly annotated. Updated tests to validate behavior with both @Filename and existing annotations like @MultiRoutingFileSystemPath.
Generated by Junie.
GitOrigin-RevId: e749093e30cc0a6976aeb96a7bd112006d27fb50
Introduced inspections to warn about non-annotated strings in `Path.of()` and `Path.resolve()` contexts. Updated tests to cover these scenarios and added `@NativePath` annotation to relevant parameters in the Docker CLI functionality.
Generated by Junie to highlight `Path.of()` calls with not annotated strings as normal warnings and add highlighting of `Path.resolve()` with not annotated strings as weak warnings.
GitOrigin-RevId: fb55c1716e3c007b35428320f58c5cf7afce5b5f
Introduced `PathAnnotationInspection` to detect incorrect usage of `@NativePath` and `@MultiRoutingFileSystemPath` annotations. Added corresponding tests and test resources to validate the inspection functionality. Updated DevKit messages and inspection metadata for integration.
GitOrigin-RevId: 759c0fda9da795e0ec2f9ceab1cbd70f3ce835b7