ITargetHandle[] targets = service.get().getTargets(subMonitor.newChild(20));
boolean hasBeenSet = false;
for (int i = 0; i < targets.length && !hasBeenSet; i++) {
if (targets[i] instanceof WorkspaceFileTargetHandle) {
WorkspaceFileTargetHandle fileHandle = (WorkspaceFileTargetHandle) targets[i];
hasBeenSet = trySetTargetPlatform(targetFileURIToSet, subMonitor, fileHandle);
}
}
}
}