Fixed tests for bug 434695: Hot Code Replace drops some frames in case of anonymous classes
diff --git a/org.eclipse.jdt.debug.tests/testprograms/org/eclipse/debug/tests/targets/HcrClass3.java b/org.eclipse.jdt.debug.tests/testprograms/org/eclipse/debug/tests/targets/HcrClass3.java
index 92ae2c4..c5ceacc 100644
--- a/org.eclipse.jdt.debug.tests/testprograms/org/eclipse/debug/tests/targets/HcrClass3.java
+++ b/org.eclipse.jdt.debug.tests/testprograms/org/eclipse/debug/tests/targets/HcrClass3.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) May 24, 2013 IBM Corporation and others.
+ * Copyright (c) May 24, 2013, 2014 IBM Corporation 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
@@ -21,7 +21,7 @@
 		String s = new String("Constructor");
 		Anon aclass = new Anon() {
 			public void run() {
-				String s = new String("Anon#run()");
+				String s = new String("TEST_RUN3");
 			}
 		};
 		aclass.run();
@@ -31,7 +31,7 @@
 		String s = new String("HcrClass3#run()");
 		Anon aclass = new Anon() {
 			public void run() {
-				String s = new String("Anon#run()");
+				String s = new String("TEST_RUN1");
 			}
 		};
 		aclass.run();
@@ -41,7 +41,7 @@
 		String s = new String("HcrClass3#run2()");
 		Anon aclass = new Anon() {
 			public void run() {
-				String s = new String("Anon#run()");
+				String s = new String("TEST_RUN2");
 			}
 		};
 		aclass.run();
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java
index ca79304..c4fe44a 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/HcrTests.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation 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
@@ -477,15 +477,16 @@
 				assertTrue("HcrClass3.java does not exist", cu.exists());
 				IBuffer buffer = cu.getBuffer();
 				String contents = buffer.getContents();
-				int index = contents.indexOf("\"Anon#run()\"");
+				int index = contents.indexOf("\"TEST_RUN1\"");
 				assertTrue("Could not find code to replace", index > 0);
-				String newCode = contents.substring(0, index) + "\"Anon#run\"" + contents.substring(index + 12);
+				String newCode = contents.substring(0, index) + "\"NEW_CODE\"" + contents.substring(index + 11);
 				buffer.setContents(newCode);
 				
 				DebugEventWaiter waiter = new DebugEventWaiter(DebugEvent.SUSPEND);
 				cu.commitWorkingCopy(true, null);
 				waitForBuild();
 				thread = (IJavaThread) waiter.waitForEvent();
+				assertNotNull("Thread did not suspend after HCR", thread);
 				assertTrue("Listener should have been notified", listener.waitNotification());
 				assertNotNull("HCR should have not failed", listener.target);
 				assertTrue("the thread should be suspended again after the HCR", thread.isSuspended());
@@ -529,9 +530,9 @@
 				assertTrue("HcrClass3.java does not exist", cu.exists());
 				IBuffer buffer = cu.getBuffer();
 				String contents = buffer.getContents();
-				int index = contents.indexOf("\"Anon#run()\"");
+				int index = contents.indexOf("\"TEST_RUN2\"");
 				assertTrue("Could not find code to replace", index > 0);
-				String newCode = contents.substring(0, index) + "\"Anon#run\"" + contents.substring(index + 12);
+				String newCode = contents.substring(0, index) + "\"NEW_CODE\"" + contents.substring(index + 11);
 				buffer.setContents(newCode);
 				
 				DebugEventWaiter waiter = new DebugEventWaiter(DebugEvent.SUSPEND);
@@ -581,9 +582,9 @@
 				assertTrue("HcrClass3.java does not exist", cu.exists());
 				IBuffer buffer = cu.getBuffer();
 				String contents = buffer.getContents();
-				int index = contents.indexOf("\"Anon#run()\"");
+				int index = contents.indexOf("\"TEST_RUN3\"");
 				assertTrue("Could not find code to replace", index > 0);
-				String newCode = contents.substring(0, index) + "\"Anon#run\"" + contents.substring(index + 12);
+				String newCode = contents.substring(0, index) + "\"NEW_CODE\"" + contents.substring(index + 11);
 				buffer.setContents(newCode);
 				
 				DebugEventWaiter waiter = new DebugEventWaiter(DebugEvent.SUSPEND);