Use var instead of explicit types

This commit is contained in:
AsamK 2021-02-21 15:01:41 +01:00
parent 03c30519b1
commit de273586b4
77 changed files with 850 additions and 1017 deletions

View file

@ -4,7 +4,6 @@ import net.sourceforge.argparse4j.inf.Namespace;
import net.sourceforge.argparse4j.inf.Subparser;
import org.asamk.signal.manager.Manager;
import org.asamk.signal.manager.groups.GroupId;
import org.asamk.signal.manager.groups.GroupIdFormatException;
import org.asamk.signal.manager.groups.GroupNotFoundException;
import org.asamk.signal.util.Util;
@ -21,7 +20,7 @@ public class UnblockCommand implements LocalCommand {
@Override
public int handleCommand(final Namespace ns, final Manager m) {
for (String contact_number : ns.<String>getList("contact")) {
for (var contact_number : ns.<String>getList("contact")) {
try {
m.setContactBlocked(contact_number, false);
} catch (InvalidNumberException e) {
@ -30,9 +29,9 @@ public class UnblockCommand implements LocalCommand {
}
if (ns.<String>getList("group") != null) {
for (String groupIdString : ns.<String>getList("group")) {
for (var groupIdString : ns.<String>getList("group")) {
try {
GroupId groupId = Util.decodeGroupId(groupIdString);
var groupId = Util.decodeGroupId(groupIdString);
m.setGroupBlocked(groupId, false);
} catch (GroupIdFormatException | GroupNotFoundException e) {
System.err.println(e.getMessage());