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 211333 Details for
Bug 354368
Occasional exception on refresh (F5)
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 patch
Bug-354368.patch (text/plain), 5.63 KB, created by
Ivan Furnadjiev
on 2012-02-21 10:04:49 EST
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Ivan Furnadjiev
Created:
2012-02-21 10:04:49 EST
Size:
5.63 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle.java,v >retrieving revision 1.62 >diff -u -r1.62 RWTLifeCycle.java >--- src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle.java 25 Jan 2012 15:03:38 -0000 1.62 >+++ src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle.java 21 Feb 2012 15:03:38 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2011 Innoopract Informationssysteme GmbH and others. >+ * Copyright (c) 2002, 2012 Innoopract Informationssysteme GmbH 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 >@@ -33,6 +33,8 @@ > > private static final String CURRENT_PHASE = RWTLifeCycle.class.getName() + ".currentPhase"; > private static final String PHASE_ORDER = RWTLifeCycle.class.getName() + ".phaseOrder"; >+ private static final String UI_THREAD_WAITING_FOR_THE_END >+ = UIThreadController.class.getName() + "#UIThreadWaitingForTheEnd"; > private static final String UI_THREAD_THROWABLE > = UIThreadController.class.getName() + "#UIThreadThrowable"; > private static final String REQUEST_THREAD_RUNNABLE >@@ -190,7 +192,10 @@ > } > } else { > uiThread.setServiceContext( context ); >- uiThread.switchThread(); >+ // See bug 354368 >+ if( !Boolean.TRUE.equals( session.getAttribute( UI_THREAD_WAITING_FOR_THE_END ) ) ) { >+ uiThread.switchThread(); >+ } > } > // TODO [rh] consider moving this to UIThreadController#run > if( !uiThread.getThread().isAlive() ) { >@@ -289,6 +294,11 @@ > IServiceStore serviceStore = ContextProvider.getServiceStore(); > serviceStore.setAttribute( UI_THREAD_THROWABLE, thr ); > } >+ // We have to prevent the ui thread from waking up at that point, otherwise >+ // processShutdown would never be executed and session store would not be cleared. >+ // See bug 354368 >+ ISessionStore sessionStore = ContextProvider.getSessionStore(); >+ sessionStore.setAttribute( UI_THREAD_WAITING_FOR_THE_END, Boolean.TRUE ); > // In any case: wait for the thread to be terminated by session timeout > uiThread.switchThread(); > } >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle2_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle2_Test.java,v >retrieving revision 1.11 >diff -u -r1.11 RWTLifeCycle2_Test.java >--- src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle2_Test.java 15 Feb 2012 22:11:20 -0000 1.11 >+++ src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle2_Test.java 21 Feb 2012 15:03:39 -0000 >@@ -159,6 +159,27 @@ > } > } > >+ public static final class TestClearSessionStoreOnSessionRestartEntryPoint implements IEntryPoint { >+ public int createUI() { >+ createUIEntered = true; >+ try { >+ Display display = new Display(); >+ Shell shell = new Shell( display ); >+ shell.setSize( 100, 100 ); >+ shell.layout(); >+ shell.open(); >+ while( !shell.isDisposed() ) { >+ if( !display.readAndDispatch() ) { >+ display.sleep(); >+ } >+ } >+ return 0; >+ } finally { >+ createUIExited = true; >+ } >+ } >+ } >+ > public static final class TestSessionInvalidateWithDisposeInFinallyEntryPoint > implements IEntryPoint > { >@@ -288,6 +309,44 @@ > assertEquals( 0, eventLog.size() ); > } > >+ /* >+ * 354368: Occasional exception on refresh (F5) >+ * https://bugs.eclipse.org/bugs/show_bug.cgi?id=354368 >+ */ >+ public void testClearSessionStoreOnSessionRestart() throws Exception { >+ TestRequest request; >+ Class<? extends IEntryPoint> entryPoint = TestClearSessionStoreOnSessionRestartEntryPoint.class; >+ RWTFactory.getEntryPointManager().registerByName( EntryPointUtil.DEFAULT, entryPoint ); >+ // send initial request - response is index.html >+ request = newRequest(); >+ request.setParameter( RequestParams.STARTUP, "default" ); >+ runRWTDelegate( request ); >+ assertTrue( createUIEntered ); >+ assertFalse( createUIExited ); >+ // send 'application startup' request - response is protocol message to create >+ // client-side representation of what was created in IEntryPoint#createUI >+ request = newRequest(); >+ request.setParameter( RequestParams.UIROOT, "w1" ); >+ runRWTDelegate( request ); >+ assertTrue( createUIEntered ); >+ assertFalse( createUIExited ); >+ // send a request that closes the main shell >+ request = newRequest(); >+ request.setParameter( RequestParams.UIROOT, "w1" ); >+ request.setParameter( "org.eclipse.swt.widgets.Shell_close", "w2" ); >+ runRWTDelegate( request ); >+ assertTrue( createUIExited ); >+ // send a request after the createUI has been exited >+ request = newRequest(); >+ request.setParameter( RequestParams.UIROOT, "w1" ); >+ runRWTDelegate( request ); >+ // send 'restart' request >+ request = newRequest(); >+ request.setParameter( RequestParams.STARTUP, "default" ); >+ runRWTDelegate( request ); >+ // ensures that no exceptions has been thrown >+ } >+ > private static TestResponse runRWTDelegate( final HttpServletRequest request ) > throws Exception > {
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 354368
:
204804
|
211281
|
211324
|
211325
| 211333