You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2018/09/03 16:56:07 UTC
[sis] 01/03: Documentation updates,
replace StringBuffer by StringBuilder and fix a
NullPointerException.
This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git
commit 43ee5f7c2488d4d3133e26cf5a72f03305609183
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Thu Aug 30 09:31:16 2018 +0200
Documentation updates, replace StringBuffer by StringBuilder and fix a NullPointerException.
---
.../java/org/apache/sis/openoffice/Registration.java | 4 +++-
.../java/org/apache/sis/coverage/grid/GridGeometry.java | 2 +-
.../sis/referencing/factory/sql/package-info.java | 2 +-
.../java/org/apache/sis/index/tree/QuadTreeWriter.java | 17 ++++++++---------
4 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Registration.java b/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Registration.java
index ed5b61c..24173c0 100644
--- a/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Registration.java
+++ b/application/sis-openoffice/src/main/java/org/apache/sis/openoffice/Registration.java
@@ -65,9 +65,11 @@ public final class Registration implements FilenameFilter {
* Whether to force EPSG database startup early, for example in order to force database creation from SQL scripts.
* The SQL scripts may be used if this module depends on {@code sis-epsg} module, or if {@code SIS_DATA} directory
* contains a {@code "Databases/ExternalSources"} sub-directory. When such database creation is necessary, it may
- * be less surprising for users to perform this lengthly task at add-in installation time instead than when the
+ * be less surprising for users to perform this lengthy task at add-in installation time instead than when the
* formulas are first used. However if the add-in depend on {@code sis-embedded-data} instead, then early startup
* is less useful since there is no database to create.
+ *
+ * @deprecated See <a href="https://issues.apache.org/jira/browse/SIS-430">SIS-430</a>
*/
private static final boolean FORCE_EPSG_STARTUP = false;
diff --git a/core/sis-raster/src/main/java/org/apache/sis/coverage/grid/GridGeometry.java b/core/sis-raster/src/main/java/org/apache/sis/coverage/grid/GridGeometry.java
index 7804e5d..878f644 100644
--- a/core/sis-raster/src/main/java/org/apache/sis/coverage/grid/GridGeometry.java
+++ b/core/sis-raster/src/main/java/org/apache/sis/coverage/grid/GridGeometry.java
@@ -791,7 +791,7 @@ public class GridGeometry implements Serializable {
appendLabel(buffer, "Resolution", visible);
if (resolution == null) {
buffer.append("unspecified");
- } for (int i=0; i<resolution.length; i++) {
+ } else for (int i=0; i<resolution.length; i++) {
if (i != 0) buffer.append(" × ");
buffer.append((float) resolution[i]);
if (cs != null) {
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/package-info.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/package-info.java
index c9ea53b..b925fc5 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/package-info.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/package-info.java
@@ -82,7 +82,7 @@
* @author Jody Garnett (Refractions)
* @author Didier Richard (IGN)
* @author John Grange
- * @version 0.8
+ * @version 1.0
*
* @see org.apache.sis.metadata.sql
*
diff --git a/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTreeWriter.java b/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTreeWriter.java
index 169b88c..4bed64c 100644
--- a/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTreeWriter.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/index/tree/QuadTreeWriter.java
@@ -41,7 +41,7 @@ public final class QuadTreeWriter {
* @param directory
* the directory where the index file is located
*/
- public static void writeTreeToFile(QuadTree tree, String directory) throws IOException{
+ public static void writeTreeToFile(QuadTree tree, String directory) throws IOException {
createIdxDir(directory);
writeTreeConfigsToFile(tree, directory);
writeNodeToFile(tree.getRoot(), directory);
@@ -62,15 +62,15 @@ public final class QuadTreeWriter {
}
/**
- * Write quad tree configerations to file.
+ * Write quad tree configurations to file.
*
* @param tree
* the quad tree
* @param directory
- * the directory where the configerations file is located
+ * the directory where the configurations file is located
*/
- private static void writeTreeConfigsToFile(QuadTree tree, String directory) throws IOException{
- try (BufferedWriter writer = new BufferedWriter(new FileWriter(directory + "tree_config.txt"))){
+ private static void writeTreeConfigsToFile(QuadTree tree, String directory) throws IOException {
+ try (BufferedWriter writer = new BufferedWriter(new FileWriter(directory + "tree_config.txt"))) {
writer.write("capacity;" + tree.getCapacity() + ";depth;" + tree.getDepth());
writer.newLine();
writer.close();
@@ -91,9 +91,8 @@ public final class QuadTreeWriter {
* @param checkIfParent
* if true, checks if the node's child is not null and is a parent
* if false, only checks if the node's child is not null
- * @return quad tree data string
*/
- private static void writeChildrenToFile(QuadTreeNode node, Quadrant quadrant, BufferedWriter writer, String directory, boolean checkIfParent) throws IOException{
+ private static void writeChildrenToFile(QuadTreeNode node, Quadrant quadrant, BufferedWriter writer, String directory, boolean checkIfParent) throws IOException {
if (checkIfParent){
if (node.getChild(quadrant) != null && node.getChild(quadrant).getNodeType() == NodeType.GRAY) {
writeNodeToFile(node.getChild(quadrant), directory);
@@ -114,7 +113,7 @@ public final class QuadTreeWriter {
* @param directory
* the directory where the index file is located
*/
- private static void writeNodeToFile(QuadTreeNode node, String directory) throws IOException{
+ private static void writeNodeToFile(QuadTreeNode node, String directory) throws IOException {
try (BufferedWriter writer = new BufferedWriter(new FileWriter(directory + "node_" + node.getId() + ".txt"))){
if (node.getNodeType() == NodeType.GRAY) {
writeChildrenToFile(node, Quadrant.NW, writer, directory, false);
@@ -141,7 +140,7 @@ public final class QuadTreeWriter {
* @return quad tree data string
*/
private static String getQuadTreeDataString(Quadrant quadrant, final QuadTreeNode node) {
- StringBuffer str = new StringBuffer();
+ StringBuilder str = new StringBuilder();
str.append(quadrant.index());
str.append(':');
str.append(node.getNodeType().toString());