請教jive的一處程式碼

gen21發表於2007-10-08
com.jivesoftware.forum.database.DbForum.setName(String name):
public void setName(String name) throws ForumAlreadyExistsException {

if (this.name.equals(name)) {
return;
}

try {
if (!this.name.toLowerCase().equals(name.toLowerCase()))
{
Forum forum = factory.getForum(name);
throw new ForumAlreadyExistsException();
}
}catch (ForumNotFoundException e) { }

factory.cacheManager.forumCache.remove(id);

this.name = name;
saveToDb();

factory.cacheManager.forumCache.remove(id);
}
程式碼中 Forum forum = factory.getForum(name);
factory.cacheManager.forumCache.remove(id);
這兩個地方用意是什麼?(我的問題可能幼稚,確實看了很久沒理清。)

相關文章