Skip to content
Snippets Groups Projects
Commit 8d119127 authored by Samuel Turpin's avatar Samuel Turpin :computer:
Browse files

pmd Fixes

parent 11aaf2ff
No related branches found
No related tags found
No related merge requests found
......@@ -45,9 +45,9 @@ public class Ex1
}
public static void main(String[] args) {
int k;
try {
k = 1/Integer.parseInt(args[0]);
int k = 1/Integer.parseInt(args[0]);
System.out.println(k);
}
catch(ArrayIndexOutOfBoundsException e) {System.err.println("Index " + e);}
catch(ArithmeticException e) {System.err.println("Arithmetic " + "");}
......
......@@ -5,7 +5,6 @@ import tpOO.tp04.PendingCase;
public class PendingCaseQueue
{
public static int CAPACITY = 10;
private int idx;
private PendingCase[] tableur;
public PendingCaseQueue()
......@@ -58,11 +57,11 @@ public class PendingCaseQueue
public double getTotalAmount()
{
double db = 0.0;
for(int i = 0; i < this.tableur.length; i++)
for(PendingCase c : this.tableur)
{
if(this.tableur[i] != null)
if(c != null)
{
db = db + this.tableur[i].getAmount();
db = db + c.getAmount();
}
}
return db;
......@@ -87,9 +86,9 @@ public class PendingCaseQueue
public boolean isEmpty()
{
int compteur = 0;
for(int i = 0; i < this.tableur.length; i++)
for(PendingCase c : this.tableur)
{
if(this.tableur[i] == null)
if(c == null)
{
compteur = compteur + 1;
}
......@@ -105,9 +104,9 @@ public class PendingCaseQueue
public boolean isFull()
{
int compteur = 0;
for(int i = 0; i < this.tableur.length; i++)
for(PendingCase c : this.tableur)
{
if(this.tableur[i] != null)
if(c != null)
{
compteur = compteur + 1;
}
......
......@@ -58,6 +58,10 @@ public class Car
return purchasePrice;
}
public double getSalePrice() {
return salePrice;
}
public void setSalePrice(double salePrice)
{
this.salePrice = salePrice;
......
......@@ -2,10 +2,11 @@ package tp06;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
public class Company
{
public static final ArrayList<Employee> EMPLOYEES = new ArrayList<>();
public static final List<Employee> EMPLOYEES = new ArrayList<>();
public void addEmployee(Employee e)
{
......@@ -27,7 +28,7 @@ public class Company
return EMPLOYEES.size();
}
private int getNumbClass(Class c)
private int getNumbClass(Object c)
{
int nb = 0;
......
......@@ -12,6 +12,14 @@ public class TravellingSalesperson extends Salesperson
super(n, ld, t);
}
public static double getPourcentage() {
return POURCENTAGE;
}
public static int getBonus() {
return BONUS;
}
@Override
public String getTitle()
{
......
......@@ -12,6 +12,14 @@ public class Vendor extends Salesperson
super(n, ld, t);
}
public static double getPourcentage() {
return POURCENTAGE;
}
public static int getBonus() {
return BONUS;
}
@Override
public String getTitle()
{
......
package tp09;
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
}
}
\ No newline at end of file
......@@ -5,7 +5,6 @@ public class WrongLoginException extends Exception
@Override
public synchronized Throwable initCause(Throwable cause)
{
return super.initCause(cause);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment