Skip to content

Commit b797981

Browse files
committed
Remove use of default method in interface
The use of a default method implementation in ServerEvents.java failed to build for Android 8.0. Remove the default method implementations and instead add empty method bodies in the two places where it is needed.
1 parent 63ff70c commit b797981

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

ocpp-common/src/main/java/eu/chargetime/ocpp/ServerEvents.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ of this software and associated documentation files (the "Software"), to deal
2929
import java.util.UUID;
3030

3131
public interface ServerEvents {
32-
default void authenticateSession(SessionInformation information, String username, byte[] password) throws AuthenticationException {}
32+
void authenticateSession(SessionInformation information, String username, byte[] password);
3333

3434
void newSession(UUID sessionIndex, SessionInformation information);
3535

ocpp-v1_6-test/src/main/java/eu/chargetime/ocpp/test/DummyHandlers.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ public FirmwareStatusNotificationConfirmation handleFirmwareStatusNotificationRe
162162

163163
public ServerEvents generateServerEventsHandler() {
164164
return new ServerEvents() {
165+
@Override
166+
public void authenticateSession(SessionInformation information, String username, byte[] password) {
167+
}
168+
165169
@Override
166170
public void newSession(UUID sessionIndex, SessionInformation information) {
167171
currentSessionIndex = sessionIndex;

ocpp-v2_0-test/src/main/java/eu/chargetime/ocpp/test/FakeCentralSystem.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ public void started() throws Exception {
7171
host,
7272
port,
7373
new ServerEvents() {
74+
@Override
75+
public void authenticateSession(SessionInformation information, String username, byte[] password) {
76+
}
77+
7478
@Override
7579
public void newSession(UUID sessionIndex, SessionInformation information) {
7680
currentSession = sessionIndex;

0 commit comments

Comments
 (0)