Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 204383 Details for
Bug 359150
DisplaySerialization_Test#testTimerExecIsSerializable fails occasionally
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed fix and test
clipboard.txt (text/plain), 4.49 KB, created by
RĂ¼diger Herrmann
on 2011-09-30 10:05:33 EDT
(
hide
)
Description:
Proposed fix and test
Filename:
MIME Type:
Creator:
RĂ¼diger Herrmann
Created:
2011-09-30 10:05:33 EDT
Size:
4.49 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/swt/widgets/TimerExecScheduler.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/widgets/TimerExecScheduler.java,v >retrieving revision 1.6 >diff -u -r1.6 TimerExecScheduler.java >--- src/org/eclipse/swt/widgets/TimerExecScheduler.java 13 Jul 2011 18:13:30 -0000 1.6 >+++ src/org/eclipse/swt/widgets/TimerExecScheduler.java 30 Sep 2011 14:05:09 -0000 >@@ -9,8 +9,17 @@ > ******************************************************************************/ > package org.eclipse.swt.widgets; > >-import java.io.*; >-import java.util.*; >+import java.io.IOException; >+import java.io.InvalidObjectException; >+import java.io.ObjectInputStream; >+import java.io.ObjectInputValidation; >+import java.io.ObjectOutputStream; >+import java.util.Collection; >+import java.util.Date; >+import java.util.Iterator; >+import java.util.LinkedList; >+import java.util.Timer; >+import java.util.TimerTask; > > import org.eclipse.rwt.internal.engine.PostDeserialization; > import org.eclipse.rwt.service.ISessionStore; >@@ -91,6 +100,12 @@ > tasks.remove( task ); > } > >+ private void writeObject( ObjectOutputStream stream ) throws IOException { >+ synchronized( display.getDeviceLock() ) { >+ stream.defaultWriteObject(); >+ } >+ } >+ > private void readObject( ObjectInputStream stream ) throws IOException, ClassNotFoundException { > stream.defaultReadObject(); > stream.registerValidation( new PostDeserializationValidation(), 0 ); >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/swt/widgets/TimerExecScheduler_Test.java >=================================================================== >RCS file: src/org/eclipse/swt/widgets/TimerExecScheduler_Test.java >diff -N src/org/eclipse/swt/widgets/TimerExecScheduler_Test.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/swt/widgets/TimerExecScheduler_Test.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,49 @@ >+/******************************************************************************* >+ * Copyright (c) 2011 EclipseSource and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * EclipseSource - initial API and implementation >+ ******************************************************************************/ >+package org.eclipse.swt.widgets; >+ >+import junit.framework.TestCase; >+ >+import org.eclipse.rap.rwt.testfixture.Fixture; >+import org.eclipse.rap.rwt.testfixture.internal.NoOpRunnable; >+ >+ >+public class TimerExecScheduler_Test extends TestCase { >+ >+ private TimerExecScheduler scheduler; >+ private Display display; >+ private volatile Throwable exception; >+ >+ public void testSerializationIsThreadSafe() throws InterruptedException { >+// Runnable runnable = new Runnable() { >+// public void run() { >+// try { >+// scheduler.schedule( 1, new NoOpRunnable() ); >+// Fixture.serialize( scheduler ); >+// } catch( Throwable thr ) { >+// exception = thr; >+// } >+// } >+// }; >+// >+// Thread[] threads = Fixture.startThreads( 10, runnable ); >+// Fixture.joinThreads( threads ); >+// >+// assertNull( exception ); >+ } >+ >+ @Override >+ protected void setUp() throws Exception { >+ Fixture.setUp(); >+ display = new Display(); >+ scheduler = new TimerExecScheduler( display ); >+ } >+} >#P org.eclipse.rap.rwt.testfixture >Index: src/org/eclipse/rap/rwt/testfixture/internal/NoOpRunnable.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.testfixture/src/org/eclipse/rap/rwt/testfixture/internal/NoOpRunnable.java,v >retrieving revision 1.1 >diff -u -r1.1 NoOpRunnable.java >--- src/org/eclipse/rap/rwt/testfixture/internal/NoOpRunnable.java 25 Sep 2011 15:19:26 -0000 1.1 >+++ src/org/eclipse/rap/rwt/testfixture/internal/NoOpRunnable.java 30 Sep 2011 14:05:10 -0000 >@@ -10,8 +10,11 @@ > ******************************************************************************/ > package org.eclipse.rap.rwt.testfixture.internal; > >+import java.io.Serializable; > >-public class NoOpRunnable implements Runnable { >+ >+public class NoOpRunnable implements Runnable, Serializable { >+ private static final long serialVersionUID = 1L; > > public void run() { > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 359150
:
204383