From 2a8a74bedafdb56b7e7edcb42642dc1eb5e54fff Mon Sep 17 00:00:00 2001
From: saheba <mail@saheba.net>
Date: Mon, 25 Mar 2013 16:34:45 -0400
Subject: [PATCH] code cleanup
---
src/com/gitblit/ConfigUserService.java | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/com/gitblit/ConfigUserService.java b/src/com/gitblit/ConfigUserService.java
index 068bbe3..7aa0998 100644
--- a/src/com/gitblit/ConfigUserService.java
+++ b/src/com/gitblit/ConfigUserService.java
@@ -20,6 +20,7 @@
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -286,7 +287,7 @@
* @since 1.2.0
*/
@Override
- public boolean updateUserModels(List<UserModel> models) {
+ public boolean updateUserModels(Collection<UserModel> models) {
try {
read();
for (UserModel model : models) {
@@ -409,6 +410,10 @@
// Read realm file
read();
UserModel model = users.remove(username.toLowerCase());
+ if (model == null) {
+ // user does not exist
+ return false;
+ }
// remove user from team
for (TeamModel team : model.teams) {
TeamModel t = teams.get(team.name);
@@ -562,7 +567,7 @@
* @since 1.2.0
*/
@Override
- public boolean updateTeamModels(List<TeamModel> models) {
+ public boolean updateTeamModels(Collection<TeamModel> models) {
try {
read();
for (TeamModel team : models) {
@@ -804,7 +809,6 @@
/**
* Writes the properties file.
*
- * @param properties
* @throws IOException
*/
private synchronized void write() throws IOException {
--
Gitblit v1.9.1