0

this is a part of my code :

public static final int HAUTE_IMPORTANCE = 1;
public static final int MOYENNE_IMPORTANCE = 2;
public static final int FAIBLE_IMPORTANCE = 3;


private static int dernierIdAttribue = 0; 


private Date dateCreation = Date.dateDuJour();
private Date dateLimite; 
private String description;
private int niveauImportance;
private boolean acheve;
private int id;

public Todo (String description, Date dateLimite) throws TodoInvalideException{

    if ( dateLimite == null||dateCreation.estEgale(dateLimite) ||!dateCreation.estPlusRecente(dateLimite) && description != null && !description.isEmpty()){
    this.description = description;                      
    this.dateLimite = null;
    this.niveauImportance = FAIBLE_IMPORTANCE;
    acheve = false;
    dernierIdAttribue++;
    id = dernierIdAttribue;            

    } else{
        throw new TodoInvalideException("Erreur constructeur2");  

estPLusRecente & estEgale are 2 class method in class Date.

Jim Garrison
  • 85,615
  • 20
  • 155
  • 190
maro
  • 9
  • 2
  • Shouldn't you use `try-catch`? – Ian Apr 15 '16 at 06:05
  • 1
    Possible duplicate of [Unreported exception java.sql.SQLException; must be caught or declared to be thrown?](http://stackoverflow.com/questions/4457352/unreported-exception-java-sql-sqlexception-must-be-caught-or-declared-to-be-thr) – Savior Apr 15 '16 at 06:06
  • probably one of the date methods `estEgale(..)` or `estPlusRecente(..)` is throwing a exception that should either be catched or included in the throws part of your method. – uniknow Apr 15 '16 at 06:33
  • is true, that was the problem thanks a lot friend . #uniknow – maro Apr 17 '16 at 06:45

0 Answers0