This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/sis-site.git
The following commit(s) were added to refs/heads/main by this push:
new c2e884de Add a note about order of import statements.
c2e884de is described below
commit c2e884de041c731eddc2694e5a43bfbea624531b
Author: Martin Desruisseaux <[email protected]>
AuthorDate: Wed Apr 2 17:34:22 2025 +0200
Add a note about order of import statements.
---
content/code-patterns.md | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/content/code-patterns.md b/content/code-patterns.md
index 8f083eb7..d6d168e6 100644
--- a/content/code-patterns.md
+++ b/content/code-patterns.md
@@ -133,6 +133,24 @@ When a code hides a field, it should be a statement such as
+# Imports order {#imports}
+
+There is currently no strict rule about the order of `import` statements in
Apache SIS code base, except one:
+if a class is different in the `main`, `geoapi-3.1` and `geoapi-4.0` branches,
and if those differences imply
+different import statements, then the imports that are different should be
grouped last with a comment.
+Example:
+
+```java
+// Specific to the geoapi-3.1 and geoapi-4.0 branches:
+import org.opengis.filter.Filter;
+import org.opengis.filter.Expression;
+```
+
+The purpose is to reduce the number of conflicts during the merges between
branches.
+
+
+
+
# Javadoc {#javadoc}
Javadoc comments are written in HTML, not Markdown, both for historical
reasons and because HTML allows richer semantic.