Quantcast
Channel: gplex Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 33

Commented Unassigned: AAST.AddUserPredicate throws exception if first exported type does not match [11861]

$
0
0
In AAST.cs, line 282 throws an exception if the first exported type does not match instead of continuing to iterate over the remaining exported types. The line 'hdlr.ListError(mSpan, 96, clsName); return;' should be moved outside of the loop:
```
foreach (Type type in types)
{
if (type.FullName.Equals(clsName, StringComparison.OrdinalIgnoreCase) ||
type.Name.Equals(clsName, StringComparison.OrdinalIgnoreCase))
{
QUT.Gplex.ICharTestFactory factory =
(ICharTestFactory)System.Activator.CreateInstance(type);

if (factory != null)
{
CharTest test = factory.GetDelegate(mthIdnt);
if (test == null)
hdlr.ListError(mSpan, 97, mthIdnt);
else
AddUserPredicate(name, test);
return;
}
}
hdlr.ListError(mSpan, 96, clsName); return;
}
```

becomes:
```
foreach (Type type in types)
{
if (type.FullName.Equals(clsName, StringComparison.OrdinalIgnoreCase) ||
type.Name.Equals(clsName, StringComparison.OrdinalIgnoreCase))
{
QUT.Gplex.ICharTestFactory factory =
(ICharTestFactory)System.Activator.CreateInstance(type);

if (factory != null)
{
CharTest test = factory.GetDelegate(mthIdnt);
if (test == null)
hdlr.ListError(mSpan, 97, mthIdnt);
else
AddUserPredicate(name, test);
return;
}
}
}
hdlr.ListError(mSpan, 96, clsName); return;
```

In the absence of guidelines for contributing, I'll leave it to you to make the change.
Great tool, thanks for putting it out there!
Comments: ** Comment from web user: k_john_gough **

Thanks JosephGray. You will have worked out that my testing did not test the case of a helper assembly with multiple exported classes defined. Sorry about that, and thanks for the fix. I will upload the fix to the repository, so that it gets in the next refresh of the binary releases.
John.


Viewing all articles
Browse latest Browse all 33

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>