jaroslav@1812: /** jaroslav@1812: * Back 2 Browser Bytecode Translator jaroslav@1812: * Copyright (C) 2012-2015 Jaroslav Tulach jaroslav@1812: * jaroslav@1812: * This program is free software: you can redistribute it and/or modify jaroslav@1812: * it under the terms of the GNU General Public License as published by jaroslav@1812: * the Free Software Foundation, version 2 of the License. jaroslav@1812: * jaroslav@1812: * This program is distributed in the hope that it will be useful, jaroslav@1812: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@1812: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@1812: * GNU General Public License for more details. jaroslav@1812: * jaroslav@1812: * You should have received a copy of the GNU General Public License jaroslav@1812: * along with this program. Look for COPYING file in the top folder. jaroslav@1812: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@1812: */ jaroslav@1812: package org.apidesign.bck2brwsr.flow; jaroslav@1812: jaroslav@1812: public class LoopControl { jaroslav@1812: public static int simpleLoopTestWithExit(int i) { jaroslav@1812: int sum = 0; jaroslav@1812: for (int j = 0; j < i; j++) { jaroslav@1812: sum += j; jaroslav@1812: } jaroslav@1812: if (i == 123) { jaroslav@1812: return 123123 + sum; jaroslav@1812: } else { jaroslav@1812: return i * 2 + sum; jaroslav@1812: } jaroslav@1812: } jaroslav@1812: }