From a99d1835baf60e5dfa8ffe75d5d2cdc2b3707766 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Fri, 4 Jun 2021 15:37:43 +0200 Subject: [PATCH] update language injection and pattern validation inspection descriptions GitOrigin-RevId: bdc93923120d204b059fb91e68bf872c99a49344 --- .../InjectionNotApplicable.html | 8 ++++++++ .../inspectionDescriptions/PatternNotApplicable.html | 4 ++++ .../PatternOverriddenByNonAnnotatedMethod.html | 11 +++++++++++ .../inspectionDescriptions/PatternValidation.html | 10 ++++++++-- .../inspectionDescriptions/UnknownLanguage.html | 6 +++++- 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/plugins/IntelliLang/java-support/inspectionDescriptions/InjectionNotApplicable.html b/plugins/IntelliLang/java-support/inspectionDescriptions/InjectionNotApplicable.html index 0985b681748a..f7f4244209c4 100644 --- a/plugins/IntelliLang/java-support/inspectionDescriptions/InjectionNotApplicable.html +++ b/plugins/IntelliLang/java-support/inspectionDescriptions/InjectionNotApplicable.html @@ -1,5 +1,13 @@ Reports when a @Language annotation is applied to an element with a type other than String or String[]. +

Example:

+

+  @Language("HTML") int i;
+
+

After the quick-fix is applied:

+

+  int i;
+
diff --git a/plugins/IntelliLang/java-support/inspectionDescriptions/PatternNotApplicable.html b/plugins/IntelliLang/java-support/inspectionDescriptions/PatternNotApplicable.html index 1fb360565613..3b6cb35e8c5c 100644 --- a/plugins/IntelliLang/java-support/inspectionDescriptions/PatternNotApplicable.html +++ b/plugins/IntelliLang/java-support/inspectionDescriptions/PatternNotApplicable.html @@ -1,5 +1,9 @@ Reports when a @Pattern annotation is applied to an element with a type other than String. +

Example:

+

+  @Pattern("\\d\\d") int i;
+
diff --git a/plugins/IntelliLang/java-support/inspectionDescriptions/PatternOverriddenByNonAnnotatedMethod.html b/plugins/IntelliLang/java-support/inspectionDescriptions/PatternOverriddenByNonAnnotatedMethod.html index f0c51d3599fd..149d22eeff1c 100644 --- a/plugins/IntelliLang/java-support/inspectionDescriptions/PatternOverriddenByNonAnnotatedMethod.html +++ b/plugins/IntelliLang/java-support/inspectionDescriptions/PatternOverriddenByNonAnnotatedMethod.html @@ -5,5 +5,16 @@ This does not prevent error-highlighting inside the editor, however the overridi

A quick fix is provided to add a @Pattern annotation that matches the one from the superclass method. This ensures the runtime-check instrumentation works correctly. +

Example:

+

+  abstract class Parent {
+    abstract @Pattern("\\d\\d-\\d\\d\\d") String getId();
+  }
+  class Child extends Parent {
+    @Override String getId() { // warning here
+      return "12-345";
+    }
+  }
+
diff --git a/plugins/IntelliLang/java-support/inspectionDescriptions/PatternValidation.html b/plugins/IntelliLang/java-support/inspectionDescriptions/PatternValidation.html index a7ca7ba7c037..c3fcc3ce49fa 100644 --- a/plugins/IntelliLang/java-support/inspectionDescriptions/PatternValidation.html +++ b/plugins/IntelliLang/java-support/inspectionDescriptions/PatternValidation.html @@ -1,6 +1,12 @@ -Validates expressions passed as arguments for @Pattern parameters and -values returned from @Pattern-annotated methods. +Reports expressions passed as arguments for @Pattern parameters and +returned from @Pattern-annotated methods that do not match the specified pattern. +

Example:

+

+  @Pattern("\\d\\d-\\d\\d\\d") String getId() {
+    return "1";
+  }
+
diff --git a/plugins/IntelliLang/java-support/inspectionDescriptions/UnknownLanguage.html b/plugins/IntelliLang/java-support/inspectionDescriptions/UnknownLanguage.html index e27581de149a..7f6c8fd94163 100644 --- a/plugins/IntelliLang/java-support/inspectionDescriptions/UnknownLanguage.html +++ b/plugins/IntelliLang/java-support/inspectionDescriptions/UnknownLanguage.html @@ -1,5 +1,9 @@ -Reports when the ID of the language used in an @Language annotation is unknown. +Reports when the ID of the language used in a @Language annotation is unknown. +

Example:

+

+  @Language("HMTL") String html;
+