Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #24 - Limit the extensibility of classes and methods #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.samstevens.totp.exceptions;

public class CodeGenerationException extends Exception {
public final class CodeGenerationException extends Exception {
public CodeGenerationException(String message, Throwable cause) {
super(message, cause);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.samstevens.totp.exceptions;

public class QrGenerationException extends Exception {
public final class QrGenerationException extends Exception {
public QrGenerationException(String message, Throwable cause) {
super(message, cause);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.samstevens.totp.exceptions;

public class TimeProviderException extends RuntimeException {
public final class TimeProviderException extends RuntimeException {
public TimeProviderException(String message, Throwable cause) {
super(message, cause);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/samstevens/totp/qr/QrData.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.nio.charset.StandardCharsets;

@SuppressWarnings("WeakerAccess")
public class QrData {
public final class QrData {

private final String type;
private final String label;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.net.InetAddress;
import java.net.UnknownHostException;

public class NtpTimeProvider implements TimeProvider {
public final class NtpTimeProvider implements TimeProvider {

private final NTPUDPClient client;
private final InetAddress ntpHost;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import dev.samstevens.totp.exceptions.TimeProviderException;
import java.time.Instant;

public class SystemTimeProvider implements TimeProvider {
public final class SystemTimeProvider implements TimeProvider {
@Override
public long getTime() throws TimeProviderException {
return Instant.now().getEpochSecond();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/samstevens/totp/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.apache.commons.codec.binary.Base64;

public class Utils {
public final class Utils {
private static Base64 base64Codec = new Base64();

// Class not meant to be instantiated
Expand Down