Skip to content
This repository was archived by the owner on May 29, 2024. It is now read-only.
This repository was archived by the owner on May 29, 2024. It is now read-only.

Crash in C# analysis if Gendarme report contains unknown line locations. #2

@agoeb

Description

@agoeb

I'm reporting this on behalf of a student I just supported in tracking down the issue. Even if it will not be fixed, this entry might help people in similar situations, since there is a workaround.

If the Quamoco tooling is used on a C# system for which the Gendarme report contains findings with a location of "≈unknown", the GendarmeReportReader creates Findings that are attached to the corresponding C# file rather than a particular line. If the finding has a MeasurementEvaluation assigned in the quality model that uses a range, the corresponding RangeResolver performs an unchecked type cast on the finding's location to TextRegionLocation in order to get the line number. This type cast fails for findings with unknown line numbers, since their location is of type ElementLocation.

java.lang.ClassCastException: org.conqat.engine.commons.findings.location.ElementLocation cannot be cast to org.conqat.engine.commons.findings.location.TextRegionLocation at edu.tum.cs.conqat.quamoco.understand.ranges.ClassRangeResolverUnderstandBased.obtainRegion(ClassRangeResolverUnderstandBased.java:124) at edu.tum.cs.conqat.quamoco.qiesl.QIESLFunctions.classRange(QIESLFunctions.java:554)

A fix would of course be to check the Location type before casting, but at mentioned in issue #1 the code does not compile due to missing dependencies. A workaround is to remove the respective findings from the Gendarme report or to manually insert valid line numbers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions