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

W-17607446: Handle missing fields in DefaultMessageBuilder and ensure that one field is not serialized in DefaultEventBuilder #14175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public static class InternalEventImplementation implements InternalEvent {
private final boolean notificationsEnabled;

private final CaseInsensitiveHashMap<String, TypedValue<?>> variables;
private final CaseInsensitiveHashMap<String, TypedValue<?>> parameters;
private transient final CaseInsensitiveHashMap<String, TypedValue<?>> parameters;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be handled in the serializer as well

private final CaseInsensitiveHashMap<String, String> loggingVariables;

private final String legacyCorrelationId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.mule.runtime.api.metadata.MapDataType;
import org.mule.runtime.api.metadata.MediaType;
import org.mule.runtime.api.metadata.TypedValue;
import org.mule.runtime.api.util.CaseInsensitiveMapWrapper;
import org.mule.runtime.core.api.message.ExceptionPayload;
import org.mule.runtime.core.internal.message.InternalMessage.CollectionBuilder;
import org.mule.runtime.core.privileged.metadata.DefaultCollectionDataType;
Expand All @@ -35,8 +36,10 @@
import java.io.Serializable;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;

import jakarta.activation.DataHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -49,6 +52,11 @@ public final class DefaultMessageBuilder
private TypedValue payload = of(NULL_TYPED_VALUE);
private TypedValue attributes = of(NULL_TYPED_VALUE);

private final Map<String, TypedValue<Serializable>> inboundProperties = new CaseInsensitiveMapWrapper<>();
private final Map<String, TypedValue<Serializable>> outboundProperties = new CaseInsensitiveMapWrapper<>();
private Map<String, DataHandler> inboundAttachments = new LinkedHashMap<>();
private Map<String, DataHandler> outboundAttachments = new LinkedHashMap<>();
Comment on lines +55 to +58
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should not be added back. If they are missing, that should be handled by the serializer


public DefaultMessageBuilder() {}

public DefaultMessageBuilder(org.mule.runtime.api.message.Message message) {
Expand Down