Bug 429372 - [patch] ErrorLog view duplicates statuses
Summary: [patch] ErrorLog view duplicates statuses
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.4 RC1   Edit
Assignee: Eike Stepper CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
: 433068 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-03-01 02:56 EST by Eike Stepper CLA
Modified: 2014-05-13 06:08 EDT (History)
5 users (show)

See Also:
daniel_megert: review+


Attachments
Target file to reproduce the problem (454 bytes, application/octet-stream)
2014-03-01 02:56 EST, Eike Stepper CLA
no flags Details
Screenshot of the problem (65.17 KB, image/png)
2014-03-01 02:56 EST, Eike Stepper CLA
no flags Details
Screenshot with my fix applied (28.40 KB, image/png)
2014-03-01 03:00 EST, Eike Stepper CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Stepper CLA 2014-03-01 02:56:00 EST
Created attachment 240423 [details]
Target file to reproduce the problem

The ErrorLog view duplicates the children of MultiStatus entries. This code that has been changed in the context of bug 416507 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).

The problem can be reproduced with the attached test.target file. Just open it in an IDE and "Set as Target Platform". It shouldn't be able to resolve properly and as a result add nested multi statuses. They're displayed incorrectly in the ErrorLog view as you can see in the screenshot that I'll also attach.

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 1 Eike Stepper CLA 2014-03-01 02:56:44 EST
Created attachment 240424 [details]
Screenshot of the problem
Comment 2 Eike Stepper CLA 2014-03-01 03:00:54 EST
Created attachment 240425 [details]
Screenshot with my fix applied
Comment 3 Curtis Windatt CLA 2014-04-22 16:30:49 EDT
*** Bug 433068 has been marked as a duplicate of this bug. ***
Comment 4 Dani Megert CLA 2014-05-09 07:03:14 EDT
Loading the attached target definition file in 4.4 M7:
http://download.eclipse.org/eclipse/downloads/drops4/S-4.4M7-201405010200/

gives me this .log below [1], and that log has 2 identical sub-entries, hence it's OK to display them. I also tried to reproduce the problem with the test case from duplicate bug 433068, but no "luck" either.


[1]

!ENTRY org.eclipse.pde.core 4 0 2014-05-09 12:50:32.772
!MESSAGE The current target platform contains errors, open Window > Preferences > Plug-in Development > Target Platform for details.
!STACK 1
org.eclipse.core.runtime.CoreException: Problems occurred getting the plug-ins in this container
	at org.eclipse.pde.internal.core.PluginModelManager.getExternalBundles(PluginModelManager.java:604)
	at org.eclipse.pde.internal.core.PluginModelManager.initializeTable(PluginModelManager.java:525)
	at org.eclipse.pde.internal.core.PluginModelManager.targetReloaded(PluginModelManager.java:473)
	at org.eclipse.pde.core.target.LoadTargetDefinitionJob.resetPlatform(LoadTargetDefinitionJob.java:229)
	at org.eclipse.pde.core.target.LoadTargetDefinitionJob.runInWorkspace(LoadTargetDefinitionJob.java:150)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Contains: Unable to locate installable unit org.eclipse.jgit.feature.group
!SUBENTRY 1 org.eclipse.pde.core 4 0 2014-05-09 12:50:32.772
!MESSAGE Problems occurred getting the plug-ins in this container
!SUBENTRY 2 org.eclipse.pde.core 4 0 2014-05-09 12:50:32.773
!MESSAGE Unable to locate installable unit org.eclipse.jgit.feature.group
Comment 5 Dani Megert CLA 2014-05-12 08:09:08 EDT
I see it now. The code path for the first and the subsequent entries differs, that's why I didn't see the problem.

Submitted your fix with http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=64f18e8e68c851915c823f397b50f3f3fc1f4f69

Thanks Eike!
Comment 6 Dani Megert CLA 2014-05-12 08:09:48 EDT
(In reply to Dani Megert from comment #5)
> Submitted your fix with
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?id=64f18e8e68c851915c823f397b50f3f3fc1f4f69

http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=64f18e8e68c851915c823f397b50f3f3fc1f4f69
Comment 8 Eike Stepper CLA 2014-05-12 09:47:11 EDT
> Thanks Eike!

You're welcome ;-)
Comment 9 Dani Megert CLA 2014-05-13 06:08:59 EDT
Verified in I20140512-2000.