From b73102513e345e42515b04d1e9af4e3b75484534 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Fri, 10 May 2024 22:04:46 +0200 Subject: [PATCH] make all T params final in User in java --- lab3/zad2/app/src/main/java/pl/jacekpoz/User.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lab3/zad2/app/src/main/java/pl/jacekpoz/User.java b/lab3/zad2/app/src/main/java/pl/jacekpoz/User.java index 54dd073..7168309 100644 --- a/lab3/zad2/app/src/main/java/pl/jacekpoz/User.java +++ b/lab3/zad2/app/src/main/java/pl/jacekpoz/User.java @@ -19,18 +19,18 @@ public class User> { return this.dh.power(dh.getGenerator(), this.secret); } - public void setKey(T a) { + public void setKey(final T a) { this.key = this.dh.power(a, this.secret); } - public T encrypt(T m) throws IllegalArgumentException { + public T encrypt(final T m) throws IllegalArgumentException { if (this.key.isZero()) { throw new IllegalArgumentException("key must be set before encrypting"); } return (T) m.multiply(this.key); } - public T decrypt(T c) throws IllegalArgumentException { + public T decrypt(final T c) throws IllegalArgumentException { if (this.key.isZero()) { throw new IllegalArgumentException("key must be set before decrypting"); }