Skip to content
Snippets Groups Projects
Commit 3e66a161 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Fix style of blocks reported by Checkstyle

parent ab215208
Branches
Tags
No related merge requests found
......@@ -75,12 +75,10 @@ public class MotdController extends AbstractController {
if (adminview) {
if (sessionkey.equals("null")) {
motds = motdService.getAdminMotds();
}
else {
} else {
motds = motdService.getAllSessionMotds(sessionkey);
}
}
else {
} else {
motds = motdService.getCurrentMotds(client, audience, sessionkey);
}
return motds;
......@@ -101,8 +99,7 @@ public class MotdController extends AbstractController {
Motd newMotd = new Motd();
if (motd.getAudience().equals("session") && motd.getSessionkey() != null) {
newMotd = motdService.saveSessionMotd(motd.getSessionkey(), motd);
}
else {
} else {
newMotd = motdService.saveMotd(motd);
}
if (newMotd == null) {
......@@ -110,8 +107,7 @@ public class MotdController extends AbstractController {
return null;
}
return newMotd;
}
else {
} else {
response.setStatus(HttpStatus.SERVICE_UNAVAILABLE.value());
return null;
}
......@@ -125,8 +121,7 @@ public class MotdController extends AbstractController {
) {
if (motd.getAudience().equals("session") && motd.getSessionkey() != null) {
return motdService.updateSessionMotd(motd.getSessionkey(), motd);
}
else {
} else {
return motdService.updateMotd(motd);
}
}
......@@ -137,8 +132,7 @@ public class MotdController extends AbstractController {
Motd motd = motdService.getMotd(motdkey);
if (motd.getAudience().equals("session")) {
motdService.deleteSessionMotd(motd.getSessionkey(), motd);
}
else {
} else {
motdService.deleteMotd(motd);
}
}
......
......@@ -2193,8 +2193,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware
String viewString = "";
if ("lecture".equals(questionVariant)) {
viewString = "skill_question/lecture_question_subjects_by_session";
}
else {
} else {
viewString = "skill_question/preparation_question_subjects_by_session";
}
NovaView view = new NovaView(viewString);
......@@ -2221,8 +2220,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware
String viewString = "";
if ("lecture".equals(questionVariant)) {
viewString = "skill_question/lecture_question_ids_by_session_and_subject";
}
else {
} else {
viewString = "skill_question/preparation_question_ids_by_session_and_subject";
}
NovaView view = new NovaView(viewString);
......@@ -2249,8 +2247,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware
String viewString = "";
if ("preparation".equals(questionVariant)) {
viewString = "sort_order/preparation_question_sort_order_by_sessionid_and_subject";
}
else if ("lecture".equals(questionVariant)) {
} else if ("lecture".equals(questionVariant)) {
viewString = "sort_order/lecture_question_sort_order_by_sessionid_and_subject";
}
......
......@@ -250,8 +250,12 @@ public class Answer {
@Override
public boolean equals(Object obj) {
// auto generated!
if (this == obj) return true;
if (obj == null) return false;
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
......
......@@ -567,8 +567,12 @@ public class Question implements Serializable {
@Override
public boolean equals(Object obj) {
// auto generated!
if (this == obj) return true;
if (obj == null) return false;
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
......
......@@ -206,8 +206,12 @@ public class SessionInfo {
@Override
public boolean equals(Object obj) {
// auto generated!
if (this == obj) return true;
if (obj == null) return false;
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
......
......@@ -99,16 +99,16 @@ public class MotdService implements IMotdService {
List<Motd> returns = new ArrayList<Motd>();
HashSet<String> keys = new HashSet(500); // Or a more realistic size
StringTokenizer st = new StringTokenizer(motdlist.getMotdkeys(), ",");
while (st.hasMoreTokens())
keys.add(st.nextToken());
while (st.hasMoreTokens()) {
keys.add(st.nextToken());
}
for (Motd motd : list) {
if (!keys.contains(motd.getMotdkey())) {
returns.add(motd);
}
}
return returns;
}
else {
} else {
return list;
}
}
......
......@@ -145,12 +145,10 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis
newQSortOrder.setSortOrder(s);
databaseDao.createOrUpdateSortOrder(newQSortOrder);
addToSortOrder(subjectSortOrder, question.getSubject());
}
else {
} else {
addToSortOrder(questionSortOrder, question.get_id());
}
}
else {
} else {
createSortOrder(session, question.getQuestionVariant(), "");
}
......@@ -1143,12 +1141,10 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis
subjectSortOrder.setSortOrder(tempSubSort);
if (subjectSortOrder.getSortOrder().isEmpty()) {
databaseDao.deleteSortOrder(subjectSortOrder);
}
else {
} else {
databaseDao.createOrUpdateSortOrder(subjectSortOrder);
}
}
else {
} else {
databaseDao.createOrUpdateSortOrder(sortOrder);
}
}
......@@ -1213,8 +1209,7 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis
createSortOrder(session, questionVariant, sub);
}
return databaseDao.createOrUpdateSortOrder(subjectSortOrder);
}
else {
} else {
SortOrder sortOrder = new SortOrder();
sortOrder.setSessionId(session.get_id());
sortOrder.setSubject(subject);
......@@ -1238,8 +1233,7 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis
Collections.sort(subjects);
sortOrder.setSortOrder(subjects);
return sortOrder;
}
else {
} else {
Hashtable<String, String> hash = new Hashtable<>();
for (String qid : sortOrder.getSortOrder()) {
Question question = getQuestion(qid);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment