Skip to content

Commit c995e3e

Browse files
committed
server: Fix incorrect duplicate trace path detection on Windows
Use NIO instead to create Path for old and new trace path in order to compare them. Fixes #214 Signed-off-by: Bernd Hufmann <[email protected]>
1 parent d14a8dc commit c995e3e

File tree

1 file changed

+2
-2
lines changed
  • trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services

1 file changed

+2
-2
lines changed

trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/TraceManagerService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ private static Response put(String path, String name, String typeID)
203203
}
204204
resource.setPersistentProperty(TmfCommonConstants.TRACETYPE, traceType);
205205
} else {
206-
IPath targetLocation = getTargetLocation(path);
207206
IPath oldLocation = ResourceUtil.getLocation(resource);
208-
if (oldLocation == null || !targetLocation.equals(oldLocation.removeTrailingSeparator()) ||
207+
java.nio.file.Path targetPath = Paths.get(path);
208+
if (oldLocation == null || !targetPath.equals(Paths.get(oldLocation.toString())) ||
209209
!traceType.equals(resource.getPersistentProperty(TmfCommonConstants.TRACETYPE))) {
210210
synchronized (TRACES) {
211211
Optional<@NonNull Entry<UUID, IResource>> oldEntry = TRACES.entrySet().stream().filter(entry -> resource.equals(entry.getValue())).findFirst();

0 commit comments

Comments
 (0)