User user = optUser.get();
Optional<String> optIndex = args.nextIfPresent();
if (!optIndex.isPresent()) {
throw args.createError(NucleusPlugin.getNucleus().getMessageProvider().getTextMessageWithFormat("args.warning.noindex", user.getName()));
}
<BUG>List<WarnData> warnData = handler.getWarnings(user);
</BUG>
int index;
try {
index = Integer.parseInt(optIndex.get()) - 1;

User user = optUser.get();
Optional<String> optIndex = args.nextIfPresent();
if (!optIndex.isPresent()) {
throw args.createError(NucleusPlugin.getNucleus().getMessageProvider().getTextMessageWithFormat("args.warning.noindex", user.getName()));
}
List<WarnData> warnData = handler.getWarningsInternal(user);
int index;
try {
index = Integer.parseInt(optIndex.get()) - 1;
