Fix `unexpected token: &&` and missing parenthesis Upon loading of the plugin Gerrit was throwing an excepion because the && operator is not handled correctly in some cases when it starts a new line. [1] The logic to find all active accounts also has been fixed by adding a parenthesis that was missing when checking if the user `isServiceUser` before adding it to the internal cache. This prevented the loading of the plugin, introduced in change 424058. [1]: https://issues.apache.org/jira/browse/GROOVY-7218 Bug: Issue 370792796 Change-Id: I88f2cf40aa6658c0a91e35f21bbadd49ffcddcfe
diff --git a/admin/track-and-disable-inactive-users-1.2.groovy b/admin/track-and-disable-inactive-users-1.3.groovy similarity index 96% rename from admin/track-and-disable-inactive-users-1.2.groovy rename to admin/track-and-disable-inactive-users-1.3.groovy index 68ebb43..f1d9b49 100644 --- a/admin/track-and-disable-inactive-users-1.2.groovy +++ b/admin/track-and-disable-inactive-users-1.3.groovy
@@ -188,9 +188,7 @@ def currentMinutes = MILLISECONDS.toMinutes(System.currentTimeMillis()) accounts.all() .findAll { - it.account().isActive() - && !serviceUserClassifier.isServiceUser(it.account().id() - && !trackActiveUsersCache.getIfPresent(it.account().id().get()) + it.account().isActive() && !serviceUserClassifier.isServiceUser(it.account().id()) && !trackActiveUsersCache.getIfPresent(it.account().id().get()) } .each { trackActiveUsersCache.put(it.account().id().get(), currentMinutes) } }