[Suiviobsmer-commits] r479 - in trunk/wao-business/src/main: filters java/fr/ifremer/wao/service
Author: fdesbois Date: 2010-05-06 11:56:07 +0000 (Thu, 06 May 2010) New Revision: 479 Log: Improve equals in ActivityCalendar import + add last version in properties file Modified: trunk/wao-business/src/main/filters/Wao.properties trunk/wao-business/src/main/java/fr/ifremer/wao/service/ActivityCalendarImport.java Modified: trunk/wao-business/src/main/filters/Wao.properties =================================================================== --- trunk/wao-business/src/main/filters/Wao.properties 2010-05-04 12:29:11 UTC (rev 478) +++ trunk/wao-business/src/main/filters/Wao.properties 2010-05-06 11:56:07 UTC (rev 479) @@ -48,4 +48,4 @@ wao.server.path=localhost:8080/wao ## Version (not necessary to override it) -wao.version=1.2 \ No newline at end of file +wao.version=1.2.1 \ No newline at end of file Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ActivityCalendarImport.java =================================================================== --- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ActivityCalendarImport.java 2010-05-04 12:29:11 UTC (rev 478) +++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ActivityCalendarImport.java 2010-05-06 11:56:07 UTC (rev 479) @@ -105,9 +105,16 @@ @Override public boolean equals(Object key) { - if (!ActivityCalendarKey.class.isAssignableFrom(key.getClass())) { - throw new ClassCastException("Unable to cast object " + key.getClass() + " to " + this.getClass().getName()); + if (key == this) { + return true; } +// if (!ActivityCalendarKey.class.isAssignableFrom(key.getClass())) { +// throw new ClassCastException("Unable to cast object " + +// key.getClass() + " to " + this.getClass().getName()); +// } + if (! (key instanceof ActivityCalendarKey)) { + return false; + } ActivityCalendarKey calendarKey = (ActivityCalendarKey)key; return year == calendarKey.year() && boatId.equals(calendarKey.boatId()); }
participants (1)
-
fdesbois@users.labs.libre-entreprise.org