Skip to content

Commit

Permalink
Format all code with formatter-maven-plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Jul 13, 2022
1 parent 4788b51 commit 876d639
Show file tree
Hide file tree
Showing 35 changed files with 612 additions and 657 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ public void handleGET(CoapExchange exchange) {
exchange.respond(toCoapResponseCode(response.getCode()), response.getErrorMessage());
} else {
exchange.respond(toCoapResponseCode(response.getCode()),
linkSerializer.serializeCoreLinkFormat(response.getObjectLinks()), MediaTypeRegistry.APPLICATION_LINK_FORMAT);
linkSerializer.serializeCoreLinkFormat(response.getObjectLinks()),
MediaTypeRegistry.APPLICATION_LINK_FORMAT);
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public interface LwM2mClientObserver {

void onBootstrapSuccess(ServerIdentity bsserver, BootstrapRequest request);

void onBootstrapFailure(ServerIdentity bsserver, BootstrapRequest request, ResponseCode responseCode, String errorMessage,
Exception cause);
void onBootstrapFailure(ServerIdentity bsserver, BootstrapRequest request, ResponseCode responseCode,
String errorMessage, Exception cause);

void onBootstrapTimeout(ServerIdentity bsserver, BootstrapRequest request);

Expand All @@ -43,8 +43,8 @@ void onBootstrapFailure(ServerIdentity bsserver, BootstrapRequest request, Respo

void onRegistrationSuccess(ServerIdentity server, RegisterRequest request, String registrationID);

void onRegistrationFailure(ServerIdentity server, RegisterRequest request, ResponseCode responseCode, String errorMessage,
Exception cause);
void onRegistrationFailure(ServerIdentity server, RegisterRequest request, ResponseCode responseCode,
String errorMessage, Exception cause);

void onRegistrationTimeout(ServerIdentity server, RegisterRequest request);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public void onUpdateSuccess(ServerIdentity server, UpdateRequest request) {
}

@Override
public void onUpdateFailure(ServerIdentity server, UpdateRequest request, ResponseCode responseCode, String errorMessage,
Exception cause) {
public void onUpdateFailure(ServerIdentity server, UpdateRequest request, ResponseCode responseCode,
String errorMessage, Exception cause) {
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public void onUpdateSuccess(ServerIdentity server, UpdateRequest request) {
}

@Override
public void onUpdateFailure(ServerIdentity server, UpdateRequest request, ResponseCode responseCode, String errorMessage,
Exception cause) {
public void onUpdateFailure(ServerIdentity server, UpdateRequest request, ResponseCode responseCode,
String errorMessage, Exception cause) {
for (LwM2mClientObserver observer : observers) {
observer.onUpdateFailure(server, request, responseCode, errorMessage, cause);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,20 +223,17 @@ public synchronized ObserveCompositeResponse observe(ServerIdentity identity, Ob
LwM2mNode node = null;
if (objectEnabler != null) {
ReadResponse response = objectEnabler.observe(identity,
new ObserveRequest(request.getResponseContentFormat(), path, request.getCoapRequest())
);
new ObserveRequest(request.getResponseContentFormat(), path, request.getCoapRequest()));
if (response.isSuccess()) {
node = response.getContent();
isEmpty = false;
} else {
LOG.debug("Server {} try to read node {} in a Observe-Composite Request {} but it failed for {} " +
"{}", identity, path, paths, response.getCode(), response.getErrorMessage()
);
LOG.debug("Server {} try to read node {} in a Observe-Composite Request {} but it failed for {} "
+ "{}", identity, path, paths, response.getCode(), response.getErrorMessage());
}
} else {
LOG.debug("Server {} try to read node {} in a Observe-Composite Request {} but it failed because " +
"Object {} is not supported", identity, path, paths, objectId
);
LOG.debug("Server {} try to read node {} in a Observe-Composite Request {} but it failed because "
+ "Object {} is not supported", identity, path, paths, objectId);
}

content.put(path, node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ public class ResponseCode {
"INTERNAL_SERVER_ERROR");

private static final ResponseCode knownResponseCode[] = new ResponseCode[] { CREATED, DELETED, CHANGED, CONTENT,
BAD_REQUEST, UNAUTHORIZED, METHOD_NOT_ALLOWED, FORBIDDEN, NOT_FOUND, NOT_ACCEPTABLE,
REQUEST_ENTITY_INCOMPLETE, PRECONDITION_FAILED, REQUEST_ENTITY_TOO_LARGE,
UNSUPPORTED_CONTENT_FORMAT, INTERNAL_SERVER_ERROR };
BAD_REQUEST, UNAUTHORIZED, METHOD_NOT_ALLOWED, FORBIDDEN, NOT_FOUND, NOT_ACCEPTABLE,
REQUEST_ENTITY_INCOMPLETE, PRECONDITION_FAILED, REQUEST_ENTITY_TOO_LARGE, UNSUPPORTED_CONTENT_FORMAT,
INTERNAL_SERVER_ERROR };

private int code;
private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public ObjectModel getObjectModel(Integer objectId, Version version) {
*/
public ObjectModel getObjectModel(Integer objectId) {
LwM2mNodeUtil.validateObjectId(objectId);

Key floorKey = objects.floorKey(getKey(objectId, Version.MAX));
if (floorKey == null || !floorKey.id.equals(objectId)) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
/**
* Helper to convert value "magically" from one type to another.
* <p>
* This is used by {@link LwM2mEncoder} to fix {@link LwM2mResource} which would used a different {@link Type} than
* the one defined in the {@link ResourceModel}.
* This is used by {@link LwM2mEncoder} to fix {@link LwM2mResource} which would used a different {@link Type} than the
* one defined in the {@link ResourceModel}.
*/
public interface LwM2mValueConverter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public static ReadResponse success(int resourceId, long value) {
}

public static ReadResponse success(int resourceId, ULong value) {
return new ReadResponse(ResponseCode.CONTENT, LwM2mSingleResource.newUnsignedIntegerResource(resourceId, value), null);
return new ReadResponse(ResponseCode.CONTENT, LwM2mSingleResource.newUnsignedIntegerResource(resourceId, value),
null);
}

public static ReadResponse success(int resourceId, ObjectLink value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@ public enum TlvType {

@Override
public String toString() {
return String.format(
"Tlv [type=%s, children=%s, value=%s, identifier=%s]",
new Object[] { type.name(), Arrays.toString(children), Arrays.toString(value),
Integer.toString(identifier) });
return String.format("Tlv [type=%s, children=%s, value=%s, identifier=%s]", new Object[] { type.name(),
Arrays.toString(children), Arrays.toString(value), Integer.toString(identifier) });
}

@Override
Expand Down
Loading

0 comments on commit 876d639

Please sign in to comment.