From fda8623e6db3c12d350f9e98fe56f4766642a6f7 Mon Sep 17 00:00:00 2001 From: TiagoRG <35657250+TiagoRG@users.noreply.github.com> Date: Tue, 7 Mar 2023 11:53:37 +0000 Subject: [PATCH] [POO] Removed unnecessary parenthesis --- 1ano/2semestre/poo/src/aula04/Shapes.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/1ano/2semestre/poo/src/aula04/Shapes.java b/1ano/2semestre/poo/src/aula04/Shapes.java index e35f54e..e37cf6d 100644 --- a/1ano/2semestre/poo/src/aula04/Shapes.java +++ b/1ano/2semestre/poo/src/aula04/Shapes.java @@ -45,9 +45,9 @@ class Triangle { public Triangle(double side1, double side2, double side3) { assert side1 > 0 && side2 > 0 && side3 > 0; - if((Math.abs(side2 - side3) < side1 || side1 < side2 + side3 + if(Math.abs(side2 - side3) < side1 || side1 < side2 + side3 || Math.abs(side1 - side3) < side2 || side2 < side1 + side3 - || Math.abs(side1 - side2) < side3 || side3 < side1 + side2)) + || Math.abs(side1 - side2) < side3 || side3 < side1 + side2) throw new IllegalArgumentException("Triangle cannot be created with those sides."); this.side1 = side1; this.side2 = side2; @@ -60,9 +60,9 @@ class Triangle { public void setSides(double side1, double side2, double side3) { assert side1 > 0 && side2 > 0 && side3 > 0; - if((Math.abs(side2 - side3) < side1 || side1 < side2 + side3 + if(Math.abs(side2 - side3) < side1 || side1 < side2 + side3 || Math.abs(side1 - side3) < side2 || side2 < side1 + side3 - || Math.abs(side1 - side2) < side3 || side3 < side1 + side2)) + || Math.abs(side1 - side2) < side3 || side3 < side1 + side2) throw new IllegalArgumentException("Triangle cannot be created with those sides."); this.side1 = side1; this.side2 = side2;