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

Code clean-up and modernization for Java 11 #1757

Merged
merged 96 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
c4882cc
Update io.openems.edge.batteryinverter.api
sfeilmeier Mar 5, 2022
d8ecc35
Update io.openems.edge.batteryinverter.kaco.blueplanetgridsave
sfeilmeier Mar 5, 2022
1afee64
Update io.openems.edge.batteryinverter.refu88k
sfeilmeier Mar 5, 2022
a686dfd
Update io.openems.edge.batteryinverter.sinexcel
sfeilmeier Mar 6, 2022
7b25fd0
Update io.openems.edge.batteryinverter.sunspec
sfeilmeier Mar 6, 2022
e1a5487
Update io.openems.edge.bosch.bpts5hybrid
sfeilmeier Mar 6, 2022
d2f733d
Update io.openems.edge.bridge.mbus
sfeilmeier Mar 6, 2022
b587c22
Update io.openems.edge.bridge.modbus
sfeilmeier Mar 6, 2022
ef36f94
Update io.openems.edge.bridge.onewire
sfeilmeier Mar 7, 2022
cad56b4
Update io.openems.edge.common
sfeilmeier Mar 7, 2022
ee4b685
Update io.openems.edge.controller.api
sfeilmeier Mar 7, 2022
e428f49
Update io.openems.edge.controller.api.backend
sfeilmeier Mar 7, 2022
8444c15
Update io.openems.edge.controller.api.common
sfeilmeier Mar 7, 2022
69261ab
Update io.openems.edge.controller.api.modbus
sfeilmeier Mar 7, 2022
82267c1
Update io.openems.edge.controller.api.mqtt
sfeilmeier Mar 7, 2022
5bdac94
Update io.openems.edge.controller.api.rest
sfeilmeier Mar 7, 2022
88094b3
Update io.openems.edge.controller.api.websocket
sfeilmeier Mar 7, 2022
d1942f0
Update io.openems.edge.controller.asymmetric.balancingcosphi
sfeilmeier Mar 7, 2022
e25fb8d
Update io.openems.edge.controller.asymmetric.fixactivepower
sfeilmeier Mar 7, 2022
889258f
Update io.openems.edge.controller.asymmetric.fixreactivepower
sfeilmeier Mar 7, 2022
99c9528
Update io.openems.edge.controller.asymmetric.peakshaving
sfeilmeier Mar 7, 2022
c9b4faa
Update io.openems.edge.controller.asymmetric.phaserectification
sfeilmeier Mar 7, 2022
af7a9bb
Update io.openems.edge.controller.channelthreshold
sfeilmeier Mar 7, 2022
c9b7fc2
Update io.openems.edge.controller.chp.soc
sfeilmeier Mar 7, 2022
3027a97
Update io.openems.edge.controller.debug.detailedlog
sfeilmeier Mar 7, 2022
cb1ed97
Update io.openems.edge.controller.debug.log
sfeilmeier Mar 7, 2022
3b87a04
Update io.openems.edge.controller.ess.acisland
sfeilmeier Mar 7, 2022
6108b9e
Update io.openems.edge.controller.ess.activepowervoltagecharacteristics
sfeilmeier Mar 7, 2022
a9be7b4
Update io.openems.edge.controller.ess.cycle
sfeilmeier Mar 7, 2022
63bc394
Update io.openems.edge.controller.ess.delaycharge
sfeilmeier Mar 7, 2022
cc5a8a3
Update io.openems.edge.controller.ess.delayedselltogrid
sfeilmeier Mar 7, 2022
205808e
Update io.openems.edge.controller.ess.emergencycapacityreserve
sfeilmeier Mar 7, 2022
f16cf49
Update io.openems.edge.controller.ess.fixactivepower
sfeilmeier Mar 7, 2022
8986c80
Update io.openems.edge.controller.ess.gridoptimizedcharge
sfeilmeier Mar 7, 2022
6e6b14c
Update io.openems.edge.controller.ess.surplusfeedtogrid
sfeilmeier Mar 7, 2022
bfce17c
Update io.openems.edge.controller.ess.limittotaldischarge
sfeilmeier Mar 7, 2022
e593895
Update io.openems.edge.controller.ess.linearpowerband
sfeilmeier Mar 7, 2022
14b6b3b
Update io.openems.edge.controller.ess.mindischargeperiod
sfeilmeier Mar 7, 2022
a389a6d
Update io.openems.edge.controller.ess.reactivepowervoltagecharacteris…
sfeilmeier Mar 7, 2022
0a0c9ef
Update io.openems.edge.controller.ess.selltogridlimit
sfeilmeier Mar 7, 2022
aeb5331
Update io.openems.edge.controller.ess.standby
sfeilmeier Mar 7, 2022
c3538d1
Update io.openems.edge.controller.ess.timeofusetariff.discharge
sfeilmeier Mar 7, 2022
0dbc0a6
Update io.openems.edge.controller.evcs
sfeilmeier Mar 7, 2022
d59816a
Update io.openems.edge.controller.evcs.fixactivepower
sfeilmeier Mar 7, 2022
df9a7b5
Update io.openems.edge.controller.generic.jsonlogic
sfeilmeier Mar 7, 2022
8cc8b4a
Update io.openems.edge.controller.highloadtimeslot
sfeilmeier Mar 7, 2022
c8c3f4b
Update io.openems.edge.controller.io.alarm
sfeilmeier Mar 7, 2022
54058e6
Update io.openems.edge.controller.io.channelsinglethreshold
sfeilmeier Mar 7, 2022
81a2a2c
Update io.openems.edge.controller.io.fixdigitaloutput
sfeilmeier Mar 7, 2022
9d9f262
Update io.openems.edge.controller.io.heatingelement
sfeilmeier Mar 7, 2022
aa40514
Update io.openems.edge.controller.io.heatpump
sfeilmeier Mar 7, 2022
3f190c6
Update io.openems.edge.controller.symmetric.fixreactivepower
sfeilmeier Mar 7, 2022
704ee7a
Update io.openems.edge.core
sfeilmeier Mar 8, 2022
f9f3dc1
Update io.openems.edge.ess.adstec.storaxe
sfeilmeier Mar 8, 2022
0a90469
Update io.openems.edge.ess.api
sfeilmeier Mar 8, 2022
05709ee
Update io.openems.edge.ess.byd.container
sfeilmeier Mar 8, 2022
9bcb6f0
Update io.openems.edge.ess.cluster
sfeilmeier Mar 8, 2022
ec51a8b
Update io.openems.edge.ess.core
sfeilmeier Mar 8, 2022
11d5564
Update io.openems.edge.ess.fenecon.commercial40
sfeilmeier Mar 8, 2022
df9464c
Update io.openems.edge.ess.generic
sfeilmeier Mar 8, 2022
138c87e
Update io.openems.edge.ess.sma
sfeilmeier Mar 8, 2022
9e0b425
Update io.openems.edge.evcs.api
sfeilmeier Mar 8, 2022
2778657
Update io.openems.edge.evcs.cluster
sfeilmeier Mar 8, 2022
aeefb9e
Update io.openems.edge.evcs.goe.chargerhome
sfeilmeier Mar 8, 2022
02805d8
Update io.openems.edge.evcs.hardybarth
sfeilmeier Mar 8, 2022
8d22116
Update io.openems.edge.keba.kecontact
sfeilmeier Mar 8, 2022
40c8c56
Update io.openems.edge.evcs.ocpp.abl
sfeilmeier Mar 8, 2022
793c79f
Update io.openems.edge.evcs.ocpp.common
sfeilmeier Mar 8, 2022
bb8cdd3
Update io.openems.edge.ocpp.ies.keywatt.singlecss
sfeilmeier Mar 8, 2022
a13b02b
Update io.openems.edge.evcs.ocpp.server
sfeilmeier Mar 8, 2022
86b6cef
Update io.openems.edge.fenecon.dess
sfeilmeier Mar 8, 2022
26edc1b
Update io.openems.edge.fenecon.mini
sfeilmeier Mar 8, 2022
fdd5840
Update io.openems.edge.fenecon.pro
sfeilmeier Mar 8, 2022
08e7108
Update io.openems.edge.goodwe
sfeilmeier Mar 8, 2022
40e7e64
Update io.openems.edge.io.api
sfeilmeier Mar 8, 2022
9a7767f
Update io.openems.edge.io.*
sfeilmeier Mar 8, 2022
064d392
Update io.openems.edge.kostal.piko
sfeilmeier Mar 8, 2022
8e7364b
Update io.openems.edge.meter.*
sfeilmeier Mar 8, 2022
ccf66f2
Update io.openems.edge.onewire.thermometer
sfeilmeier Mar 8, 2022
16a8158
Update io.openems.edge.predictor.*
sfeilmeier Mar 8, 2022
9b263cd
Update io.openems.edge.pvinverter.*
sfeilmeier Mar 8, 2022
afb331e
Update io.openems.edge.scheduler.*
sfeilmeier Mar 8, 2022
7efd42c
Update io.openems.edge.simulator
sfeilmeier Mar 8, 2022
c93038b
Update io.openems.edge.solaredge/tesla.powerwall2/thermometer.api
sfeilmeier Mar 8, 2022
e9a1c2a
Update io.openems.edge.timedata.*
sfeilmeier Mar 8, 2022
cd0869e
Update io.openems.edge.timeofusetariff.*
sfeilmeier Mar 8, 2022
c9ea421
Update io.openems.shared.influxdb
sfeilmeier Mar 8, 2022
6c1365a
Update ModbusProtocol special handling for `this.m(`
sfeilmeier Mar 8, 2022
e768257
Fix return on updateReferenceFilter
sfeilmeier Mar 8, 2022
f0df871
Apply autoformat
sfeilmeier Mar 8, 2022
8080ac6
Add return on updateReferenceFilter
sfeilmeier Mar 8, 2022
e262b27
Return when activate() changes component config
sfeilmeier Mar 9, 2022
e719ab3
Final touch
sfeilmeier Mar 9, 2022
e516524
More cleanup
sfeilmeier Mar 11, 2022
f18eb8a
Add Eclipse Clean-Up XML definition
sfeilmeier Mar 11, 2022
197ea55
Apply Checkstyle
sfeilmeier Mar 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
142 changes: 142 additions & 0 deletions cnf/clean-up.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="2">
<profile kind="CleanUpProfile" name="OpenEMS Clean Up" version="2">
<setting id="cleanup.array_with_curly" value="true"/>
<setting id="cleanup.use_autoboxing" value="false"/>
<setting id="cleanup.always_use_this_for_non_static_method_access" value="true"/>
<setting id="cleanup.remove_trailing_whitespaces_ignore_empty" value="false"/>
<setting id="cleanup.primitive_comparison" value="true"/>
<setting id="cleanup.system_property_file_encoding" value="false"/>
<setting id="cleanup.format_source_code_changes_only" value="false"/>
<setting id="cleanup.remove_redundant_semicolons" value="true"/>
<setting id="cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class" value="true"/>
<setting id="cleanup.useless_continue" value="true"/>
<setting id="cleanup.remove_redundant_type_arguments" value="true"/>
<setting id="cleanup.remove_unused_imports" value="true"/>
<setting id="cleanup.break_loop" value="true"/>
<setting id="cleanup.pull_up_assignment" value="false"/>
<setting id="cleanup.stringbuilder" value="true"/>
<setting id="cleanup.no_super" value="true"/>
<setting id="cleanup.arrays_fill" value="true"/>
<setting id="cleanup.use_lambda" value="true"/>
<setting id="cleanup.operand_factorization" value="true"/>
<setting id="cleanup.simplify_lambda_expression_and_method_ref" value="true"/>
<setting id="cleanup.always_use_blocks" value="true"/>
<setting id="cleanup.stringconcat_to_textblock" value="false"/>
<setting id="cleanup.sort_members_all" value="false"/>
<setting id="cleanup.system_property_path_separator" value="false"/>
<setting id="cleanup.instanceof" value="false"/>
<setting id="cleanup.add_missing_annotations" value="true"/>
<setting id="cleanup.precompile_regex" value="true"/>
<setting id="cleanup.always_use_this_for_non_static_field_access" value="true"/>
<setting id="cleanup.boolean_literal" value="true"/>
<setting id="cleanup.always_use_parentheses_in_expressions" value="false"/>
<setting id="cleanup.sort_members" value="false"/>
<setting id="cleanup.remove_unused_local_variables" value="false"/>
<setting id="cleanup.add_missing_deprecated_annotations" value="true"/>
<setting id="cleanup.no_string_creation" value="true"/>
<setting id="cleanup.use_unboxing" value="false"/>
<setting id="cleanup.use_blocks_only_for_return_and_throw" value="false"/>
<setting id="cleanup.standard_comparison" value="false"/>
<setting id="cleanup.if_condition" value="true"/>
<setting id="cleanup.system_property_line_separator" value="false"/>
<setting id="cleanup.remove_trailing_whitespaces" value="true"/>
<setting id="cleanup.map_cloning" value="true"/>
<setting id="cleanup.add_serial_version_id" value="false"/>
<setting id="cleanup.try_with_resource" value="false"/>
<setting id="cleanup.use_this_for_non_static_method_access" value="true"/>
<setting id="cleanup.use_this_for_non_static_method_access_only_if_necessary" value="false"/>
<setting id="cleanup.single_used_field" value="true"/>
<setting id="cleanup.reduce_indentation" value="true"/>
<setting id="cleanup.primitive_parsing" value="true"/>
<setting id="cleanup.make_local_variable_final" value="false"/>
<setting id="cleanup.add_missing_methods" value="false"/>
<setting id="cleanup.qualify_static_member_accesses_with_declaring_class" value="true"/>
<setting id="cleanup.add_missing_override_annotations" value="true"/>
<setting id="cleanup.use_blocks" value="true"/>
<setting id="cleanup.multi_catch" value="false"/>
<setting id="cleanup.pull_out_if_from_if_else" value="true"/>
<setting id="cleanup.collection_cloning" value="true"/>
<setting id="cleanup.convert_to_enhanced_for_loop_if_loop_var_used" value="true"/>
<setting id="cleanup.make_variable_declarations_final" value="true"/>
<setting id="cleanup.redundant_comparator" value="true"/>
<setting id="cleanup.remove_unused_private_types" value="true"/>
<setting id="cleanup.system_property_boolean" value="false"/>
<setting id="cleanup.qualify_static_method_accesses_with_declaring_class" value="false"/>
<setting id="cleanup.organize_imports" value="true"/>
<setting id="cleanup.lazy_logical_operator" value="true"/>
<setting id="cleanup.bitwise_conditional_expression" value="false"/>
<setting id="cleanup.use_directly_map_method" value="true"/>
<setting id="cleanup.add_all" value="true"/>
<setting id="cleanup.system_property_file_separator" value="false"/>
<setting id="cleanup.qualify_static_field_accesses_with_declaring_class" value="false"/>
<setting id="cleanup.stringbuilder_for_local_vars" value="false"/>
<setting id="cleanup.add_generated_serial_version_id" value="false"/>
<setting id="cleanup.controlflow_merge" value="true"/>
<setting id="cleanup.primitive_serialization" value="true"/>
<setting id="cleanup.comparing_on_criteria" value="false"/>
<setting id="cleanup.do_while_rather_than_while" value="true"/>
<setting id="cleanup.comparison_statement" value="true"/>
<setting id="cleanup.extract_increment" value="false"/>
<setting id="cleanup.stringbuffer_to_stringbuilder" value="true"/>
<setting id="cleanup.insert_inferred_type_arguments" value="false"/>
<setting id="cleanup.make_private_fields_final" value="true"/>
<setting id="cleanup.useless_return" value="true"/>
<setting id="cleanup.instanceof_keyword" value="false"/>
<setting id="cleanup.use_this_for_non_static_field_access_only_if_necessary" value="false"/>
<setting id="cleanup.remove_trailing_whitespaces_all" value="true"/>
<setting id="cleanup.one_if_rather_than_duplicate_blocks_that_fall_through" value="false"/>
<setting id="cleanup.valueof_rather_than_instantiation" value="true"/>
<setting id="cleanup.plain_replacement" value="true"/>
<setting id="cleanup.remove_unnecessary_array_creation" value="true"/>
<setting id="cleanup.remove_private_constructors" value="true"/>
<setting id="cleanup.make_parameters_final" value="false"/>
<setting id="cleanup.substring" value="true"/>
<setting id="cleanup.ternary_operator" value="true"/>
<setting id="cleanup.merge_conditional_blocks" value="false"/>
<setting id="cleanup.return_expression" value="true"/>
<setting id="cleanup.system_property" value="false"/>
<setting id="cleanup.unlooped_while" value="true"/>
<setting id="cleanup.convert_to_enhanced_for_loop" value="true"/>
<setting id="cleanup.remove_unused_private_fields" value="true"/>
<setting id="cleanup.never_use_blocks" value="false"/>
<setting id="cleanup.remove_redundant_modifiers" value="false"/>
<setting id="cleanup.unreachable_block" value="true"/>
<setting id="cleanup.redundant_falling_through_block_end" value="false"/>
<setting id="cleanup.switch" value="true"/>
<setting id="cleanup.number_suffix" value="true"/>
<setting id="cleanup.remove_unnecessary_nls_tags" value="true"/>
<setting id="cleanup.convert_to_switch_expressions" value="false"/>
<setting id="cleanup.use_this_for_non_static_field_access" value="true"/>
<setting id="cleanup.static_inner_class" value="true"/>
<setting id="cleanup.use_string_is_blank" value="true"/>
<setting id="cleanup.add_missing_nls_tags" value="false"/>
<setting id="cleanup.qualify_static_member_accesses_through_instances_with_declaring_class" value="true"/>
<setting id="cleanup.remove_unnecessary_casts" value="true"/>
<setting id="cleanup.objects_equals" value="false"/>
<setting id="cleanup.convert_functional_interfaces" value="false"/>
<setting id="cleanup.format_source_code" value="true"/>
<setting id="cleanup.else_if" value="true"/>
<setting id="cleanup.boolean_value_rather_than_comparison" value="true"/>
<setting id="cleanup.add_default_serial_version_id" value="true"/>
<setting id="cleanup.remove_unused_private_methods" value="true"/>
<setting id="cleanup.make_type_abstract_if_missing_method" value="false"/>
<setting id="cleanup.join" value="false"/>
<setting id="cleanup.embedded_if" value="false"/>
<setting id="cleanup.use_anonymous_class_creation" value="false"/>
<setting id="cleanup.invert_equals" value="false"/>
<setting id="cleanup.add_missing_override_annotations_interface_methods" value="true"/>
<setting id="cleanup.remove_unused_private_members" value="true"/>
<setting id="cleanup.strictly_equal_or_different" value="true"/>
<setting id="cleanup.never_use_parentheses_in_expressions" value="true"/>
<setting id="cleanup.push_down_negation" value="false"/>
<setting id="cleanup.evaluate_nullable" value="true"/>
<setting id="cleanup.use_parentheses_in_expressions" value="true"/>
<setting id="cleanup.hash" value="false"/>
<setting id="cleanup.double_negation" value="true"/>
<setting id="cleanup.overridden_assignment" value="false"/>
<setting id="cleanup.primitive_rather_than_wrapper" value="true"/>
<setting id="cleanup.correct_indentation" value="true"/>
<setting id="cleanup.use_var" value="true"/>
</profile>
</profiles>
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public RestHandler(B2bRest parent) {
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
try {
User user = this.authenticate(request);
var user = this.authenticate(request);

List<String> targets = Arrays.asList(//
target.substring(1) // remove leading '/'
Expand All @@ -59,7 +59,7 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
throw new OpenemsException("Missing arguments to handle request");
}

String thisTarget = targets.get(0);
var thisTarget = targets.get(0);
switch (thisTarget) {
case "jsonrpc":
this.handleJsonRpc(user, baseRequest, request, response);
Expand All @@ -78,19 +78,19 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
* @throws OpenemsNamedException on error
*/
private User authenticate(HttpServletRequest request) throws OpenemsNamedException {
String authHeader = request.getHeader("Authorization");
var authHeader = request.getHeader("Authorization");
if (authHeader != null) {
var st = new StringTokenizer(authHeader);
if (st.hasMoreTokens()) {
String basic = st.nextToken();
var basic = st.nextToken();
if (basic.equalsIgnoreCase("Basic")) {
String credentials;
try {
credentials = new String(Base64.getDecoder().decode(st.nextToken()), "UTF-8");
} catch (UnsupportedEncodingException e) {
throw OpenemsError.COMMON_AUTHENTICATION_FAILED.exception();
}
int p = credentials.indexOf(":");
var p = credentials.indexOf(":");
if (p != -1) {
var username = credentials.substring(0, p).trim();
var password = credentials.substring(p + 1).trim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import com.google.gson.JsonObject;

import io.openems.backend.common.metadata.User;
import io.openems.common.exceptions.OpenemsError;
import io.openems.common.exceptions.OpenemsError.OpenemsNamedException;
import io.openems.common.utils.JsonUtils;
Expand All @@ -33,8 +32,8 @@ public void run(WebSocket ws, JsonObject handshake) throws OpenemsNamedException
throw OpenemsError.COMMON_AUTHENTICATION_FAILED.exception();
}

String base64Credentials = authorization.substring("Basic".length()).trim();
byte[] credDecoded = Base64.getDecoder().decode(base64Credentials);
var base64Credentials = authorization.substring("Basic".length()).trim();
var credDecoded = Base64.getDecoder().decode(base64Credentials);
var credentials = new String(credDecoded, StandardCharsets.UTF_8);
// credentials = username:password
final var values = credentials.split(":", 2);
Expand All @@ -43,7 +42,7 @@ public void run(WebSocket ws, JsonObject handshake) throws OpenemsNamedException
}
var username = values[0];
var password = values[1];
User user = this.parent.metadata.authenticate(username, password);
var user = this.parent.metadata.authenticate(username, password);

WsData wsData = ws.getAttachment();
wsData.setUser(user);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.gson.JsonElement;
import com.google.gson.JsonNull;

import io.openems.backend.b2bwebsocket.jsonrpc.notification.EdgesCurrentDataNotification;
Expand Down Expand Up @@ -131,7 +130,7 @@ private EdgesCurrentDataNotification getCurrentDataNotification() throws Openems
user.assertEdgeRoleIsAtLeast("EdgesCurrentDataNotification", edgeId, Role.GUEST);

for (ChannelAddress channel : this.channels) {
Optional<JsonElement> value = this.parent.timeData.getChannelValue(edgeId, channel);
var value = this.parent.timeData.getChannelValue(edgeId, channel);
result.addValue(edgeId, channel, value.orElse(JsonNull.INSTANCE));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public CompletableFuture<User> getUser() {

/**
* Gets the logged in User with a timeout.
*
*
* @param timeout the timeout length
* @param unit the {@link TimeUnit} of the timeout
* @return the {@link User}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public EdgesCurrentDataNotification() {

/**
* Adds a value to the notification.
*
*
* @param edgeId the Edge-ID
* @param channel the {@link ChannelAddress}
* @param value the value
Expand All @@ -52,12 +52,12 @@ public void addValue(String edgeId, ChannelAddress channel, JsonElement value) {
public JsonObject getParams() {
var j = new JsonObject();
for (Entry<String, Map<ChannelAddress, JsonElement>> row : this.values.rowMap().entrySet()) {
String edgeId = row.getKey();
Map<ChannelAddress, JsonElement> columns = row.getValue();
var edgeId = row.getKey();
var columns = row.getValue();
var jEdge = new JsonObject();
for (Entry<ChannelAddress, JsonElement> column : columns.entrySet()) {
ChannelAddress channel = column.getKey();
JsonElement value = column.getValue();
var channel = column.getKey();
var value = column.getValue();
jEdge.add(channel.toString(), value);
}
j.add(edgeId, jEdge);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class SubscribeEdgesChannelsRequest extends JsonrpcRequest {

/**
* Builds a {@link SubscribeEdgesChannelsRequest} from a {@link JsonrpcRequest}.
*
*
* @param r the {@link JsonrpcRequest}
* @return the {@link SubscribeEdgesChannelsRequest}
* @throws OpenemsNamedException on error
Expand All @@ -57,7 +57,7 @@ public static SubscribeEdgesChannelsRequest from(JsonrpcRequest r) throws Openem

/**
* Builds a {@link SubscribeEdgesChannelsRequest} from a {@link JsonObject}.
*
*
* @param j the {@link JsonObject}
* @return the {@link SubscribeEdgesChannelsRequest}
* @throws OpenemsNamedException on error
Expand All @@ -82,7 +82,7 @@ public SubscribeEdgesChannelsRequest(int count) {

/**
* Adds an Edge-ID.
*
*
* @param edgeId the Edge-ID.
*/
public void addEdgeId(String edgeId) {
Expand All @@ -91,7 +91,7 @@ public void addEdgeId(String edgeId) {

/**
* Removes an Edge-ID.
*
*
* @param edgeId the Edge-ID
*/
public void removeEdgeId(String edgeId) {
Expand All @@ -104,7 +104,7 @@ public TreeSet<String> getEdgeIds() {

/**
* Adds a Channel.
*
*
* @param address the {@link ChannelAddress}
*/
public void addChannel(ChannelAddress address) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public void addValue(String edgeId, ChannelAddress channel, JsonElement value) {
public JsonObject getResult() {
var j = new JsonObject();
for (Entry<String, Map<ChannelAddress, JsonElement>> row : this.values.rowMap().entrySet()) {
String edgeId = row.getKey();
Map<ChannelAddress, JsonElement> columns = row.getValue();
var edgeId = row.getKey();
var columns = row.getValue();
var jEdge = new JsonObject();
for (Entry<ChannelAddress, JsonElement> column : columns.entrySet()) {
ChannelAddress channel = column.getKey();
JsonElement value = column.getValue();
var channel = column.getKey();
var value = column.getValue();
jEdge.add(channel.toString(), value);
}
j.add(edgeId, jEdge);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public GetEdgesStatusResponse(UUID id, Map<String, EdgeInfo> edgeInfos) {
public JsonObject getResult() {
var j = new JsonObject();
for (Entry<String, EdgeInfo> entry : this.edgeInfos.entrySet()) {
EdgeInfo edge = entry.getValue();
var edge = entry.getValue();
j.add(entry.getKey(), JsonUtils.buildJsonObject() //
.addProperty("online", edge.online) //
.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public JsonObject getResult() {
.build();

String country = null;
Object[] array = ObjectUtils.getAsObjectArrray(this.userInformation.get("country_id"));
var array = ObjectUtils.getAsObjectArrray(this.userInformation.get("country_id"));
if (array.length > 2) {
country = ObjectUtils.getAsString(array[2]).toLowerCase();
}
Expand Down
Loading