File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/main/java/net/discordjug/javabot/systems/staff_commands/forms/model Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 11package net .discordjug .javabot .systems .staff_commands .forms .model ;
22
33import java .time .Instant ;
4+ import java .util .ArrayList ;
5+ import java .util .Collections ;
46import java .util .Date ;
57import java .util .List ;
68import java .util .Objects ;
@@ -54,15 +56,16 @@ public boolean isAttached() {
5456 /**
5557 * Creates text components for use in the submission modal.
5658 *
57- * @return List of layout components for use in the submission modal.
59+ * @return An unmodifiable list of layout components for use in the submission
60+ * modal.
5861 */
59- public Label [] createComponents () {
60- Label [] array = new Label [ fields .size ()] ;
61- for (int i = 0 ; i < array . length ; i ++) {
62+ public List < Label > createComponents () {
63+ List < Label > list = new ArrayList <>( fields .size ()) ;
64+ for (int i = 0 ; i < list . size () ; i ++) {
6265 FormField field = fields .get (i );
63- array [ i ] = Label .of (fields .get (i ).label (), field .createTextInput ("text" + i ));
66+ list . add ( Label .of (fields .get (i ).label (), field .createTextInput ("text" + i ) ));
6467 }
65- return array ;
68+ return Collections . unmodifiableList ( list ) ;
6669 }
6770
6871 /**
You can’t perform that action at this time.
0 commit comments