From bfe15f794aa1d716e15260f071790bf59c4a40f5 Mon Sep 17 00:00:00 2001 From: anhefti Date: Thu, 9 Jun 2022 14:37:47 +0200 Subject: [PATCH] code cleanup --- .../webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java | 2 +- .../webservice/servicelayer/lms/impl/LmsAPIServiceImpl.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java index 4a69787c..8f11855d 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/LmsSetupDAOImpl.java @@ -159,7 +159,7 @@ public class LmsSetupDAOImpl implements LmsSetupDAO { } return lmsSetup.updateTime.equals(record.getUpdateTime()); } catch (final Exception e) { - log.error("Failed to check snyc on LmsSetup: {}", lmsSetup); + log.error("Failed to check sync on LmsSetup: {}", lmsSetup); return false; } } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/LmsAPIServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/LmsAPIServiceImpl.java index cc20ce79..8fa65052 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/LmsAPIServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/LmsAPIServiceImpl.java @@ -93,8 +93,9 @@ public class LmsAPIServiceImpl implements LmsAPIService { log.debug("LmsSetup changed. Update cache by removing eventually used references"); } - final LmsAPITemplate removedTemplate = this.cache - .remove(new CacheKey(lmsSetup.getModelId(), 0)); + final LmsAPITemplate removedTemplate = this.cache.remove( + new CacheKey(lmsSetup.getModelId(), 0)); + if (removedTemplate != null) { removedTemplate.clearCourseCache(); }