Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 189128 | Differences between
and this patch

Collapse All | Expand All

(-)src-ui/org/eclipse/tptp/test/recorders/url/ui/internal/util/URLRecorderRegistryInfo.java (-5 / +28 lines)
Lines 33-39 Link Here
33
 * 
33
 * 
34
 * @author  Paul E. Slauenwhite
34
 * @author  Paul E. Slauenwhite
35
 * @author  Mark D. Dunn
35
 * @author  Mark D. Dunn
36
 * @version March 13, 2008
36
 * @version April 2, 2008
37
 * @since   March 11, 2008
37
 * @since   March 11, 2008
38
 */
38
 */
39
public class URLRecorderRegistryInfo {
39
public class URLRecorderRegistryInfo {
Lines 197-208 Link Here
197
		try
197
		try
198
		{
198
		{
199
			try {
199
			try {
200
			Process registryChange = Runtime.getRuntime().exec(getOriginalInfoCommandLine,null);
200
			
201
			registryChange.waitFor();
201
				Process registryChange = Runtime.getRuntime().exec(getOriginalInfoCommandLine,null);
202
				registryChange.waitFor();
203
			}
204
			catch (InterruptedException e) {
205
				//Ignore and continue.
202
			}
206
			}
203
			catch (InterruptedException e) {}
207
			
204
			// bugzilla 126592 mdd use originalSettingsFilePath rather than ...FileName
208
			// bugzilla 126592 mdd use originalSettingsFilePath rather than ...FileName
205
			file = new File(originalSettingsFilePath);
209
			file = new File(originalSettingsFilePath);
210
			
211
			//Since the regedit process may terminate before the exported registry file is created,
212
			//check if the file is created every 200 ms to a maximum of 1 second:
213
			for (int counter = 0; counter < 5; counter++) {
214
215
				if(file.exists()){
216
					break;
217
				}
218
				else{
219
					
220
					try {
221
						Thread.sleep(200);
222
					} 
223
					catch (InterruptedException e) {
224
						//Ignore and continue.
225
					}
226
				}
227
			}
228
			
206
			inputReader= new InputStreamReader(new FileInputStream(file),"UTF-16");//$NON-NLS-1$
229
			inputReader= new InputStreamReader(new FileInputStream(file),"UTF-16");//$NON-NLS-1$
207
			inputFileContents = new StringBuffer();
230
			inputFileContents = new StringBuffer();
208
			char[] inputBuf = new char[1000];
231
			char[] inputBuf = new char[1000];
Lines 239-245 Link Here
239
				}
262
				}
240
				catch (IOException e1)
263
				catch (IOException e1)
241
				{
264
				{
242
					URLRecorderActivator.logError(e1);
265
					//Ignore since closing input stream reader.
243
				}
266
				}
244
		}
267
		}
245
		// Clean up
268
		// Clean up
(-)src/org/eclipse/hyades/execution/recorder/local/appadapters/InternetExplorerAdapter.java (-6 / +46 lines)
Lines 36-42 Link Here
36
 * @author  Ernest Jessee
36
 * @author  Ernest Jessee
37
 * @author  Paul E. Slauenwhite
37
 * @author  Paul E. Slauenwhite
38
 * @author  Duwayne Morris
38
 * @author  Duwayne Morris
39
 * @version February 28, 2008
39
 * @version April 2, 2008
40
 * @since   April 22, 2005
40
 * @since   April 22, 2005
41
 * @deprecated  This is not public API.  It will be moved to internal in TPTP 5.0.
41
 * @deprecated  This is not public API.  It will be moved to internal in TPTP 5.0.
42
 */
42
 */
Lines 450-463 Link Here
450
			for (int i = 0; i < regInfo.length; i++)
450
			for (int i = 0; i < regInfo.length; i++)
451
			{
451
			{
452
				if (i == 2  && bRunningVista == false){  // the Java command console registry setting is not available on Vista
452
				if (i == 2  && bRunningVista == false){  // the Java command console registry setting is not available on Vista
453
					
453
					registryChange = Runtime.getRuntime().exec(consolecmdLine + regInfo[i],null);	
454
					registryChange = Runtime.getRuntime().exec(consolecmdLine + regInfo[i],null);	
454
					
455
					
456
					registryChange.waitFor();
457
					
458
					//Since the regedit process may terminate before the exported registry file is created,
459
					//check if the file is created every 200 ms to a maximum of 1 second:
460
					for (int counter = 0; counter < 5; counter++) {
461
462
						if(consoleFile.exists()){
463
							break;
464
						}
465
						else{
466
							
467
							try {
468
								Thread.sleep(200);
469
							} 
470
							catch (InterruptedException e) {
471
								//Ignore and continue.
472
							}
473
						}
474
					}
455
				} 
475
				} 
456
				else {
476
				else {
477
				
457
					registryChange = Runtime.getRuntime().exec(cmdLine + regInfo[i],null);
478
					registryChange = Runtime.getRuntime().exec(cmdLine + regInfo[i],null);
458
				}
479
480
					registryChange.waitFor();
459
					
481
					
460
				registryChange.waitFor();
482
					//Since the regedit process may terminate before the exported registry file is created,
483
					//check if the file is created every 200 ms to a maximum of 1 second:
484
					for (int counter = 0; counter < 5; counter++) {
485
486
						if(file.exists()){
487
							break;
488
						}
489
						else{
490
							
491
							try {
492
								Thread.sleep(200);
493
							} 
494
							catch (InterruptedException e) {
495
								//Ignore and continue.
496
							}
497
						}
498
					}
499
				}
500
							
461
				if (i == 2  && bRunningVista == false){
501
				if (i == 2  && bRunningVista == false){
462
					// the Java command console registry setting is not available on Vista
502
					// the Java command console registry setting is not available on Vista
463
					// so this was throwing a File I/O exception
503
					// so this was throwing a File I/O exception
Lines 480-490 Link Here
480
		}
520
		}
481
		catch (IOException e)
521
		catch (IOException e)
482
		{
522
		{
483
			e.printStackTrace();
523
			TestCorePlugin.getDefault().logError(e);
484
		} 
524
		} 
485
		catch (InterruptedException e)
525
		catch (InterruptedException e)
486
		{
526
		{
487
			e.printStackTrace();
527
			TestCorePlugin.getDefault().logError(e);
488
		}
528
		}
489
		finally
529
		finally
490
		{
530
		{
Lines 495-501 Link Here
495
				}
535
				}
496
				catch (IOException e1)
536
				catch (IOException e1)
497
				{
537
				{
498
					e1.printStackTrace();
538
					//Ignore since closing input stream reader.
499
				}
539
				}
500
		}
540
		}
501
		return inputFileContents;
541
		return inputFileContents;

Return to bug 189128