Skip to content

Commit

Permalink
Issue checkstyle#15626: Explain what happens when an import matches t…
Browse files Browse the repository at this point in the history
…wo or more groups
  • Loading branch information
JayBazuzi authored and nrmancuso committed Sep 17, 2024
1 parent 978b70c commit f66c74c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@
* <li>
* Property {@code groups} - Specify list of <b>type import</b> groups. Every group identified
* either by a common prefix string, or by a regular expression enclosed in forward slashes
* (e.g. {@code /regexp/}). All type imports, which does not match any group, falls into an
* (e.g. {@code /regexp/}). If an import matches two or more groups,
* the best match is selected (closest to the start, and the longest match).
* All type imports, which does not match any group, falls into an
* additional group, located at the end.
* Thus, the empty list of type groups (the default value) means one group for all type imports.
* Type is {@code java.lang.String[]}.
Expand Down Expand Up @@ -116,7 +118,9 @@
* <li>
* Property {@code staticGroups} - Specify list of <b>static</b> import groups. Every group
* identified either by a common prefix string, or by a regular expression enclosed in forward
* slashes (e.g. {@code /regexp/}). All static imports, which does not match any group, fall into
* slashes (e.g. {@code /regexp/}). If an import matches two or more groups,
* the best match is selected (closest to the start, and the longest match).
* All static imports, which does not match any group, fall into
* an additional group, located at the end. Thus, the empty list of static groups (the default
* value) means one group for all static imports. This property has effect only when the property
* {@code option} is set to {@code top} or {@code bottom}.
Expand Down Expand Up @@ -184,6 +188,8 @@ public class ImportOrderCheck
/**
* Specify list of <b>type import</b> groups. Every group identified either by a common prefix
* string, or by a regular expression enclosed in forward slashes (e.g. {@code /regexp/}).
* If an import matches two or more groups,
* the best match is selected (closest to the start, and the longest match).
* All type imports, which does not match any group, falls into an additional group,
* located at the end. Thus, the empty list of type groups (the default value) means one group
* for all type imports.
Expand All @@ -193,6 +199,8 @@ public class ImportOrderCheck
/**
* Specify list of <b>static</b> import groups. Every group identified either by a common prefix
* string, or by a regular expression enclosed in forward slashes (e.g. {@code /regexp/}).
* If an import matches two or more groups,
* the best match is selected (closest to the start, and the longest match).
* All static imports, which does not match any group, fall into an additional group, located
* at the end. Thus, the empty list of static groups (the default value) means one group for all
* static imports. This property has effect only when the property {@code option} is set to
Expand Down Expand Up @@ -288,7 +296,9 @@ public void setOption(String optionStr) {
/**
* Setter to specify list of <b>type import</b> groups. Every group identified either by a
* common prefix string, or by a regular expression enclosed in forward slashes
* (e.g. {@code /regexp/}). All type imports, which does not match any group, falls into an
* (e.g. {@code /regexp/}). If an import matches two or more groups,
* the best match is selected (closest to the start, and the longest match).
* All type imports, which does not match any group, falls into an
* additional group, located at the end. Thus, the empty list of type groups (the default value)
* means one group for all type imports.
*
Expand All @@ -303,7 +313,9 @@ public void setGroups(String... packageGroups) {
/**
* Setter to specify list of <b>static</b> import groups. Every group identified either by a
* common prefix string, or by a regular expression enclosed in forward slashes
* (e.g. {@code /regexp/}). All static imports, which does not match any group, fall into an
* (e.g. {@code /regexp/}). If an import matches two or more groups,
* the best match is selected (closest to the start, and the longest match).
* All static imports, which does not match any group, fall into an
* additional group, located at the end. Thus, the empty list of static groups (the default
* value) means one group for all static imports. This property has effect only when
* the property {@code option} is set to {@code top} or {@code bottom}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
<property default-value="" name="groups" type="java.lang.String[]">
<description>Specify list of &lt;b&gt;type import&lt;/b&gt; groups. Every group identified
either by a common prefix string, or by a regular expression enclosed in forward slashes
(e.g. {@code /regexp/}). All type imports, which does not match any group, falls into an
(e.g. {@code /regexp/}). If an import matches two or more groups,
the best match is selected (closest to the start, and the longest match).
All type imports, which does not match any group, falls into an
additional group, located at the end.
Thus, the empty list of type groups (the default value) means one group for all type imports.</description>
</property>
Expand Down Expand Up @@ -78,7 +80,9 @@
<property default-value="" name="staticGroups" type="java.lang.String[]">
<description>Specify list of &lt;b&gt;static&lt;/b&gt; import groups. Every group
identified either by a common prefix string, or by a regular expression enclosed in forward
slashes (e.g. {@code /regexp/}). All static imports, which does not match any group, fall into
slashes (e.g. {@code /regexp/}). If an import matches two or more groups,
the best match is selected (closest to the start, and the longest match).
All static imports, which does not match any group, fall into
an additional group, located at the end. Thus, the empty list of static groups (the default
value) means one group for all static imports. This property has effect only when the property
{@code option} is set to {@code top} or {@code bottom}.</description>
Expand Down
4 changes: 2 additions & 2 deletions src/xdocs/checks/imports/importorder.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</tr>
<tr>
<td>groups</td>
<td>Specify list of <b>type import</b> groups. Every group identified either by a common prefix string, or by a regular expression enclosed in forward slashes (e.g. <code>/regexp/</code>). All type imports, which does not match any group, falls into an additional group, located at the end. Thus, the empty list of type groups (the default value) means one group for all type imports.</td>
<td>Specify list of <b>type import</b> groups. Every group identified either by a common prefix string, or by a regular expression enclosed in forward slashes (e.g. <code>/regexp/</code>). If an import matches two or more groups, the best match is selected (closest to the start, and the longest match). All type imports, which does not match any group, falls into an additional group, located at the end. Thus, the empty list of type groups (the default value) means one group for all type imports.</td>
<td><a href="../../property_types.html#String.5B.5D">String[]</a></td>
<td><code>{}</code></td>
<td>3.2</td>
Expand Down Expand Up @@ -94,7 +94,7 @@
</tr>
<tr>
<td>staticGroups</td>
<td>Specify list of <b>static</b> import groups. Every group identified either by a common prefix string, or by a regular expression enclosed in forward slashes (e.g. <code>/regexp/</code>). All static imports, which does not match any group, fall into an additional group, located at the end. Thus, the empty list of static groups (the default value) means one group for all static imports. This property has effect only when the property <code>option</code> is set to <code>top</code> or <code>bottom</code>.</td>
<td>Specify list of <b>static</b> import groups. Every group identified either by a common prefix string, or by a regular expression enclosed in forward slashes (e.g. <code>/regexp/</code>). If an import matches two or more groups, the best match is selected (closest to the start, and the longest match). All static imports, which does not match any group, fall into an additional group, located at the end. Thus, the empty list of static groups (the default value) means one group for all static imports. This property has effect only when the property <code>option</code> is set to <code>top</code> or <code>bottom</code>.</td>
<td><a href="../../property_types.html#String.5B.5D">String[]</a></td>
<td><code>{}</code></td>
<td>8.12</td>
Expand Down

0 comments on commit f66c74c

Please sign in to comment.