elveos

elveos Commit Details

Date:2011-05-03 20:36:39 (2 years 14 days ago)
Author:Frédéric Bertolus
Branch:
Commit:e9f0ecadd0cdc9066735abbdd076790f48199d2b
Parents: 15f81a98f7d7f41c73d527e319390afabaa5cde3
4663b14fe20be76e65afc3b8b3ee7b2282d5cedf
Message:Merge branch 'master' of gitorious.org:bloatit/bloatit

diff --cc main/src/main/java/com/bloatit/model/MoneyWithdrawal.java
index d4cfb0d,50cdf1a..3d812ff
--- a/main/src/main/java/com/bloatit/model/MoneyWithdrawal.java
+++ b/main/src/main/java/com/bloatit/model/MoneyWithdrawal.java
@@@ -146,8 -172,9 +172,9 @@@ public class MoneyWithdrawal extends Id

/**
* Proxy to the various methods to change the state
- *
+ *
* @param newState the new state of the withdrawal
+ * @throws UnauthorizedPrivateAccessException
* @throws BadProgrammerException whenever <code>newState</code> is not
* compatible with current withdrawal state.
*/
@@@ -260,11 -359,13 +359,18 @@@
extendedIban.append(Character.digit(currentChar, Character.MAX_RADIX));
}

- return new BigDecimal(extendedIban.toString()).remainder(ibanCheckingConstant).intValue() == 1;
+ try {
+ return new BigDecimal(extendedIban.toString()).remainder(ibanCheckingConstant).intValue() == 1;
+ } catch (NumberFormatException e) {
+ return false;
+ }
+
}
+
+ /**
+ * @return a random string to use as reference to the team
+ */
+ private static String generateReference() {
+ return RandomStringUtils.randomAlphanumeric(4) + "-" + RandomStringUtils.randomAlphanumeric(10);
+ }
}