# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. --- org/netbeans/modules/quicksearch/recent/RecentSearches.java in /Users/simpatico/.m2/repository/org/netbeans/api/org-netbeans-spi-quicksearch/RELEASE691/org-netbeans-spi-quicksearch-RELEASE691-sources.jar +++ /Users/simpatico/NetBeansProjects/netbeans-7.0-201104080000-platform-src/spi.quicksearch/src/org/netbeans/modules/quicksearch/recent/RecentSearches.java @@ -46,6 +46,8 @@ import java.util.GregorianCalendar; import java.util.LinkedList; import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; import java.util.prefs.Preferences; import org.netbeans.modules.quicksearch.CommandEvaluator; import org.netbeans.modules.quicksearch.ResultsModel; @@ -75,7 +77,7 @@ public String toString() { StringBuffer buf = new StringBuffer(); for(ItemResult td : this) { - buf.append(td.getDisplayName() + ":" + td.getDate().getTime() + ","); + buf.append(td.getDate().getTime() + ":" + td.getDisplayName() + ","); } return buf.toString(); } @@ -139,14 +141,19 @@ for (int i = 0; i < items.length; i++) { int semicolonPos = items[i].lastIndexOf(":"); // NOI18N if (semicolonPos >= 0) { - final String name = items[i].substring(0, semicolonPos); - final long time = Long.parseLong(items[i].substring(semicolonPos + 1)); + try { + final long time = Long.parseLong(items[i].substring(0,semicolonPos)); + final String name = items[i].substring(semicolonPos + 1); ItemResult incomplete = new ItemResult(null, new FakeAction(name), name, new Date(time)); recent.add(incomplete); + } catch (NumberFormatException nfe) { + Logger l = Logger.getLogger(RecentSearches.class.getName()); + l.log(Level.INFO, "Failed to read recent searches", items); } } } } + } /** * Lazy initied action used for recent searches