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

Cache declared fields for class #60

Closed
wants to merge 1 commit into from
Closed

Cache declared fields for class #60

wants to merge 1 commit into from

Conversation

purnhar
Copy link
Contributor

@purnhar purnhar commented Jul 27, 2016

Getting the declared fields for a class is an expensive operation.
Therefore the field names are requested per class and cached.

Getting the declared fields for a class is an expensive operation.
Therefore the field names are requested per class and cached.
@MrEasy
Copy link

MrEasy commented Aug 4, 2016

I suppose this code may be called multi-threaded, so using a thread-safe Set-implementation would be a must (e.g. java.util.concurrent.ConcurrentHashMap).

How about making both Sets static? Per ClassLoader the checks should be identical for the corresponding classes.

@purnhar
Copy link
Contributor Author

purnhar commented Aug 4, 2016

Using a ConcurrentHashMap would be great but is not possible, because XStream 1.4 has to be compatible with Java 1.4. Thats why i implemented the necessary synchronisation logic by myself. For XStream 1.5 ConcurrentHashMap would be the preffered solution.

@purnhar
Copy link
Contributor Author

purnhar commented Aug 4, 2016

Comment from Jörg Schaible in the XStream User Group:

I've seen the PR and basically it's OK, but I'll try to use an internal
already availabel cache for it.

Which cache do you mean? Is there a way I can help you?

joehni added a commit that referenced this pull request Aug 15, 2016
inheritance of an implicit declared collection, array or map. Closes #60
and #61.
@joehni joehni added the bug label Aug 16, 2016
@joehni joehni added this to the 1.4.x milestone Aug 16, 2016
@joehni joehni self-assigned this Aug 16, 2016
@joehni
Copy link
Member

joehni commented Aug 16, 2016

Uses cache of ReflectionProvider now.

@joehni joehni closed this Aug 16, 2016
@purnhar purnhar deleted the v-1.4.x branch August 16, 2016 03:38
joehni added a commit that referenced this pull request Nov 2, 2016
inheritance of an implicit declared collection, array or map. Closes #60
and #61.
@joehni joehni modified the milestones: 1.4.x, 1.4.10 Jun 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants