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

NearCacheConfig.readData reads "maxSize" twice #4609

Closed
serkan-ozal opened this issue Feb 12, 2015 · 7 comments
Closed

NearCacheConfig.readData reads "maxSize" twice #4609

serkan-ozal opened this issue Feb 12, 2015 · 7 comments
Assignees
Labels
Source: Internal PR or issue was opened by an employee Team: Core Type: Defect
Milestone

Comments

@serkan-ozal
Copy link
Contributor

    public void readData(ObjectDataInput in) throws IOException {
        ...
        maxSize = in.readInt();
        maxSize = in.readInt();
        ...
    }

https://github.com/hazelcast/hazelcast/blob/master/hazelcast/src/main/java/com/hazelcast/config/NearCacheConfig.java

@Donnerbart
Copy link
Contributor

Code like that should always be suspicious. Looks like a good thing for checkstyle or FindBugs rule.

@jerrinot
Copy link
Contributor

how this could ever worked?

@serkan-ozal
Copy link
Contributor Author

node idea. I found this while writing unit test for my near cache impl on client

@ahmetmircik
Copy link
Member

Why is NearCacheConfig serializable?

@serkan-ozal
Copy link
Contributor Author

AFAIK, when the cache is created at client side such as cacheManager.createCache(cacheName, cacheConfig) as dynamic, CacheConfig is send over CacheCreateConfigRequest and also there is NearCacheConfig inside CacheConfig. And so they are all serialized to nodes

@ahmetmircik
Copy link
Member

Thanks @serkan-ozal i did not know it is used in jcache.

@serkan-ozal
Copy link
Contributor Author

@ahmetmircik you are welcome. It was defined in CacheConfig but always null since we didn't use it for JCache as I know :) So I think, because of it was not used/set, it was not serialized so there was no error until now.

gurbuzali pushed a commit that referenced this issue Feb 17, 2015
Fix for issue #4609: Read "maxSize" only one in "NearCacheConfig"
gurbuzali pushed a commit that referenced this issue Feb 17, 2015
Backport fix for issue #4609: Read "maxSize" only one in "NearCacheConfig"
@mmedenjak mmedenjak added the Source: Internal PR or issue was opened by an employee label Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Source: Internal PR or issue was opened by an employee Team: Core Type: Defect
Projects
None yet
Development

No branches or pull requests

5 participants