Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 79486 Details for
Bug 135633
LogView sort is extremely slow especially that it uses the SimpleDateFormat
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
LogEntrys will now store a formatted date string, in addtion to a Date object, for faster label providing
patch-logview.txt (text/plain), 5.49 KB, created by
Janek Lasocki-Biczysko
on 2007-10-01 11:18:27 EDT
(
hide
)
Description:
LogEntrys will now store a formatted date string, in addtion to a Date object, for faster label providing
Filename:
MIME Type:
Creator:
Janek Lasocki-Biczysko
Created:
2007-10-01 11:18:27 EDT
Size:
5.49 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.runtime >Index: src/org/eclipse/pde/internal/runtime/logview/LogViewLabelProvider.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogViewLabelProvider.java,v >retrieving revision 1.20 >diff -u -r1.20 LogViewLabelProvider.java >--- src/org/eclipse/pde/internal/runtime/logview/LogViewLabelProvider.java 8 Jun 2007 15:54:28 -0000 1.20 >+++ src/org/eclipse/pde/internal/runtime/logview/LogViewLabelProvider.java 1 Oct 2007 15:07:11 -0000 >@@ -19,9 +19,6 @@ > import org.eclipse.pde.internal.runtime.PDERuntimePluginImages; > import org.eclipse.swt.graphics.Image; > >-import com.ibm.icu.text.DateFormat; >-import com.ibm.icu.text.SimpleDateFormat; >- > public class LogViewLabelProvider > extends LabelProvider > implements ITableLabelProvider { >@@ -87,10 +84,7 @@ > if (entry.getPluginId() != null) > return entry.getPluginId(); > case 2: >- if (entry.getDate() != null) { >- DateFormat formatter = new SimpleDateFormat(LogEntry.F_DATE_FORMAT); >- return formatter.format(entry.getDate()); >- } >+ return entry.getFormattedDate(); > } > return ""; //$NON-NLS-1$ > } >Index: src/org/eclipse/pde/internal/runtime/logview/EventDetailsDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/EventDetailsDialog.java,v >retrieving revision 1.35 >diff -u -r1.35 EventDetailsDialog.java >--- src/org/eclipse/pde/internal/runtime/logview/EventDetailsDialog.java 8 Jun 2007 15:54:28 -0000 1.35 >+++ src/org/eclipse/pde/internal/runtime/logview/EventDetailsDialog.java 1 Oct 2007 15:07:11 -0000 >@@ -49,8 +49,6 @@ > import org.eclipse.ui.PlatformUI; > > import com.ibm.icu.text.Collator; >-import com.ibm.icu.text.DateFormat; >-import com.ibm.icu.text.SimpleDateFormat; > > public class EventDetailsDialog extends TrayDialog { > private LogEntry entry, parentEntry; >@@ -353,13 +351,8 @@ > > resetTotalElementCount(); > >- Date date = entry.getDate(); >- String strDate = null; >- if (date != null) { >- DateFormat formatter = new SimpleDateFormat(LogEntry.F_DATE_FORMAT); >- strDate = formatter.format(date); >- } >- dateLabel.setText(strDate != null ? strDate : ""); //$NON-NLS-1$ >+ String strDate = entry.getFormattedDate(); >+ dateLabel.setText(strDate); > severityImageLabel.setImage(labelProvider.getColumnImage(entry, 0)); > severityLabel.setText(entry.getSeverityText()); > msgText.setText(entry.getMessage() != null ? entry.getMessage() : ""); //$NON-NLS-1$ >Index: src/org/eclipse/pde/internal/runtime/logview/LogEntry.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogEntry.java,v >retrieving revision 1.24 >diff -u -r1.24 LogEntry.java >--- src/org/eclipse/pde/internal/runtime/logview/LogEntry.java 6 Dec 2006 17:08:11 -0000 1.24 >+++ src/org/eclipse/pde/internal/runtime/logview/LogEntry.java 1 Oct 2007 15:07:11 -0000 >@@ -12,9 +12,6 @@ > > import java.io.PrintWriter; > import java.io.StringWriter; >-import com.ibm.icu.text.DateFormat; >-import com.ibm.icu.text.SimpleDateFormat; >- > import java.text.ParseException; > import java.util.ArrayList; > import java.util.Date; >@@ -26,9 +23,12 @@ > import org.eclipse.pde.internal.runtime.PDERuntimeMessages; > import org.eclipse.ui.model.IWorkbenchAdapter; > >+import com.ibm.icu.text.SimpleDateFormat; >+ > public class LogEntry extends PlatformObject implements IWorkbenchAdapter { > > public static final String F_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS"; //$NON-NLS-1$ >+ private static final SimpleDateFormat F_SDF = new SimpleDateFormat(F_DATE_FORMAT); > > private ArrayList children; > private LogEntry parent; >@@ -36,6 +36,7 @@ > private int severity; > private int code; > private Date fDate; >+ private String fDateString; > private String message; > private String stack; > private LogSession session; >@@ -78,6 +79,11 @@ > fDate = new Date(0); // unknown date - return epoch > return fDate; > } >+ public String getFormattedDate() { >+ if (fDateString == null) >+ fDateString = F_SDF.format(getDate()); >+ return fDateString; >+ } > public String getSeverityText() { > return getSeverityText(severity); > } >@@ -180,11 +186,12 @@ > dateBuffer.append(token); > } > } >- DateFormat formatter = new SimpleDateFormat(F_DATE_FORMAT); > try { >- Date date = formatter.parse(dateBuffer.toString()); >- if (date != null) >- fDate = date; >+ Date date = F_SDF.parse(dateBuffer.toString()); >+ if (date != null) { >+ fDate = date; >+ fDateString = F_SDF.format(fDate); >+ } > } catch (ParseException e) { > } > } >@@ -232,11 +239,12 @@ > dateBuffer.append(token); > } > } >- DateFormat formatter = new SimpleDateFormat(F_DATE_FORMAT); > try { >- Date date = formatter.parse(dateBuffer.toString()); >- if (date != null) >- fDate = date; >+ Date date = F_SDF.parse(dateBuffer.toString()); >+ if (date != null) { >+ fDate = date; >+ fDateString = F_SDF.format(fDate); >+ } > } catch (ParseException e) { > } > return depth; >@@ -262,6 +270,7 @@ > severity = status.getSeverity(); > code = status.getCode(); > fDate = new Date(); >+ fDateString = F_SDF.format(fDate); > message = status.getMessage(); > Throwable throwable = status.getException(); > if (throwable != null) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 135633
: 79486