[
https://issues.apache.org/jira/browse/IGNITE-6301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16160915#comment-16160915
]
Nikolay Izhikov commented on IGNITE-6301:
-----------------------------------------
[~vozerov]
According to this specification
https://docs.oracle.com/javase/8/docs/platform/serialization/spec/version.html#a6678
{noformat}
Deleting fields - If a field is deleted in a class, the stream written will not
contain its value.
*When the stream is read by an earlier class, the value of the field will be
set to the default value* because no value is available in the stream.
However, this default value may adversely impair the ability of the earlier
version to fulfill its contract.
{noformat}
Default value of {{indexedTypes}} is null so change will not harm previous
class version
> CacheConfiguration.indexedTypes never initialized and can be removed
> --------------------------------------------------------------------
>
> Key: IGNITE-6301
> URL: https://issues.apache.org/jira/browse/IGNITE-6301
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Affects Versions: 2.1
> Reporter: Nikolay Izhikov
> Assignee: Nikolay Izhikov
> Priority: Trivial
>
> CacheConfiguration#indexedTypes never initialized and can be removed
> {code:java}
> public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
> //...
> /** */
> private transient Class<?>[] indexedTypes;
> //....
> public CacheConfiguration<K, V> setIndexedTypes(Class<?>... indexedTypes)
> {
> if (F.isEmpty(indexedTypes))
> return this;
> int len = indexedTypes.length;
> if (len == 0)
> return this;
> A.ensure((len & 1) == 0,
> "Number of indexed types is expected to be even. Refer to method
> javadoc for details.");
> if (this.indexedTypes != null)
> throw new CacheException("Indexed types can be set only once.");
> Class<?>[] newIndexedTypes = new Class<?>[len];
> // other method body fill qryEntities list.
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)