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

Declare inner classes staticly to allow deserialization

Jackson cannot instantiate non-static inner classes for deserialization.
parent 446f4f16
No related merge requests found
Showing with 17 additions and 17 deletions
......@@ -6,8 +6,8 @@ import de.thm.arsnova.entities.serialization.View;
import java.util.List;
public class AnswerStatistics {
public class RoundStatistics {
public class Combination {
public static class RoundStatistics {
public static class Combination {
private int[] selectedChoiceIndexes;
private int count;
}
......@@ -54,7 +54,7 @@ public class AnswerStatistics {
}
}
public class RoundTransition {
public static class RoundTransition {
private int roundA;
private int roundB;
private int[] selectedChoiceIndexesA;
......
......@@ -7,7 +7,7 @@ import java.util.ArrayList;
import java.util.List;
public class ChoiceQuestionContent extends Content {
public class AnswerOption {
public static class AnswerOption {
private String label;
private int points;
......
......@@ -7,7 +7,7 @@ import java.util.Date;
import java.util.Map;
public class Content implements Entity {
public class State {
public static class State {
private int round = 1;
private Date roundEndTimestamp;
private boolean visible = true;
......
......@@ -8,7 +8,7 @@ import java.util.Date;
import java.util.List;
public class MigrationState implements Entity {
public class Migration {
public static class Migration {
private String id;
private Date start;
......
......@@ -8,7 +8,7 @@ import java.util.List;
import java.util.Map;
public class Room implements Entity {
public class ContentGroup {
public static class ContentGroup {
private List<String> contentIds;
private boolean autoSort;
......@@ -33,7 +33,7 @@ public class Room implements Entity {
}
}
public class Settings {
public static class Settings {
private boolean questionsEnabled = true;
private boolean slidesEnabled = true;
private boolean commentsEnabled = true;
......@@ -135,7 +135,7 @@ public class Room implements Entity {
}
}
public class Author {
public static class Author {
private String name;
private String mail;
private String organizationName;
......@@ -193,7 +193,7 @@ public class Room implements Entity {
}
}
public class PoolProperties {
public static class PoolProperties {
private String category;
private String level;
private String license;
......
......@@ -20,7 +20,7 @@ public class UserProfile implements Entity {
TWITTER
}
public class Account {
public static class Account {
private String password;
private String activationKey;
private String passwordResetKey;
......@@ -67,7 +67,7 @@ public class UserProfile implements Entity {
}
}
public class RoomHistoryEntry {
public static class RoomHistoryEntry {
private String roomId;
private Date lastVisit;
......
......@@ -65,7 +65,7 @@ public class FromV2Migrator {
profile.setAuthProvider(UserProfile.AuthProvider.ARSNOVA);
profile.setCreationTimestamp(new Date(dbUser.getCreation()));
profile.setUpdateTimestamp(new Date());
UserProfile.Account account = profile.new Account();
UserProfile.Account account = new UserProfile.Account();
profile.setAccount(account);
account.setPassword(dbUser.getPassword());
account.setActivationKey(dbUser.getActivationKey());
......@@ -81,7 +81,7 @@ public class FromV2Migrator {
}
profile.setLastLoginTimestamp(new Date(loggedIn.getTimestamp()));
List<UserProfile.RoomHistoryEntry> sessionHistory = loggedIn.getVisitedSessions().stream()
.map(entry -> profile.new RoomHistoryEntry(entry.getId(), new Date(0)))
.map(entry -> new UserProfile.RoomHistoryEntry(entry.getId(), new Date(0)))
.collect(Collectors.toList());
profile.setRoomHistory(sessionHistory);
}
......
......@@ -86,7 +86,7 @@ public class CouchDbAnswerRepository extends CouchDbCrudRepository<Answer> imple
final AnswerStatistics stats = new AnswerStatistics();
stats.setContentId(contentId);
final AnswerStatistics.RoundStatistics roundStats = stats.new RoundStatistics();
final AnswerStatistics.RoundStatistics roundStats = new AnswerStatistics.RoundStatistics();
roundStats.setRound(piRound);
roundStats.setAbstentionCount(abstentionCount);
/* FIXME: determine correct array size dynamically */
......
......@@ -327,7 +327,7 @@ public class RoomServiceImpl extends DefaultEntityServiceImpl<Room> implements R
handleLogo(room);
Room.Settings sf = room.new Settings();
Room.Settings sf = new Room.Settings();
room.setSettings(sf);
room.setShortId(generateKey());
......
......@@ -375,7 +375,7 @@ public class UserServiceImpl implements UserService {
}
UserProfile userProfile = new UserProfile();
UserProfile.Account account = userProfile.new Account();
UserProfile.Account account = new UserProfile.Account();
userProfile.setAccount(account);
userProfile.setLoginId(lcUsername);
account.setPassword(encodePassword(password));
......
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