From 2ca25918197d830eb69d9ad11339a91170b600e0 Mon Sep 17 00:00:00 2001 From: axelcl Date: Sun, 12 Jun 2005 12:32:26 +0000 Subject: [PATCH] Catch exception if reading webbrowser favorites --- .../webbrowser/internal/WebBrowserPreference.java | 23 +++++++++++++------- 1 files changed, 15 insertions(+), 8 deletions(-) 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()) { -- 1.7.1