Remove redundant regex.

This commit is contained in:
akwizgran
2019-05-10 15:06:12 +01:00
parent 322fefb2a2
commit 593a709a7f
3 changed files with 3 additions and 8 deletions

View File

@@ -13,17 +13,12 @@ import org.briarproject.bramble.api.lifecycle.LifecycleManager;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import java.util.Collection;
import java.util.regex.Pattern;
import javax.annotation.Nullable;
@NotNullByDefault
public interface ContactManager {
int LINK_LENGTH = 64;
Pattern LINK_REGEX =
Pattern.compile("(briar://)?([a-z2-7]{" + LINK_LENGTH + "})");
/**
* Registers a hook to be called whenever a contact is added or removed.
* This method should be called before

View File

@@ -22,7 +22,7 @@ import javax.inject.Inject;
import static java.util.logging.Level.WARNING;
import static java.util.logging.Logger.getLogger;
import static org.briarproject.bramble.api.contact.ContactManager.LINK_REGEX;
import static org.briarproject.bramble.api.contact.HandshakeLinkConstants.LINK_REGEX;
import static org.briarproject.bramble.util.LogUtils.logException;
@NotNullByDefault
@@ -105,7 +105,7 @@ public class AddContactViewModel extends AndroidViewModel {
});
}
public LiveData<Boolean> getAddContactResult() {
LiveData<Boolean> getAddContactResult() {
return addContactResult;
}

View File

@@ -29,7 +29,7 @@ import javax.inject.Inject;
import static android.content.Context.CLIPBOARD_SERVICE;
import static android.widget.Toast.LENGTH_SHORT;
import static java.util.Objects.requireNonNull;
import static org.briarproject.bramble.api.contact.ContactManager.LINK_REGEX;
import static org.briarproject.bramble.api.contact.HandshakeLinkConstants.LINK_REGEX;
import static org.briarproject.briar.android.util.UiUtils.observeOnce;
@MethodsNotNullByDefault