tzezula@287: /** tzezula@287: * Back 2 Browser Bytecode Translator tzezula@287: * Copyright (C) 2012 Jaroslav Tulach tzezula@287: * tzezula@287: * This program is free software: you can redistribute it and/or modify tzezula@287: * it under the terms of the GNU General Public License as published by tzezula@287: * the Free Software Foundation, version 2 of the License. tzezula@287: * tzezula@287: * This program is distributed in the hope that it will be useful, tzezula@287: * but WITHOUT ANY WARRANTY; without even the implied warranty of tzezula@287: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the tzezula@287: * GNU General Public License for more details. tzezula@287: * tzezula@287: * You should have received a copy of the GNU General Public License tzezula@287: * along with this program. Look for COPYING file in the top folder. tzezula@287: * If not, see http://opensource.org/licenses/GPL-2.0. tzezula@285: */ tzezula@285: package org.apidesign.vm4brwsr; tzezula@285: tzezula@285: /** tzezula@285: * tzezula@285: * @author tom tzezula@285: */ tzezula@285: public class Exceptions { tzezula@285: tzezula@285: public static int methodWithTryCatchNoThrow() { tzezula@285: int res = 0; tzezula@285: try { tzezula@285: res = 1; tzezula@285: } catch (IllegalArgumentException e) { tzezula@285: res = 2; tzezula@285: } tzezula@285: //join point tzezula@285: return res; tzezula@285: } tzezula@285: tzezula@285: public static int methodWithTryCatchThrow() { tzezula@285: int res = 0; tzezula@285: try { tzezula@285: res = 1; tzezula@285: throw new IllegalArgumentException(); tzezula@285: } catch (IllegalArgumentException e) { tzezula@285: res = 2; tzezula@285: } tzezula@285: //join point tzezula@285: return res; tzezula@285: } tzezula@285: tzezula@285: }