Commit 5ed9de87 authored by Kristof Szabados's avatar Kristof Szabados
Browse files

minor bugfix: while the export contained all code smells from all


reachable project, the task markers were only added from the actual
project.
Signed-off-by: Kristof Szabados's avatarkristof <Kristof.Szabados@ericsson.com>
parent cf971112
......@@ -7,24 +7,25 @@
******************************************************************************/
package org.eclipse.titanium.markers.export;
import static org.eclipse.titan.designer.preferences.PreferenceConstants.DISPLAYDEBUGINFORMATION;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.titan.designer.GeneralConstants;
import org.eclipse.titan.designer.productUtilities.ProductConstants;
import org.eclipse.titanium.markers.types.TaskType;
import static org.eclipse.titan.designer.preferences.PreferenceConstants.DISPLAYDEBUGINFORMATION;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.titan.designer.GeneralConstants;
import org.eclipse.titan.designer.core.ProjectBasedBuilder;
import org.eclipse.titan.designer.productUtilities.ProductConstants;
import org.eclipse.titanium.markers.types.TaskType;
/**
* This class provides a skeleton for code smell exporting.
......@@ -53,20 +54,23 @@ public abstract class BaseProblemExporter {
* @throws CoreException
*/
protected Map<TaskType, List<IMarker>> collectMarkers() throws CoreException {
IMarker[] ms = project.findMarkers(GeneralConstants.ONTHEFLY_TASK_MARKER, false, IResource.DEPTH_INFINITE);
Map<TaskType, List<IMarker>> markers = new EnumMap<TaskType, List<IMarker>>(TaskType.class);
for (TaskType t : TaskType.values()) {
markers.put(t, new ArrayList<IMarker>());
}
List<IProject> projects = ProjectBasedBuilder.getProjectBasedBuilder(project).getAllReachableProjects();
for(IProject tempProject : projects) {
IMarker[] ms = tempProject.findMarkers(GeneralConstants.ONTHEFLY_TASK_MARKER, false, IResource.DEPTH_INFINITE);
for (IMarker m : ms) {
for (TaskType t : TaskType.values()) {
if (t.equalType(m)) {
markers.get(t).add(m);
}
}
}
}
for (IMarker m : ms) {
for (TaskType t : TaskType.values()) {
if (t.equalType(m)) {
markers.get(t).add(m);
}
}
}
ms = null;
return markers;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment