Skip to content

Commit

Permalink
Fix VerifyError in EdgeConfigWorker (#2987)
Browse files Browse the repository at this point in the history
Fix java.lang.VerifyError: Inconsistent stackmap frames at branch target 273 that appeared after #2976.

I don't know why, but this fixes the problem.

Closes #2984
  • Loading branch information
sfeilmeier authored Jan 22, 2025
1 parent d07e7e6 commit 2037299
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Queue;
import java.util.Set;
import java.util.TreeMap;
Expand Down Expand Up @@ -267,11 +268,15 @@ private boolean readConfigurations(EdgeConfig.ActualEdgeConfig.Builder builder,
// Read Component-ID
var componentId = switch (properties.get("id")) {
case String s -> s; // Read 'id' property
case null, default -> //
this.parent.getAllComponents().stream() //
.filter(c -> config.getPid().equals(c.serviceFactoryPid())) //
.map(c -> c.id()) //
case null, default -> {
// NOTE: for some reason JRE throws a "java.lang.VerifyError: Inconsistent
// stackmap frames at branch target 273" when yielding the value directly
var id = this.parent.getAllComponents().stream() //
.filter(c -> Objects.equals(config.getPid(), c.serviceFactoryPid())) //
.map(OpenemsComponent::id) //
.findFirst().orElse(null);
yield id;
}
};

if (componentId == null) {
Expand Down

0 comments on commit 2037299

Please sign in to comment.