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

Bug : Marshaller type error in getCache() (and FIX) #148

Closed
sharefeel opened this issue Jul 2, 2014 · 3 comments
Closed

Bug : Marshaller type error in getCache() (and FIX) #148

sharefeel opened this issue Jul 2, 2014 · 3 comments

Comments

@sharefeel
Copy link

Two overloaded getCache() have bug.

----------------- BUGGY FUNCTION ----------------------

  1. template <class K, class V> RemoteCache<K, V> getCache(
    HR_SHARED_PTR<Marshaller > km, HR_SHARED_PTR<Marshaller > vm,
    bool forceReturnValue = false)
  2. template <class K, class V> RemoteCache<K, V> getCache(
    HR_SHARED_PTR<Marshaller > km, HR_SHARED_PTR<Marshaller > vm,
    const std::string& name, bool forceReturnValue = false)

----------------- BUG LINE ----------------------
rcache.valueMarshallerPtr.reset(new portable::counted_wrapper<HR_SHARED_PTR<Marshaller > >(vm), &genericDelete);

Ths line sets user-given marshaller function of VALUE.
And type of VALUE is template parameter "V"
But, key type "K" is used instead of "V".

----------------- FIX ----------------------
"K" ---> "V"
rcache.valueMarshallerPtr.reset(new portable::counted_wrapper<HR_SHARED_PTR<Marshaller > >(vm), &genericDelete);

@sharefeel
Copy link
Author

The code of bug line is not pasted properly.

Anyway, shortly, type of VALUE marshaller's template parameter has to be set as "V" not "K".

@rvansa
Copy link
Member

rvansa commented Jul 17, 2014

Thanks for finding out. Anyway, don't use those two methods (use those with directly shared marshaller pointer and destructor) - these are provided only for compatibility with previous version which had serious problems with ABI compatibility.

@ghost
Copy link

ghost commented Oct 13, 2014

Thank you for the bug report and fix. Moving the issue over to the JBoss issue tracking system at https://issues.jboss.org/browse/HRCPP-177.

@ghost ghost closed this as completed Oct 13, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants