Re: Fwd: [db-jdo] 01/01: Update PropertyUtils.java

2023-04-03 Thread Tobias Bouschen

Hi Craig,

the instructions on how to run the format jobs are given in the readme: 
https://github.com/apache/db-jdo#formatting-using-maven


GJF also formats javadoc. So my guess would be that the new javadoc is 
not formatted correctly. The issue is probably that the javadoc has a 
linebreak even though the character limit is not reached on the first 
line. If you want the second line to actually be printed as a second 
line in the javadoc, you have to add '' between the two lines. If you 
just add a blank line between the two javadoc lines, the formatter 
should do this for you.


Best regards,
Tobias

On 03/04/2023 22:25, Craig Russell wrote:

So the code format check failed. I cannot see anything wrong with the changes I 
made.

https://github.com/apache/db-jdo/actions/runs/4591159720/jobs/8107138939?pr=73

Error:  To fix formatting errors, run "mvn 
com.spotify.fmt:fmt-maven-plugin:format"
8275
  
Error:
  Non complying file: 
/home/runner/work/db-jdo/db-jdo/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java
While I try to figure out how to run com.spotify.fmt could anyone just tell me 
what the problem is?

Thanks,
Craig


Begin forwarded message:

From: c...@apache.org
Subject: [db-jdo] 01/01: Update PropertyUtils.java
Date: April 2, 2023 at 15:28:40 PDT
To: "jdo-comm...@db.apache.org" 
Reply-To: jdo-dev@db.apache.org

This is an automated email from the ASF dual-hosted git repository.

clr pushed a commit to branch clr-apache-array-copy
in repository https://gitbox.apache.org/repos/asf/db-jdo.git

commit 034060cb69ad0a10f9bdf5aca4d5a0c9c9c11e8c
Author: Craig L Russell 
AuthorDate: Sun Apr 2 15:28:34 2023 -0700

Update PropertyUtils.java

JDO-819 Fix code smells
Use "Arrays.copyOf", "Arrays.asList", "Collections.addAll" or 
"System.arraycopy" instead.
---
.../java/org/apache/jdo/exectck/PropertyUtils.java | 23 ++
1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java 
b/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java
index 07473bce..eef6d73c 100644
--- a/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java
+++ b/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java
@@ -16,6 +16,7 @@ package org.apache.jdo.exectck;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Properties;
@@ -28,31 +29,27 @@ public class PropertyUtils {
   }

   /**
-   * Separates white space separated items from a String into Collection 
entries Used to collect
-   * command line argument lists into a Collection
+   * Separates white space separated items from a String into a Set
+   * Used to collect command line arguments
*
* @param names String of white space separated items
-   * @param list HashSet to contain String items
+   * @param set Set to contain String items
*/
-  public static void string2Set(String names, Collection list) {
+  public static void string2Set(String names, Collection set) {
 String[] items = names.split("[ \t\n]");
-for (String s : items) {
-  list.add(s);
-}
+set.addAll(Arrays.asList(items));
   }

   /**
-   * Separates white space separated items from a String into HashSet entries 
Used to collect
-   * command line argument lists into a Collection
+   * Separates white space separated items from a String into a List
+   * Used to collect command line arguments
*
* @param names String of white space separated items
-   * @param list HashSet to contain String items
+   * @param list List to contain String items
*/
   public static void string2List(String names, List list) {
 String[] items = names.split("[ \t\n]");
-for (String s : items) {
-  list.add(s);
-}
+list.addAll(Arrays.asList(items));
   }

   /**


Craig L Russell
c...@apache.org




Fwd: [db-jdo] 01/01: Update PropertyUtils.java

2023-04-03 Thread Craig Russell
So the code format check failed. I cannot see anything wrong with the changes I 
made.

https://github.com/apache/db-jdo/actions/runs/4591159720/jobs/8107138939?pr=73

Error:  To fix formatting errors, run "mvn 
com.spotify.fmt:fmt-maven-plugin:format"
8275
 
Error:
  Non complying file: 
/home/runner/work/db-jdo/db-jdo/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java
While I try to figure out how to run com.spotify.fmt could anyone just tell me 
what the problem is?

Thanks,
Craig

> Begin forwarded message:
> 
> From: c...@apache.org
> Subject: [db-jdo] 01/01: Update PropertyUtils.java
> Date: April 2, 2023 at 15:28:40 PDT
> To: "jdo-comm...@db.apache.org" 
> Reply-To: jdo-dev@db.apache.org
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> clr pushed a commit to branch clr-apache-array-copy
> in repository https://gitbox.apache.org/repos/asf/db-jdo.git
> 
> commit 034060cb69ad0a10f9bdf5aca4d5a0c9c9c11e8c
> Author: Craig L Russell 
> AuthorDate: Sun Apr 2 15:28:34 2023 -0700
> 
>Update PropertyUtils.java
> 
>JDO-819 Fix code smells
>Use "Arrays.copyOf", "Arrays.asList", "Collections.addAll" or 
> "System.arraycopy" instead.
> ---
> .../java/org/apache/jdo/exectck/PropertyUtils.java | 23 ++
> 1 file changed, 10 insertions(+), 13 deletions(-)
> 
> diff --git a/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java 
> b/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java
> index 07473bce..eef6d73c 100644
> --- a/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java
> +++ b/exectck/src/main/java/org/apache/jdo/exectck/PropertyUtils.java
> @@ -16,6 +16,7 @@ package org.apache.jdo.exectck;
> import java.io.File;
> import java.io.FileInputStream;
> import java.io.IOException;
> +import java.util.Arrays;
> import java.util.Collection;
> import java.util.List;
> import java.util.Properties;
> @@ -28,31 +29,27 @@ public class PropertyUtils {
>   }
> 
>   /**
> -   * Separates white space separated items from a String into Collection 
> entries Used to collect
> -   * command line argument lists into a Collection
> +   * Separates white space separated items from a String into a Set
> +   * Used to collect command line arguments
>*
>* @param names String of white space separated items
> -   * @param list HashSet to contain String items
> +   * @param set Set to contain String items
>*/
> -  public static void string2Set(String names, Collection list) {
> +  public static void string2Set(String names, Collection set) {
> String[] items = names.split("[ \t\n]");
> -for (String s : items) {
> -  list.add(s);
> -}
> +set.addAll(Arrays.asList(items));
>   }
> 
>   /**
> -   * Separates white space separated items from a String into HashSet 
> entries Used to collect
> -   * command line argument lists into a Collection
> +   * Separates white space separated items from a String into a List
> +   * Used to collect command line arguments
>*
>* @param names String of white space separated items
> -   * @param list HashSet to contain String items
> +   * @param list List to contain String items
>*/
>   public static void string2List(String names, List list) {
> String[] items = names.split("[ \t\n]");
> -for (String s : items) {
> -  list.add(s);
> -}
> +list.addAll(Arrays.asList(items));
>   }
> 
>   /**
> 

Craig L Russell
c...@apache.org