From: axelcl Date: Sun, 12 Jun 2005 12:32:26 +0000 (+0000) Subject: Catch exception if reading webbrowser favorites X-Git-Url: http://secure.phpeclipse.com?hp=14718c153f3950c2469a47f57a4fc6104c1d1331 Catch exception if reading webbrowser favorites --- diff --git a/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/internal/WebBrowserPreference.java b/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/internal/WebBrowserPreference.java index 6ce17c2..f8eea79 100644 --- a/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/internal/WebBrowserPreference.java +++ b/net.sourceforge.phpeclipse.webbrowser/src/net/sourceforge/phpeclipse/webbrowser/internal/WebBrowserPreference.java @@ -1,10 +1,10 @@ /** * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved.   This program and the accompanying materials + * All rights reserved. � This program and the accompanying materials * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html - * +�* * Contributors: * IBM - Initial API and implementation */ @@ -85,8 +85,12 @@ public class WebBrowserPreference { String temp = getPreferenceStore().getString(PREF_INTERNAL_WEB_BROWSER_FAVORITES); StringTokenizer st = new StringTokenizer(temp, "|*|"); List l = new ArrayList(); - while (st.hasMoreTokens()) { - l.add(new Favorite(st.nextToken(), st.nextToken())); + try { + while (st.hasMoreTokens()) { + l.add(new Favorite(st.nextToken(), st.nextToken())); + } + } catch (Exception e) { + // ignore } return l; } @@ -100,10 +104,13 @@ public class WebBrowserPreference { String temp = store.getString(PREF_INTERNAL_WEB_BROWSER_OLD_FAVORITES); StringTokenizer st = new StringTokenizer(temp, "|*|"); List def = new ArrayList(); - while (st.hasMoreTokens()) { - def.add(new Favorite(st.nextToken(), st.nextToken())); - } - + try { + while (st.hasMoreTokens()) { + def.add(new Favorite(st.nextToken(), st.nextToken())); + } + } catch (Exception e) { + // ignore + } List list = getInternalWebBrowserFavorites(); Iterator iterator = WebBrowserUtil.getUnlockedFavorites().iterator(); while (iterator.hasNext()) {