Bug 87425

Summary: [compiler] compiling this code can end up with looping subroutines
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Olivier Thomann CLA 2005-03-08 15:00:51 EST
public class LoopJsr {

	int hasLoop() {
		int l, m, n;
		for (m = 0; m < 10; m++) {
			n = 2;
			try {
				n = 3;
				try {
					n = 4;
				} catch (java.lang.ArithmeticException e1) {
					n = 11;
				} finally {
					for (l = 0; l < 10; l++) {
						n++;
					}
					if (n == 12) {
						n = 13;
						break;
					}
					n = 15;
				}
			} catch (java.lang.OutOfMemoryError e2) {
				n = 18;
			}
		}
		return 0;
	}

	public static void main(String args[]) {
      System.out.println("Loaded fine");
   }
}

Compiling this code can lead to a looping call of subroutines.
The bytecode verifier doesn't find any problem with the generated code.

So this might be ok, but it is worth checking that our generated code is all right.
Comment 1 Olivier Thomann CLA 2005-03-08 15:01:17 EST

*** This bug has been marked as a duplicate of 87423 ***