contrib/jwrapper: minor style update in model
authorAlexis Laferrière <alexis.laf@xymus.net>
Mon, 20 Jul 2015 02:45:11 +0000 (22:45 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 20 Jul 2015 21:34:48 +0000 (17:34 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/jwrapper/src/model.nit

index 6ebe954..d57cf6a 100644 (file)
@@ -84,8 +84,6 @@ class JavaType
                return nit_type
        end
 
-       fun is_iterable: Bool do return iterable.has(self.id)
-
        fun is_collection: Bool do return is_primitive_array or collections_list.has(self.id)
 
        fun is_wrapped: Bool do return find_extern_class != null
@@ -116,22 +114,15 @@ class JavaType
                return converter.cast_as_return(jtype)
        end
 
-       redef fun to_s: String
+       redef fun to_s
        do
                var id = self.full_id
 
                if self.is_primitive_array then
-                       for i in [0..array_dimension[ do
-                               id += "[]"
-                       end
+                       id += "[]" * array_dimension
                else if self.has_generic_params then
-                       var gen_list = new Array[String]
-
-                       for param in generic_params do
-                               gen_list.add(param.to_s)
-                       end
-
-                       id += "<{gen_list.join(", ")}>"
+                       var params = [for param in generic_params do param.to_s]
+                       id += "<{params.join(", ")}>"
                end
 
                return id