reduced more compilation warnings by having better Generics type handling and better JavaDocs

vbdev2
Hai Brenner 2016-07-04 16:04:04 +03:00
parent d8b766725b
commit 2336d44ffc
2 changed files with 8 additions and 9 deletions

View File

@ -133,7 +133,7 @@ public class SimpleListCategoriesSelector implements QuestionSelector {
/**
* Verifies that the ballot answer is of length 1. (We do not yet handle multi-choice questions in the channel choice round).
* Otherwise, throws an exception.
* @param ballotAnswer
* @param ballotAnswer the answer to verify whose length is one
* @param questionNumber the number of the question (needed only for error message strings)
*/
private void assertAnswerLengthIsOne (BallotAnswer ballotAnswer, int questionNumber) {

View File

@ -124,7 +124,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
@Override
public void startNewVoterSession(FutureCallback<Void> callback) {
logger.debug("UI interface call to startNewVoterSession");
queue.add(new StartSessionUICommand((ControllerCallback)callback));
queue.add(new StartSessionUICommand((NewVoterCallback)callback));
}
/**
@ -135,8 +135,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
logger.debug("UI entered doShowWelcomeScreen");
System.out.println("Welcome, new voter!");
waitForEnter(null);
ControllerCallback callback = command.getCallback();
assert (callback instanceof NewVoterCallback);
ControllerCallback<Void> callback = command.getCallback();
callback.onSuccess(null);
}
@ -179,7 +178,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
@Override
public void chooseChannel(List<BallotQuestion> questions, FutureCallback<List<BallotAnswer>> callback) {
logger.debug("UI interface call to chooseChannel");
ChannelChoiceUICommand command = new ChannelChoiceUICommand(questions, (ControllerCallback)callback);
ChannelChoiceUICommand command = new ChannelChoiceUICommand(questions, (ChannelChoiceCallback)callback);
queue.add(command);
}
@ -213,7 +212,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
@Override
public void askVoterQuestions(List<BallotQuestion> questions, FutureCallback<List<BallotAnswer>> callback) {
logger.debug("UI interface call to chooseChannel");
queue.add(new RaceVotingUICommand(questions, (ControllerCallback)callback));
queue.add(new RaceVotingUICommand(questions, (VotingCallback)callback));
}
/**
@ -245,7 +244,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
@Override
public void castOrAudit(FutureCallback<FinalizeBallotChoice> callback) {
logger.debug("UI interface call to castOrAudit");
queue.add(new CastOrAuditUICommand((ControllerCallback)callback));
queue.add(new CastOrAuditUICommand((CastOrAuditCallback)callback));
}
/**
@ -289,7 +288,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
@Override
public void notifyVoterToWaitForFinish(UIElement message, FutureCallback<Void> callback) {
logger.debug("UI interface call to notifyVoterToWaitForFinish");
queue.add(new WaitForFinishUICommand(message, (ControllerCallback)callback));
queue.add(new WaitForFinishUICommand(message, (WaitForFinishCallback)callback));
}
/**
@ -333,7 +332,7 @@ public class SystemConsoleUI implements VotingBoothUI, Runnable {
public void showErrorMessageWithButtons(UIElement errorMessage, UIElement[] buttonLabels, FutureCallback<Integer> callback) {
logger.debug("UI interface call to showErrorMessageWithButtons");
queue.clear();
queue.add(new FatalErrorUICommand(errorMessage, buttonLabels, (ControllerCallback)callback));
queue.add(new FatalErrorUICommand(errorMessage, buttonLabels, (ControllerCallback<Integer>)callback));
}
/**