From bc94466cf7568bc20a56c350b10a9aacc8f1a85e Mon Sep 17 00:00:00 2001 From: jendib Date: Thu, 5 May 2016 22:16:04 +0200 Subject: [PATCH] Entropy source for Travis --- .travis.yml | 1 + .../java/com/sismics/util/filter/RequestContextFilter.java | 2 +- .../java/com/sismics/docs/rest/resource/UserResource.java | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1b199113..80b3fd10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ language: java before_install: - sudo apt-get -qq update - sudo apt-get -y -q install tesseract-ocr tesseract-ocr-fra tesseract-ocr-jpn + - sudo apt-get install haveged && sudo service haveged start env: global: - TESSDATA_PREFIX=/usr/share/tesseract-ocr diff --git a/docs-web-common/src/main/java/com/sismics/util/filter/RequestContextFilter.java b/docs-web-common/src/main/java/com/sismics/util/filter/RequestContextFilter.java index f3eff148..6acdef32 100644 --- a/docs-web-common/src/main/java/com/sismics/util/filter/RequestContextFilter.java +++ b/docs-web-common/src/main/java/com/sismics/util/filter/RequestContextFilter.java @@ -80,7 +80,7 @@ public class RequestContextFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { - EntityManager em = null; + EntityManager em; try { em = EMF.get().createEntityManager(); diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/UserResource.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/UserResource.java index 1c12c419..433812ec 100644 --- a/docs-web/src/main/java/com/sismics/docs/rest/resource/UserResource.java +++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/UserResource.java @@ -99,7 +99,7 @@ public class UserResource extends BaseResource { user.setPassword(password); user.setEmail(email); user.setStorageQuota(storageQuota); - user.setStorageCurrent(0l); + user.setStorageCurrent(0L); try { user.setPrivateKey(EncryptionUtil.generatePrivateKey()); } catch (NoSuchAlgorithmException e) { @@ -678,7 +678,7 @@ public class UserResource extends BaseResource { UserDao userDao = new UserDao(); User user = userDao.getActiveByUsername(principal.getName()); user.setTotpKey(key.getKey()); - user = userDao.update(user, principal.getId()); + userDao.update(user, principal.getId()); JsonObjectBuilder response = Json.createObjectBuilder() .add("secret", key.getKey());