Inline low-value list concatenation method.
diff --git a/src/main/java/com/squareup/kotlinpoet/ArrayTypeName.kt b/src/main/java/com/squareup/kotlinpoet/ArrayTypeName.kt
index e034665..ff3c475 100644
--- a/src/main/java/com/squareup/kotlinpoet/ArrayTypeName.kt
+++ b/src/main/java/com/squareup/kotlinpoet/ArrayTypeName.kt
@@ -28,7 +28,7 @@
annotations: List<AnnotationSpec> = ArrayList<AnnotationSpec>()) : TypeName(annotations) {
override fun annotated(annotations: List<AnnotationSpec>): ArrayTypeName {
- return ArrayTypeName(componentType, concatAnnotations(annotations))
+ return ArrayTypeName(componentType, this.annotations + annotations)
}
override fun withoutAnnotations(): TypeName {
diff --git a/src/main/java/com/squareup/kotlinpoet/ClassName.kt b/src/main/java/com/squareup/kotlinpoet/ClassName.kt
index a5da17f..bc01211 100644
--- a/src/main/java/com/squareup/kotlinpoet/ClassName.kt
+++ b/src/main/java/com/squareup/kotlinpoet/ClassName.kt
@@ -46,7 +46,7 @@
}
override fun annotated(annotations: List<AnnotationSpec>)
- = ClassName(names, concatAnnotations(annotations))
+ = ClassName(names, this.annotations + annotations)
override fun withoutAnnotations() = ClassName(names)
diff --git a/src/main/java/com/squareup/kotlinpoet/ParameterizedTypeName.kt b/src/main/java/com/squareup/kotlinpoet/ParameterizedTypeName.kt
index 21d148d..df26b60 100644
--- a/src/main/java/com/squareup/kotlinpoet/ParameterizedTypeName.kt
+++ b/src/main/java/com/squareup/kotlinpoet/ParameterizedTypeName.kt
@@ -40,7 +40,7 @@
}
override fun annotated(annotations: List<AnnotationSpec>)
- = ParameterizedTypeName(enclosingType, rawType, typeArguments, concatAnnotations(annotations))
+ = ParameterizedTypeName(enclosingType, rawType, typeArguments, this.annotations + annotations)
override fun withoutAnnotations()
= ParameterizedTypeName(enclosingType, rawType, typeArguments, ArrayList<AnnotationSpec>())
diff --git a/src/main/java/com/squareup/kotlinpoet/TypeName.kt b/src/main/java/com/squareup/kotlinpoet/TypeName.kt
index e6687c1..4109c96 100644
--- a/src/main/java/com/squareup/kotlinpoet/TypeName.kt
+++ b/src/main/java/com/squareup/kotlinpoet/TypeName.kt
@@ -81,10 +81,6 @@
abstract fun withoutAnnotations(): TypeName
- protected fun concatAnnotations(annotations: List<AnnotationSpec>): List<AnnotationSpec> {
- return this.annotations + annotations
- }
-
val isAnnotated: Boolean
get() = !annotations.isEmpty()
diff --git a/src/main/java/com/squareup/kotlinpoet/WildcardTypeName.kt b/src/main/java/com/squareup/kotlinpoet/WildcardTypeName.kt
index a4c6939..7cf5ce3 100644
--- a/src/main/java/com/squareup/kotlinpoet/WildcardTypeName.kt
+++ b/src/main/java/com/squareup/kotlinpoet/WildcardTypeName.kt
@@ -36,7 +36,7 @@
}
override fun annotated(annotations: List<AnnotationSpec>): WildcardTypeName {
- return WildcardTypeName(upperBounds, lowerBounds, concatAnnotations(annotations))
+ return WildcardTypeName(upperBounds, lowerBounds, this.annotations + annotations)
}
override fun withoutAnnotations(): TypeName {