Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 416507

Summary: Error Log view does not display child entries for new exceptions
Product: [Eclipse Project] PDE Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: Dani Megert <daniel_megert>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, daniel_megert, stepper
Version: 4.3   
Target Milestone: 4.4 M2   
Hardware: All   
OS: All   
Whiteboard:

Description Dani Megert CLA 2013-09-04 06:39:36 EDT
At least broken since 3.7.

Error Log view does not display child entries for new exceptions.

Test Case:
1. paste the following snippet into the 'Package Explorer':
/* wörst */
public class Bug {}
2. close the editor
3. change the project's encoding to 'US-ASCII'
4. open the 'Error Log' view
5. select the project in the 'Package Explorer'
6. Source > Format
   ==> OK: an entry with children appears in the 'Error Log' view
7. Source > Format
   ==> BUG: an entry without children appears in the 'Error Log' view
Comment 1 Dani Megert CLA 2013-09-04 06:43:07 EDT
The first time (step 6) works because it's the first log entry and there, the view just reads in the .log file. Afterwards entries are created when a log event occurs. Creating an entry (LogView.createLogEntry(IStatus)) does not honor mutli-status and sub-entries.
Comment 3 Eike Stepper CLA 2014-02-18 06:46:50 EST
This fix was not good because it duplicates the children of MultiStatus entries. This code that you've added to LogView.createLogEntry(IStatus) adds new child entries:

	private LogEntry createLogEntry(IStatus status) {
		LogEntry entry = new LogEntry(status);
		// [...]

		if (status.isMultiStatus()) {
			IStatus[] children = status.getChildren();
			for (int i = 0; i < children.length; i++) {
				LogEntry childEntry = createLogEntry(children[i]);
				entry.addChild(childEntry);
				childEntry.setSession(currentSession);
			}
		}

But child entries for the child statuses have already been added in new LogEntry(status). I've submitted a Gerrit review that also fixes the problem that the implicitely created child entries have no session set:

https://git.eclipse.org/r/#/c/22151/
Comment 4 Dani Megert CLA 2014-02-19 11:41:30 EST
(In reply to Eike Stepper from comment #3)
> This fix was not good because it duplicates the children of MultiStatus
> entries.

Can you please provide a test case that surfaces the problem in the UI?

Does your fix still fix the original issue from comment 0?
Comment 5 Dani Megert CLA 2014-02-26 07:19:20 EST
This bug here was fixed in M2. If it surfaces a new problem then please file a new bug report with steps that show the issue in the UI.
Comment 6 Eike Stepper CLA 2014-03-01 03:07:04 EST
(In reply to Dani Megert from comment #5)
> This bug here was fixed in M2. If it surfaces a new problem then please file
> a new bug report with steps that show the issue in the UI.

Done. See bug 429372.

(In reply to Dani Megert from comment #4)
> Does your fix still fix the original issue from comment 0?

Gerrit runs the respective test case and succeeds, right?