anton-vinogradov commented on code in PR #13095: URL: https://github.com/apache/ignite/pull/13095#discussion_r3598419645
########## modules/codegen/src/main/java/org/apache/ignite/internal/MarshalledCollection.java: ########## @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** Marks a {@code Collection} field whose wire form is a companion {@code @Order} array field named by {@link #value()}. */ +@Retention(RetentionPolicy.CLASS) +@Target(ElementType.FIELD) +public @interface MarshalledCollection { Review Comment: Done — you were right, and the key that makes it work is dispatching on the **companion field's shape** rather than the annotated field's type (which was what my counterexample hit): `byte[]` = single blob, `Message[]` = per-element messages, `Collection<byte[]>` = per-element blobs, and `keys()`/`values()` instead of `value()` = the map flavour. Each mechanic has a distinct companion shape across all usages, so one annotation is unambiguous. `@MarshalledCollection`/`@MarshalledMap`/`@MarshalledObjects` are deleted; `@Marshalled` carries `value()` XOR `keys()`+`values()` (validated by the processor); the generator classifies via a `MarshalledKind` derived from the companion's `TypeMirror`, with the generation bodies untouched. Verified: the goldens (34/34) show the generated sources are character-identical to what the four annotations produced, plus the cache-free-unmarshal, query-response, discovery-vulnerability and tx-marshalling tests are green. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
