Line
Link Here
|
0 |
-- 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 |
0 |
++ /Users/simpatico/NetBeansProjects/netbeans-7.0-201104080000-platform-src/spi.quicksearch/src/org/netbeans/modules/quicksearch/recent/RecentSearches.java |
Lines 46-51
Link Here
|
46 |
import java.util.GregorianCalendar; |
46 |
import java.util.GregorianCalendar; |
47 |
import java.util.LinkedList; |
47 |
import java.util.LinkedList; |
48 |
import java.util.List; |
48 |
import java.util.List; |
|
|
49 |
import java.util.logging.Level; |
50 |
import java.util.logging.Logger; |
49 |
import java.util.prefs.Preferences; |
51 |
import java.util.prefs.Preferences; |
50 |
import org.netbeans.modules.quicksearch.CommandEvaluator; |
52 |
import org.netbeans.modules.quicksearch.CommandEvaluator; |
51 |
import org.netbeans.modules.quicksearch.ResultsModel; |
53 |
import org.netbeans.modules.quicksearch.ResultsModel; |
Lines 75-81
Link Here
|
75 |
public String toString() { |
77 |
public String toString() { |
76 |
StringBuffer buf = new StringBuffer(); |
78 |
StringBuffer buf = new StringBuffer(); |
77 |
for(ItemResult td : this) { |
79 |
for(ItemResult td : this) { |
78 |
buf.append(td.getDisplayName() + ":" + td.getDate().getTime() + ","); |
80 |
buf.append(td.getDate().getTime() + ":" + td.getDisplayName() + ","); |
79 |
} |
81 |
} |
80 |
return buf.toString(); |
82 |
return buf.toString(); |
81 |
} |
83 |
} |
Lines 139-152
Link Here
|
139 |
for (int i = 0; i < items.length; i++) { |
141 |
for (int i = 0; i < items.length; i++) { |
140 |
int semicolonPos = items[i].lastIndexOf(":"); // NOI18N |
142 |
int semicolonPos = items[i].lastIndexOf(":"); // NOI18N |
141 |
if (semicolonPos >= 0) { |
143 |
if (semicolonPos >= 0) { |
142 |
final String name = items[i].substring(0, semicolonPos); |
144 |
try { |
143 |
final long time = Long.parseLong(items[i].substring(semicolonPos + 1)); |
145 |
final long time = Long.parseLong(items[i].substring(0,semicolonPos)); |
|
|
146 |
final String name = items[i].substring(semicolonPos + 1); |
144 |
ItemResult incomplete = new ItemResult(null, new FakeAction(name), name, new Date(time)); |
147 |
ItemResult incomplete = new ItemResult(null, new FakeAction(name), name, new Date(time)); |
145 |
recent.add(incomplete); |
148 |
recent.add(incomplete); |
|
|
149 |
} catch (NumberFormatException nfe) { |
150 |
Logger l = Logger.getLogger(RecentSearches.class.getName()); |
151 |
l.log(Level.INFO, "Failed to read recent searches", items); |
146 |
} |
152 |
} |
147 |
} |
153 |
} |
148 |
} |
154 |
} |
149 |
} |
155 |
} |
|
|
156 |
} |
150 |
|
157 |
|
151 |
/** |
158 |
/** |
152 |
* Lazy initied action used for recent searches |
159 |
* Lazy initied action used for recent searches |