If the provided path was a convoluted path which resolved to the same
path as an existing trace location of the same name, it was incorrectly
considered a different trace and renamed with a numbered suffix.
Change-Id: Ic802cd5ffd83c5a29e422dfddbb0463aca1b372a
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/62136
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-by: Hudson CI
package org.eclipse.tracecompass.tmf.ui.project.model;
import java.io.File;
package org.eclipse.tracecompass.tmf.ui.project.model;
import java.io.File;
+import java.io.IOException;
import java.util.List;
import org.eclipse.core.resources.IFile;
import java.util.List;
import org.eclipse.core.resources.IFile;
*/
private static String getTraceName(String path, IFolder folder) {
String name;
*/
private static String getTraceName(String path, IFolder folder) {
String name;
- final File traceFile = new File(path);
+ File traceFile = new File(path);
+ try {
+ traceFile = traceFile.getCanonicalFile();
+ } catch (IOException e) {
+ /* just use original file path */
+ }
name = traceFile.getName();
for (int i = 2; isWrongMember(folder, name, traceFile); i++) {
name = traceFile.getName() + '(' + i + ')';
name = traceFile.getName();
for (int i = 2; isWrongMember(folder, name, traceFile); i++) {
name = traceFile.getName() + '(' + i + ')';