Skip to content
This repository has been 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

Open
agoeb opened this issue Nov 4, 2014 · 0 comments
Open

Comments

@agoeb
Copy link

agoeb commented Nov 4, 2014

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant