Repository: commons-text
Updated Branches:
  refs/heads/master cdd0ee23e -> 8010b3b19


StrBuilder#appendAll: suppress warning about vararg usage


Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/8010b3b1
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/8010b3b1
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/8010b3b1

Branch: refs/heads/master
Commit: 8010b3b19a5503fbf5f7080fc2ffbc505760209e
Parents: cdd0ee2
Author: Pascal Schumacher <pascalschumac...@gmx.net>
Authored: Sun Dec 18 12:23:46 2016 +0100
Committer: Pascal Schumacher <pascalschumac...@gmx.net>
Committed: Sun Dec 18 12:23:46 2016 +0100

----------------------------------------------------------------------
 src/main/java/org/apache/commons/text/StrBuilder.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/8010b3b1/src/main/java/org/apache/commons/text/StrBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/StrBuilder.java 
b/src/main/java/org/apache/commons/text/StrBuilder.java
index daf15b2..280066c 100644
--- a/src/main/java/org/apache/commons/text/StrBuilder.java
+++ b/src/main/java/org/apache/commons/text/StrBuilder.java
@@ -1152,7 +1152,13 @@ public class StrBuilder implements CharSequence, 
Appendable, Serializable, Build
      * @param array  the array to append
      * @return this, to enable chaining
      */
-    public <T> StrBuilder appendAll(final T... array) {
+    public <T> StrBuilder appendAll(@SuppressWarnings("unchecked") final T... 
array) {
+        /*
+         * @SuppressWarnings used to hide warning about vararg usage. We cannot
+         * use @SafeVarargs, since this method is not final. Using 
@SupressWarnings
+         * is fine, because it isn't inherited by subclasses, so each subclass 
must
+         * vouch for itself whether its use of 'array' is safe.
+         */
         if (array != null && array.length > 0) {
             for (final Object element : array) {
                 append(element);

Reply via email to