Skip to content

Commit

Permalink
Bug 578841: Fix unknown trace opening with FTrace
Browse files Browse the repository at this point in the history
No longer pass a negative confidence value from TrimmedFtraceTrace,
while validating if the trace to open is an FTrace or not. This led to
an IllegalArgumentException from TraceValidationStatus that was failing
the opening of a non-FTrace file.

Confidence towards being an FTrace is zero (0) for this specific case,
so this fixed line of code passed a negative confidence value prior. A
complete affected use case description (with steps) is in Bug 578841.

This fix depends on [1]'s own NumberFormatException fix.

[1] https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/190837

Change-Id: I8546cf870ca088f1176685df292b334dec86fe04
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/190968
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
  • Loading branch information
marco-miller committed Feb 24, 2022
1 parent d7171d5 commit 0429681
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public IStatus validate(IProject project, String path) {
IStatus status = super.validate(project, path);
if (status instanceof TraceValidationStatus) {
TraceValidationStatus traceValidationStatus = (TraceValidationStatus) status;
status = new TraceValidationStatus(traceValidationStatus.getConfidence() - 1, traceValidationStatus.getPlugin());
int trimmedConfidence = Math.max(0, traceValidationStatus.getConfidence() - 1);
status = new TraceValidationStatus(trimmedConfidence, traceValidationStatus.getPlugin());
}
return status;
}
Expand Down

0 comments on commit 0429681

Please sign in to comment.