sonatype-lift[bot] commented on code in PR #1785:
URL: https://github.com/apache/groovy/pull/1785#discussion_r984914990
##########
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java:
##########
@@ -7549,84 +7195,44 @@ public static <T> IntRange getIndices(T[] self) {
return new IntRange(false, 0, self.length);
}
- /**
- * Returns indices of the boolean array.
- *
- * @see #getIndices(Object[])
- * @since 3.0.8
- */
+ @Deprecated
public static IntRange getIndices(boolean[] self) {
- return new IntRange(false, 0, self.length);
+ return ArrayGroovyMethods.getIndices(self);
}
- /**
- * Returns indices of the byte array.
- *
- * @see #getIndices(Object[])
- * @since 3.0.8
- */
+ @Deprecated
public static IntRange getIndices(byte[] self) {
- return new IntRange(false, 0, self.length);
+ return ArrayGroovyMethods.getIndices(self);
}
- /**
- * Returns indices of the char array.
- *
- * @see #getIndices(Object[])
- * @since 3.0.8
- */
+ @Deprecated
public static IntRange getIndices(char[] self) {
Review Comment:
*[InlineMeSuggester](https://errorprone.info/bugpattern/InlineMeSuggester):*
This deprecated API looks inlineable. If you'd like the body of the API to be
inlined to its callers, please annotate it with @InlineMe.
---
```suggestion
@InlineMe(replacement = "ArrayGroovyMethods.getIndices(self)", imports =
"org.codehaus.groovy.runtime.ArrayGroovyMethods")
```
---
<details><summary><b>âšī¸ Learn about @sonatype-lift commands</b></summary>
You can reply with the following commands. For example, reply with
***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this
PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified
`file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see
its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new)
to add LiftBot to another repo.</sub></details>
---
Was this a good recommendation?
[ [đ Not
relevant](https://www.sonatype.com/lift-comment-rating?comment=340737254&lift_comment_rating=1)
] - [ [đ Won't
fix](https://www.sonatype.com/lift-comment-rating?comment=340737254&lift_comment_rating=2)
] - [ [đ Not critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737254&lift_comment_rating=3)
] - [ [đ Critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737254&lift_comment_rating=4)
] - [ [đ Critical, fixing
now](https://www.sonatype.com/lift-comment-rating?comment=340737254&lift_comment_rating=5)
]
##########
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java:
##########
@@ -6803,116 +6521,44 @@ public static <T> String join(T[] self, String
separator) {
return join(new ArrayIterator<>(self), separator);
}
- /**
- * Concatenates the string representation of each
- * items in this array, with the given String as a separator between each
- * item.
- *
- * @param self an array of boolean
- * @param separator a String separator
- * @return the joined String
- * @since 2.4.1
- */
+ @Deprecated
public static String join(boolean[] self, String separator) {
- return join(new BooleanArrayIterator(self), separator);
+ return ArrayGroovyMethods.join(self, separator);
}
- /**
- * Concatenates the string representation of each
- * items in this array, with the given String as a separator between each
- * item.
- *
- * @param self an array of byte
- * @param separator a String separator
- * @return the joined String
- * @since 2.4.1
- */
+ @Deprecated
public static String join(byte[] self, String separator) {
- return join(new ByteArrayIterator(self), separator);
+ return ArrayGroovyMethods.join(self, separator);
}
- /**
- * Concatenates the string representation of each
- * items in this array, with the given String as a separator between each
- * item.
- *
- * @param self an array of char
- * @param separator a String separator
- * @return the joined String
- * @since 2.4.1
- */
+ @Deprecated
public static String join(char[] self, String separator) {
- return join(new CharArrayIterator(self), separator);
+ return ArrayGroovyMethods.join(self, separator);
}
- /**
- * Concatenates the string representation of each
- * items in this array, with the given String as a separator between each
- * item.
- *
- * @param self an array of double
- * @param separator a String separator
- * @return the joined String
- * @since 2.4.1
- */
+ @Deprecated
public static String join(double[] self, String separator) {
- return join(new DoubleArrayIterator(self), separator);
+ return ArrayGroovyMethods.join(self, separator);
}
- /**
- * Concatenates the string representation of each
- * items in this array, with the given String as a separator between each
- * item.
- *
- * @param self an array of float
- * @param separator a String separator
- * @return the joined String
- * @since 2.4.1
- */
+ @Deprecated
public static String join(float[] self, String separator) {
Review Comment:
*[InlineMeSuggester](https://errorprone.info/bugpattern/InlineMeSuggester):*
This deprecated API looks inlineable. If you'd like the body of the API to be
inlined to its callers, please annotate it with @InlineMe.
---
```suggestion
@InlineMe(replacement = "ArrayGroovyMethods.join(self, separator)",
imports = "org.codehaus.groovy.runtime.ArrayGroovyMethods")
```
---
<details><summary><b>âšī¸ Learn about @sonatype-lift commands</b></summary>
You can reply with the following commands. For example, reply with
***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this
PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified
`file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see
its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new)
to add LiftBot to another repo.</sub></details>
---
Was this a good recommendation?
[ [đ Not
relevant](https://www.sonatype.com/lift-comment-rating?comment=340737292&lift_comment_rating=1)
] - [ [đ Won't
fix](https://www.sonatype.com/lift-comment-rating?comment=340737292&lift_comment_rating=2)
] - [ [đ Not critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737292&lift_comment_rating=3)
] - [ [đ Critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737292&lift_comment_rating=4)
] - [ [đ Critical, fixing
now](https://www.sonatype.com/lift-comment-rating?comment=340737292&lift_comment_rating=5)
]
##########
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java:
##########
@@ -7549,84 +7195,44 @@ public static <T> IntRange getIndices(T[] self) {
return new IntRange(false, 0, self.length);
}
- /**
- * Returns indices of the boolean array.
- *
- * @see #getIndices(Object[])
- * @since 3.0.8
- */
+ @Deprecated
public static IntRange getIndices(boolean[] self) {
- return new IntRange(false, 0, self.length);
+ return ArrayGroovyMethods.getIndices(self);
}
- /**
- * Returns indices of the byte array.
- *
- * @see #getIndices(Object[])
- * @since 3.0.8
- */
+ @Deprecated
public static IntRange getIndices(byte[] self) {
- return new IntRange(false, 0, self.length);
+ return ArrayGroovyMethods.getIndices(self);
}
- /**
- * Returns indices of the char array.
- *
- * @see #getIndices(Object[])
- * @since 3.0.8
- */
+ @Deprecated
public static IntRange getIndices(char[] self) {
- return new IntRange(false, 0, self.length);
+ return ArrayGroovyMethods.getIndices(self);
}
- /**
- * Returns indices of the double array.
- *
- * @see #getIndices(Object[])
- * @since 3.0.8
- */
+ @Deprecated
public static IntRange getIndices(double[] self) {
- return new IntRange(false, 0, self.length);
+ return ArrayGroovyMethods.getIndices(self);
}
- /**
- * Returns indices of the float array.
- *
- * @see #getIndices(Object[])
- * @since 3.0.8
- */
+ @Deprecated
public static IntRange getIndices(float[] self) {
- return new IntRange(false, 0, self.length);
+ return ArrayGroovyMethods.getIndices(self);
}
- /**
- * Returns indices of the int array.
- *
- * @see #getIndices(Object[])
- * @since 3.0.8
- */
+ @Deprecated
public static IntRange getIndices(int[] self) {
Review Comment:
*[InlineMeSuggester](https://errorprone.info/bugpattern/InlineMeSuggester):*
This deprecated API looks inlineable. If you'd like the body of the API to be
inlined to its callers, please annotate it with @InlineMe.
---
```suggestion
@InlineMe(replacement = "ArrayGroovyMethods.getIndices(self)", imports =
"org.codehaus.groovy.runtime.ArrayGroovyMethods")
```
---
<details><summary><b>âšī¸ Learn about @sonatype-lift commands</b></summary>
You can reply with the following commands. For example, reply with
***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this
PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified
`file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see
its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new)
to add LiftBot to another repo.</sub></details>
---
Was this a good recommendation?
[ [đ Not
relevant](https://www.sonatype.com/lift-comment-rating?comment=340737300&lift_comment_rating=1)
] - [ [đ Won't
fix](https://www.sonatype.com/lift-comment-rating?comment=340737300&lift_comment_rating=2)
] - [ [đ Not critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737300&lift_comment_rating=3)
] - [ [đ Critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737300&lift_comment_rating=4)
] - [ [đ Critical, fixing
now](https://www.sonatype.com/lift-comment-rating?comment=340737300&lift_comment_rating=5)
]
##########
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java:
##########
@@ -7549,84 +7195,44 @@ public static <T> IntRange getIndices(T[] self) {
return new IntRange(false, 0, self.length);
}
- /**
- * Returns indices of the boolean array.
- *
- * @see #getIndices(Object[])
- * @since 3.0.8
- */
+ @Deprecated
public static IntRange getIndices(boolean[] self) {
- return new IntRange(false, 0, self.length);
+ return ArrayGroovyMethods.getIndices(self);
}
- /**
- * Returns indices of the byte array.
- *
- * @see #getIndices(Object[])
- * @since 3.0.8
- */
+ @Deprecated
public static IntRange getIndices(byte[] self) {
Review Comment:
*[InlineMeSuggester](https://errorprone.info/bugpattern/InlineMeSuggester):*
This deprecated API looks inlineable. If you'd like the body of the API to be
inlined to its callers, please annotate it with @InlineMe.
---
```suggestion
@InlineMe(replacement = "ArrayGroovyMethods.getIndices(self)", imports =
"org.codehaus.groovy.runtime.ArrayGroovyMethods")
```
---
<details><summary><b>âšī¸ Learn about @sonatype-lift commands</b></summary>
You can reply with the following commands. For example, reply with
***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this
PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified
`file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see
its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new)
to add LiftBot to another repo.</sub></details>
---
Was this a good recommendation?
[ [đ Not
relevant](https://www.sonatype.com/lift-comment-rating?comment=340737304&lift_comment_rating=1)
] - [ [đ Won't
fix](https://www.sonatype.com/lift-comment-rating?comment=340737304&lift_comment_rating=2)
] - [ [đ Not critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737304&lift_comment_rating=3)
] - [ [đ Critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737304&lift_comment_rating=4)
] - [ [đ Critical, fixing
now](https://www.sonatype.com/lift-comment-rating?comment=340737304&lift_comment_rating=5)
]
##########
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java:
##########
@@ -6103,88 +6032,39 @@ public static Object sum(Iterator<Object> self) {
return sum(self, null, true);
}
- /**
- * Sums the items in an array.
- * <pre class="groovyTestCase">assert (1+2+3+4 as byte) == ([1,2,3,4] as
byte[]).sum()</pre>
- *
- * @param self The array of values to add together
- * @return The sum of all of the items
- * @since 2.4.2
- */
+ @Deprecated
public static byte sum(byte[] self) {
- return sum(self, (byte) 0);
+ return ArrayGroovyMethods.sum(self);
}
- /**
- * Sums the items in an array.
- * <pre class="groovyTestCase">assert (1+2+3+4 as short) == ([1,2,3,4] as
short[]).sum()</pre>
- *
- * @param self The array of values to add together
- * @return The sum of all of the items
- * @since 2.4.2
- */
+ @Deprecated
public static short sum(short[] self) {
- return sum(self, (short) 0);
+ return ArrayGroovyMethods.sum(self);
}
- /**
- * Sums the items in an array.
- * <pre class="groovyTestCase">assert 1+2+3+4 == ([1,2,3,4] as
int[]).sum()</pre>
- *
- * @param self The array of values to add together
- * @return The sum of all of the items
- * @since 2.4.2
- */
+ @Deprecated
public static int sum(int[] self) {
- return sum(self, 0);
+ return ArrayGroovyMethods.sum(self);
}
- /**
- * Sums the items in an array.
- * <pre class="groovyTestCase">assert (1+2+3+4 as long) == ([1,2,3,4] as
long[]).sum()</pre>
- *
- * @param self The array of values to add together
- * @return The sum of all of the items
- * @since 2.4.2
- */
+ @Deprecated
public static long sum(long[] self) {
- return sum(self, 0);
+ return ArrayGroovyMethods.sum(self);
}
- /**
- * Sums the items in an array.
- * <pre class="groovyTestCase">assert (1+2+3+4 as char) == ([1,2,3,4] as
char[]).sum()</pre>
- *
- * @param self The array of values to add together
- * @return The sum of all of the items
- * @since 2.4.2
- */
+ @Deprecated
public static char sum(char[] self) {
- return sum(self, (char) 0);
+ return ArrayGroovyMethods.sum(self);
}
- /**
- * Sums the items in an array.
- * <pre class="groovyTestCase">assert (1+2+3+4 as float) == ([1,2,3,4] as
float[]).sum()</pre>
- *
- * @param self The array of values to add together
- * @return The sum of all of the items
- * @since 2.4.2
- */
+ @Deprecated
public static float sum(float[] self) {
- return sum(self, (float) 0);
+ return ArrayGroovyMethods.sum(self);
}
- /**
- * Sums the items in an array.
- * <pre class="groovyTestCase">assert (1+2+3+4 as double) == ([1,2,3,4] as
double[]).sum()</pre>
- *
- * @param self The array of values to add together
- * @return The sum of all of the items
- * @since 2.4.2
- */
+ @Deprecated
public static double sum(double[] self) {
Review Comment:
*[InlineMeSuggester](https://errorprone.info/bugpattern/InlineMeSuggester):*
This deprecated API looks inlineable. If you'd like the body of the API to be
inlined to its callers, please annotate it with @InlineMe.
---
```suggestion
@InlineMe(replacement = "ArrayGroovyMethods.sum(self)", imports =
"org.codehaus.groovy.runtime.ArrayGroovyMethods")
```
---
<details><summary><b>âšī¸ Learn about @sonatype-lift commands</b></summary>
You can reply with the following commands. For example, reply with
***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this
PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified
`file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see
its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new)
to add LiftBot to another repo.</sub></details>
---
Was this a good recommendation?
[ [đ Not
relevant](https://www.sonatype.com/lift-comment-rating?comment=340737319&lift_comment_rating=1)
] - [ [đ Won't
fix](https://www.sonatype.com/lift-comment-rating?comment=340737319&lift_comment_rating=2)
] - [ [đ Not critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737319&lift_comment_rating=3)
] - [ [đ Critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737319&lift_comment_rating=4)
] - [ [đ Critical, fixing
now](https://www.sonatype.com/lift-comment-rating?comment=340737319&lift_comment_rating=5)
]
##########
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java:
##########
@@ -6803,116 +6521,44 @@ public static <T> String join(T[] self, String
separator) {
return join(new ArrayIterator<>(self), separator);
}
- /**
- * Concatenates the string representation of each
- * items in this array, with the given String as a separator between each
- * item.
- *
- * @param self an array of boolean
- * @param separator a String separator
- * @return the joined String
- * @since 2.4.1
- */
+ @Deprecated
public static String join(boolean[] self, String separator) {
Review Comment:
*[InlineMeSuggester](https://errorprone.info/bugpattern/InlineMeSuggester):*
This deprecated API looks inlineable. If you'd like the body of the API to be
inlined to its callers, please annotate it with @InlineMe.
---
```suggestion
@InlineMe(replacement = "ArrayGroovyMethods.join(self, separator)",
imports = "org.codehaus.groovy.runtime.ArrayGroovyMethods")
```
---
<details><summary><b>âšī¸ Learn about @sonatype-lift commands</b></summary>
You can reply with the following commands. For example, reply with
***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this
PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified
`file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see
its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new)
to add LiftBot to another repo.</sub></details>
---
Was this a good recommendation?
[ [đ Not
relevant](https://www.sonatype.com/lift-comment-rating?comment=340737331&lift_comment_rating=1)
] - [ [đ Won't
fix](https://www.sonatype.com/lift-comment-rating?comment=340737331&lift_comment_rating=2)
] - [ [đ Not critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737331&lift_comment_rating=3)
] - [ [đ Critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737331&lift_comment_rating=4)
] - [ [đ Critical, fixing
now](https://www.sonatype.com/lift-comment-rating?comment=340737331&lift_comment_rating=5)
]
##########
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java:
##########
@@ -6103,88 +6032,39 @@ public static Object sum(Iterator<Object> self) {
return sum(self, null, true);
}
- /**
- * Sums the items in an array.
- * <pre class="groovyTestCase">assert (1+2+3+4 as byte) == ([1,2,3,4] as
byte[]).sum()</pre>
- *
- * @param self The array of values to add together
- * @return The sum of all of the items
- * @since 2.4.2
- */
+ @Deprecated
public static byte sum(byte[] self) {
Review Comment:
*[InlineMeSuggester](https://errorprone.info/bugpattern/InlineMeSuggester):*
This deprecated API looks inlineable. If you'd like the body of the API to be
inlined to its callers, please annotate it with @InlineMe.
---
```suggestion
@InlineMe(replacement = "ArrayGroovyMethods.sum(self)", imports =
"org.codehaus.groovy.runtime.ArrayGroovyMethods")
```
---
<details><summary><b>âšī¸ Learn about @sonatype-lift commands</b></summary>
You can reply with the following commands. For example, reply with
***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this
PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified
`file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see
its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new)
to add LiftBot to another repo.</sub></details>
---
Was this a good recommendation?
[ [đ Not
relevant](https://www.sonatype.com/lift-comment-rating?comment=340737355&lift_comment_rating=1)
] - [ [đ Won't
fix](https://www.sonatype.com/lift-comment-rating?comment=340737355&lift_comment_rating=2)
] - [ [đ Not critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737355&lift_comment_rating=3)
] - [ [đ Critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737355&lift_comment_rating=4)
] - [ [đ Critical, fixing
now](https://www.sonatype.com/lift-comment-rating?comment=340737355&lift_comment_rating=5)
]
##########
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java:
##########
@@ -11693,108 +11299,44 @@ public static boolean asBoolean(Object[] array) {
return array != null && array.length > 0;
}
- /**
- * Coerces a byte array to a boolean value.
- * A byte array is false if the array is of length 0,
- * and true otherwise.
- *
- * @param array an array
- * @return the array's boolean value
- * @since 1.7.4
- */
+ @Deprecated
public static boolean asBoolean(byte[] array) {
- return array != null && array.length > 0;
+ return ArrayGroovyMethods.asBoolean(array);
}
- /**
- * Coerces a short array to a boolean value.
- * A short array is false if the array is of length 0,
- * and true otherwise.
- *
- * @param array an array
- * @return the array's boolean value
- * @since 1.7.4
- */
+ @Deprecated
public static boolean asBoolean(short[] array) {
- return array != null && array.length > 0;
+ return ArrayGroovyMethods.asBoolean(array);
}
- /**
- * Coerces an int array to a boolean value.
- * An int array is false if the array is of length 0,
- * and true otherwise.
- *
- * @param array an array
- * @return the array's boolean value
- * @since 1.7.4
- */
+ @Deprecated
public static boolean asBoolean(int[] array) {
- return array != null && array.length > 0;
+ return ArrayGroovyMethods.asBoolean(array);
}
- /**
- * Coerces a long array to a boolean value.
- * A long array is false if the array is of length 0,
- * and true otherwise.
- *
- * @param array an array
- * @return the array's boolean value
- * @since 1.7.4
- */
+ @Deprecated
public static boolean asBoolean(long[] array) {
- return array != null && array.length > 0;
+ return ArrayGroovyMethods.asBoolean(array);
}
- /**
- * Coerces a float array to a boolean value.
- * A float array is false if the array is of length 0,
- * and true otherwise.
- *
- * @param array an array
- * @return the array's boolean value
- * @since 1.7.4
- */
+ @Deprecated
public static boolean asBoolean(float[] array) {
Review Comment:
*[InlineMeSuggester](https://errorprone.info/bugpattern/InlineMeSuggester):*
This deprecated API looks inlineable. If you'd like the body of the API to be
inlined to its callers, please annotate it with @InlineMe.
---
```suggestion
@InlineMe(replacement = "ArrayGroovyMethods.asBoolean(array)", imports =
"org.codehaus.groovy.runtime.ArrayGroovyMethods")
```
---
<details><summary><b>âšī¸ Learn about @sonatype-lift commands</b></summary>
You can reply with the following commands. For example, reply with
***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this
PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified
`file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see
its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new)
to add LiftBot to another repo.</sub></details>
---
Was this a good recommendation?
[ [đ Not
relevant](https://www.sonatype.com/lift-comment-rating?comment=340737357&lift_comment_rating=1)
] - [ [đ Won't
fix](https://www.sonatype.com/lift-comment-rating?comment=340737357&lift_comment_rating=2)
] - [ [đ Not critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737357&lift_comment_rating=3)
] - [ [đ Critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737357&lift_comment_rating=4)
] - [ [đ Critical, fixing
now](https://www.sonatype.com/lift-comment-rating?comment=340737357&lift_comment_rating=5)
]
##########
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java:
##########
@@ -6803,116 +6521,44 @@ public static <T> String join(T[] self, String
separator) {
return join(new ArrayIterator<>(self), separator);
}
- /**
- * Concatenates the string representation of each
- * items in this array, with the given String as a separator between each
- * item.
- *
- * @param self an array of boolean
- * @param separator a String separator
- * @return the joined String
- * @since 2.4.1
- */
+ @Deprecated
public static String join(boolean[] self, String separator) {
- return join(new BooleanArrayIterator(self), separator);
+ return ArrayGroovyMethods.join(self, separator);
}
- /**
- * Concatenates the string representation of each
- * items in this array, with the given String as a separator between each
- * item.
- *
- * @param self an array of byte
- * @param separator a String separator
- * @return the joined String
- * @since 2.4.1
- */
+ @Deprecated
public static String join(byte[] self, String separator) {
- return join(new ByteArrayIterator(self), separator);
+ return ArrayGroovyMethods.join(self, separator);
}
- /**
- * Concatenates the string representation of each
- * items in this array, with the given String as a separator between each
- * item.
- *
- * @param self an array of char
- * @param separator a String separator
- * @return the joined String
- * @since 2.4.1
- */
+ @Deprecated
public static String join(char[] self, String separator) {
- return join(new CharArrayIterator(self), separator);
+ return ArrayGroovyMethods.join(self, separator);
}
- /**
- * Concatenates the string representation of each
- * items in this array, with the given String as a separator between each
- * item.
- *
- * @param self an array of double
- * @param separator a String separator
- * @return the joined String
- * @since 2.4.1
- */
+ @Deprecated
public static String join(double[] self, String separator) {
- return join(new DoubleArrayIterator(self), separator);
+ return ArrayGroovyMethods.join(self, separator);
}
- /**
- * Concatenates the string representation of each
- * items in this array, with the given String as a separator between each
- * item.
- *
- * @param self an array of float
- * @param separator a String separator
- * @return the joined String
- * @since 2.4.1
- */
+ @Deprecated
public static String join(float[] self, String separator) {
- return join(new FloatArrayIterator(self), separator);
+ return ArrayGroovyMethods.join(self, separator);
}
- /**
- * Concatenates the string representation of each
- * items in this array, with the given String as a separator between each
- * item.
- *
- * @param self an array of int
- * @param separator a String separator
- * @return the joined String
- * @since 2.4.1
- */
+ @Deprecated
public static String join(int[] self, String separator) {
- return join(new IntArrayIterator(self), separator);
+ return ArrayGroovyMethods.join(self, separator);
}
- /**
- * Concatenates the string representation of each
- * items in this array, with the given String as a separator between each
- * item.
- *
- * @param self an array of long
- * @param separator a String separator
- * @return the joined String
- * @since 2.4.1
- */
+ @Deprecated
public static String join(long[] self, String separator) {
Review Comment:
*[InlineMeSuggester](https://errorprone.info/bugpattern/InlineMeSuggester):*
This deprecated API looks inlineable. If you'd like the body of the API to be
inlined to its callers, please annotate it with @InlineMe.
---
```suggestion
@InlineMe(replacement = "ArrayGroovyMethods.join(self, separator)",
imports = "org.codehaus.groovy.runtime.ArrayGroovyMethods")
```
---
<details><summary><b>âšī¸ Learn about @sonatype-lift commands</b></summary>
You can reply with the following commands. For example, reply with
***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this
PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified
`file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see
its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new)
to add LiftBot to another repo.</sub></details>
---
Was this a good recommendation?
[ [đ Not
relevant](https://www.sonatype.com/lift-comment-rating?comment=340737370&lift_comment_rating=1)
] - [ [đ Won't
fix](https://www.sonatype.com/lift-comment-rating?comment=340737370&lift_comment_rating=2)
] - [ [đ Not critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737370&lift_comment_rating=3)
] - [ [đ Critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=340737370&lift_comment_rating=4)
] - [ [đ Critical, fixing
now](https://www.sonatype.com/lift-comment-rating?comment=340737370&lift_comment_rating=5)
]
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]