Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341409

Summary: Use java.util.Random in GWT runtime
Product: [Modeling] EMF Reporter: Kenn Hussey <Kenn.Hussey>
Component: CoreAssignee: Kenn Hussey <Kenn.Hussey>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: Ed.Merks
Version: 2.7.0Flags: Kenn.Hussey: indigo+
Target Milestone: M7   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
proposed patch
none
updated patch Kenn.Hussey: review?

Description Kenn Hussey CLA 2011-03-30 14:18:26 EDT
It seems (see, e.g., http://code.google.com/p/google-web-toolkit/source/detail?r=7414) that GWT now provides a replacement for java.util.Random which can be used instead of com.google.gwt.user.client.Random.
Comment 1 Kenn Hussey CLA 2011-03-30 14:23:22 EDT
Created attachment 192218 [details]
proposed patch

Here is a patch which makes the suggested change. Ed, please review.
Comment 2 Ed Merks CLA 2011-03-30 16:32:31 EDT
Could we make it look just like the code that uses SecureRandom in the regular runtime?
Comment 3 Kenn Hussey CLA 2011-03-30 16:39:33 EDT
(In reply to comment #2)
> Could we make it look just like the code that uses SecureRandom in the regular
> runtime?

Hmm, I'll take a look.
Comment 4 Kenn Hussey CLA 2011-03-30 17:07:24 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > Could we make it look just like the code that uses SecureRandom in the regular
> > runtime?
> 
> Hmm, I'll take a look.

Unfortunately, it looks as though they have not implemented that class. :(
Comment 5 Ed Merks CLA 2011-03-30 17:14:13 EDT
I know but if you change it like this in the core runtime, 

   Random random = new SecureRandom();

the rest of the logic still compiles, so we'd reduce the differences between the two versions if we matched the rest of the original logic...
Comment 6 Kenn Hussey CLA 2011-03-31 13:36:39 EDT
Created attachment 192306 [details]
updated patch

OK, here's an updated patch which makes the source for both runtimes more similar.
Comment 7 Ed Merks CLA 2011-04-04 11:53:15 EDT
Looks good.  You'll change the Javadoc for the standard runtime too?
Comment 8 Kenn Hussey CLA 2011-04-04 12:23:24 EDT
(In reply to comment #7)
> Looks good.  You'll change the Javadoc for the standard runtime too?

No, I made the Javadoc for the GWT runtime the same as the standard one...

The changes have been committed to CVS.
Comment 9 Ed Merks CLA 2011-05-10 11:57:58 EDT
The changes are available in EMF 2.7 M7 or an earlier build.