我现在不明白 Java 的错误在哪里。使用 Java 7。
public void chatMessage(String userName, String message) {
IScope scope = Red5.getConnectionLocal().getScope();
ISharedObject chat = getSharedObject(scope, "chat");
List<ChatHistoryItem> history = (List<ChatHistoryItem>) chat.getAttribute("remoteHistory");
ChatHistoryItem item = new ChatHistoryItem();
item.user = userName;
item.date = new Date();
item.message = message;
history.add(item);
chat.setAttribute("remoteHistory", history);
}
错误 :Unchecked cast from Object to List<ChatHistoryItem>