From 69e1f3801c7228e61efabc32d1aeac3f3e637743 Mon Sep 17 00:00:00 2001 From: Louis Vignier Date: Tue, 12 Mar 2024 15:55:26 +0100 Subject: [PATCH] [java] Update intention descriptions GitOrigin-RevId: 5e54c459496263c585ade17ee70e81a8147a74c8 --- .../description.html | 2 +- .../DemorgansIntention/description.html | 19 +------- .../EditContractIntention/description.html | 47 ++++++++++--------- .../description.html | 2 +- .../description.html | 2 +- .../description.html | 2 +- .../description.html | 6 +-- .../description.html | 2 +- .../description.html | 2 +- 9 files changed, 36 insertions(+), 48 deletions(-) diff --git a/java/java-impl/src/intentionDescriptions/BreakStringOnLineBreaksIntentionAction/description.html b/java/java-impl/src/intentionDescriptions/BreakStringOnLineBreaksIntentionAction/description.html index c63d77eb9a36..e66984b107c1 100644 --- a/java/java-impl/src/intentionDescriptions/BreakStringOnLineBreaksIntentionAction/description.html +++ b/java/java-impl/src/intentionDescriptions/BreakStringOnLineBreaksIntentionAction/description.html @@ -1,5 +1,5 @@ -Breaks a string at the '\n' and '\n\r' line separators. +Breaks a string at the \n and \n\r line separators. diff --git a/java/java-impl/src/intentionDescriptions/DemorgansIntention/description.html b/java/java-impl/src/intentionDescriptions/DemorgansIntention/description.html index c43088ab359e..352c3d66ad60 100644 --- a/java/java-impl/src/intentionDescriptions/DemorgansIntention/description.html +++ b/java/java-impl/src/intentionDescriptions/DemorgansIntention/description.html @@ -1,21 +1,6 @@ -Replaces either - - - - - - - - - -
    - a || b with !(!a && !b) or -
    - a && b with !(!a || !b) -
- -when inside a boolean expression. +Replaces either a || b with !(!a && !b) or +a && b with !(!a || !b) when inside a boolean expression. diff --git a/java/java-impl/src/intentionDescriptions/EditContractIntention/description.html b/java/java-impl/src/intentionDescriptions/EditContractIntention/description.html index 57ba0293c2bd..7234fc080822 100644 --- a/java/java-impl/src/intentionDescriptions/EditContractIntention/description.html +++ b/java/java-impl/src/intentionDescriptions/EditContractIntention/description.html @@ -1,30 +1,33 @@ This intention changes a library method contract. -Method contract has the following syntax:
- contract ::= (clause ';')* clause
- clause ::= args '->' effect
- args ::= ((arg ',')* arg )?
- arg ::= value-constraint
- value-constraint ::= '_' | 'null' | '!null' | 'false' | 'true'
- effect ::= value-constraint | 'fail' | 'new' | 'this' | 'param' number
- number ::= [1-9] [0-9]*

+A method contract has the following syntax: +


+ contract ::= (clause ';')* clause
+ clause ::= args '->' effect
+ args ::= ((arg ',')* arg )?
+ arg ::= value-constraint
+ value-constraint ::= '_' | 'null' | '!null' | 'false' | 'true'
+ effect ::= value-constraint | 'fail' | 'new' | 'this' | 'param' number
+ number ::= [1-9] [0-9]*
+
The constraints denote the following:
+Examples:
+ -Examples:

-@Contract("_, null -> null") - method returns null if its second argument is null
-@Contract("_, null -> null; _, !null -> !null") - method returns null if its second argument is null and not-null otherwise
-@Contract("true -> fail") - a typical assertFalse method which throws an exception if true is passed to it
- diff --git a/java/java-impl/src/intentionDescriptions/ExtractIncrementIntention/description.html b/java/java-impl/src/intentionDescriptions/ExtractIncrementIntention/description.html index b73250b44a97..899c23f742c4 100644 --- a/java/java-impl/src/intentionDescriptions/ExtractIncrementIntention/description.html +++ b/java/java-impl/src/intentionDescriptions/ExtractIncrementIntention/description.html @@ -1,7 +1,7 @@ Extracts an increment or decrement -operation, that is used inside another statement, into a separate statement. Due to +an operation used inside another statement, into a separate statement. Due to the inherent possibility of side effects in this operation, this intention may alter the semantics of the modified statements. diff --git a/java/java-impl/src/intentionDescriptions/MoveCommentToSeparateLineIntention/description.html b/java/java-impl/src/intentionDescriptions/MoveCommentToSeparateLineIntention/description.html index 0df35713ed11..b6094cea8a25 100644 --- a/java/java-impl/src/intentionDescriptions/MoveCommentToSeparateLineIntention/description.html +++ b/java/java-impl/src/intentionDescriptions/MoveCommentToSeparateLineIntention/description.html @@ -1,6 +1,6 @@ -Moves a comment that is located on the +Moves a comment located on the same line as code up to a separate line of its own. diff --git a/java/java-impl/src/intentionDescriptions/ReplaceConstructorWithBuilderAction/description.html b/java/java-impl/src/intentionDescriptions/ReplaceConstructorWithBuilderAction/description.html index 689651019b26..715a38256bc9 100644 --- a/java/java-impl/src/intentionDescriptions/ReplaceConstructorWithBuilderAction/description.html +++ b/java/java-impl/src/intentionDescriptions/ReplaceConstructorWithBuilderAction/description.html @@ -4,6 +4,6 @@ Replaces constructor calls with builder patterns.

Class constructors are left unchanged, but clients are able to construct objects step by step.

-It can be especially useful for constructors with long list of optional parameters. +It can be especially useful for constructors with a long list of optional parameters. \ No newline at end of file diff --git a/java/java-impl/src/intentionDescriptions/ReplaceConstructorWithFactoryAction/description.html b/java/java-impl/src/intentionDescriptions/ReplaceConstructorWithFactoryAction/description.html index 0575189b6e6b..824e16381172 100644 --- a/java/java-impl/src/intentionDescriptions/ReplaceConstructorWithFactoryAction/description.html +++ b/java/java-impl/src/intentionDescriptions/ReplaceConstructorWithFactoryAction/description.html @@ -2,10 +2,10 @@ Replaces constructor calls with calls to the factory method.

-Since factory methods can create objects of any type, such replacement can be especially useful when a new instance of the containing class is not desired. +Since factory methods can create objects of any type, such a replacement can be especially useful when a new instance of the containing class is not desired.

-E.g. -when current class is extended and objects of subclasses should be created instead. +E.g., +when the current class is extended and objects of subclasses should be created instead. Or when caching is introduced and existing objects should be returned. \ No newline at end of file diff --git a/java/java-impl/src/intentionDescriptions/ReplaceWithArraysAsListIntention/description.html b/java/java-impl/src/intentionDescriptions/ReplaceWithArraysAsListIntention/description.html index e7b9eed901d1..98445faafb22 100644 --- a/java/java-impl/src/intentionDescriptions/ReplaceWithArraysAsListIntention/description.html +++ b/java/java-impl/src/intentionDescriptions/ReplaceWithArraysAsListIntention/description.html @@ -1,7 +1,7 @@ Replaces a Collections.emptyList() or Collections.singletonList() call with a call to Arrays.asList(). -

When the project or module uses the language level 9:

+

When the project or module uses language level 9: