Issue 32546 - Java UnoRuntime.getUniqueKey/generateOid do not work reliably
Summary: Java UnoRuntime.getUniqueKey/generateOid do not work reliably
Status: RESOLVED FIXED
Alias: None
Product: udk
Classification: Code
Component: code (show other issues)
Version: 680m49
Hardware: All All
: P2 Major (vote)
Target Milestone: AOO PleaseHelp
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-04 10:11 UTC by Stephan Bergmann
Modified: 2017-08-20 06:32 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.1.3
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Stephan Bergmann 2004-08-04 10:11:29 UTC
The two functions use hashCode to compute unique values, which does not work
(esp. as Sun's HotSpot JVM uses random numbers for Object.hashCode).  A better
approach for getUniqueKey might be Java 1.5's java.util.UUID, a better approach
for generateOid might be similar to getThreadId's WeakHashMap in
jurt/com/sun/star/lib/uno/environments/remote/JavaThreadPoolFactory.java 1.3.58.1.
Comment 1 Stephan Bergmann 2004-08-04 10:12:01 UTC
accepted
Comment 2 Marcus 2017-05-20 11:30:06 UTC
Reset assigne to the default "issues@openoffice.apache.org".
Comment 3 damjan 2017-08-20 02:42:14 UTC
Definitely not a "Minor" issue. This can still be reproduced even with modest use of the Java UNO bridge: objects returned from Java to C++ change identity, and future method calls are routed to the wrong objects!!! This can have potentially serious consequences.

Stephan any further thoughts on your WeakHashMap idea?
Comment 4 damjan 2017-08-20 06:32:20 UTC
Implemented the WeakHashMap of UUIDs:

"damjan" committed SVN revision 1805538 into trunk:
#i32564# - Java UnoRuntime.getUniqueKey/generateOid do not work reliably

Resolving fixed. Thank you.