From 59fc1ad596e4dd6621afd11d925186b9d91274ba Mon Sep 17 00:00:00 2001 From: Rhinemann Date: Wed, 21 Jun 2023 00:35:08 +0300 Subject: [PATCH] Some IntelliJ auto stuff. --- Java/lab_2/lab_2.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Java/lab_2/lab_2.java b/Java/lab_2/lab_2.java index 4a97358..6627f16 100644 --- a/Java/lab_2/lab_2.java +++ b/Java/lab_2/lab_2.java @@ -1,5 +1,8 @@ package OOP.Java.lab_2; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; + import java.util.Scanner; public class lab_2 { @@ -23,13 +26,15 @@ public class lab_2 { return read_variable; } + @NotNull public static String format(int number) { int width = String.valueOf(number).length() + 1; return "|%" + width + "d "; } - public static double average(short[] row) { + @Contract(pure = true) + public static double average(@NotNull short[] row) { short sum = 0; for (short element : row) {