Source:
private void handleRegister(CoapExchange exchange, Request request) { Identity sender = extractIdentity(exchange); String endpoint = null; Long lifetime = null; String smsNumber = null; String lwVersion = null; BindingMode binding = null; LinkObject[] objectLinks = null; for (String param : request.getOptions().getUriQuery()) { if (param.startsWith(QUERY_PARAM_ENDPOINT)) { endpoint = param.substring(3); } else if (param.startsWith(QUERY_PARAM_LIFETIME)) { lifetime = Long.valueOf(param.substring(3)); } else if (param.startsWith(QUERY_PARAM_SMS)) { smsNumber = param.substring(4); } else if (param.startsWith(QUERY_PARAM_LWM2M_VERSION)) { lwVersion = param.substring(6); } else if (param.startsWith(QUERY_PARAM_BINDING_MODE)) { binding = BindingMode.valueOf(param.substring(2)); } } if (request.getPayload() != null) { objectLinks = LinkObject.parse(request.getPayload()); } Map<String, String> registerParams = new HashMap<String, String>(); for (String param : request.getOptions().getUriQuery()) { if (param != null) { String[] tokens = param.split("\\="); if (tokens != null && tokens.length == 2) { registerParams.put(tokens[0], tokens[1]); } } } RegisterRequest registerRequest = new RegisterRequest(endpoint, lifetime, lwVersion, binding, smsNumber, objectLinks, registerParams); InetSocketAddress serverEndpoint = exchange.advanced().getEndpoint().getAddress(); RegisterResponse response = registrationHandler.register(sender, registerRequest, serverEndpoint); if (response.getCode() == org.eclipse.leshan.ResponseCode.CREATED) { exchange.setLocationPath(RESOURCE_NAME + "/" + response.getRegistrationID()); exchange.respond(ResponseCode.CREATED); } else { exchange.respond(fromLwM2mCode(response.getCode()), response.getErrorMessage()); } }

Target:
private void handleRegister(CoapExchange exchange, Request request) { Identity sender = extractIdentity(exchange); String endpoint = null; Long lifetime = null; String smsNumber = null; String lwVersion = null; BindingMode binding = null; LinkObject[] objectLinks = null; Map<String, String> additionalParams = new HashMap<String, String>(); for (String param : request.getOptions().getUriQuery()) { if (param.startsWith(QUERY_PARAM_ENDPOINT)) { endpoint = param.substring(3); } else if (param.startsWith(QUERY_PARAM_LIFETIME)) { lifetime = Long.valueOf(param.substring(3)); } else if (param.startsWith(QUERY_PARAM_SMS)) { smsNumber = param.substring(4); } else if (param.startsWith(QUERY_PARAM_LWM2M_VERSION)) { lwVersion = param.substring(6); } else if (param.startsWith(QUERY_PARAM_BINDING_MODE)) { binding = BindingMode.valueOf(param.substring(2)); } else { String[] tokens = param.split("\\="); if (tokens != null && tokens.length == 2) { additionalParams.put(tokens[0], tokens[1]); } } } if (request.getPayload() != null) { objectLinks = LinkObject.parse(request.getPayload()); } RegisterRequest registerRequest = new RegisterRequest(endpoint, lifetime, lwVersion, binding, smsNumber, objectLinks, additionalParams); InetSocketAddress serverEndpoint = exchange.advanced().getEndpoint().getAddress(); RegisterResponse response = registrationHandler.register(sender, registerRequest, serverEndpoint); if (response.getCode() == org.eclipse.leshan.ResponseCode.CREATED) { exchange.setLocationPath(RESOURCE_NAME + "/" + response.getRegistrationID()); exchange.respond(ResponseCode.CREATED); } else { exchange.respond(fromLwM2mCode(response.getCode()), response.getErrorMessage()); } }