zrrk / xtext-utils

Automatically exported from code.google.com/p/xtext-utils
0 stars 0 forks source link

add FluentIssueCollection#withCode #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In comment#1 to issue#1 
http://code.google.com/a/eclipselabs.org/p/xtext-utils/issues/detail?id=1#c1 a 
useful addition was suggested:

----------------------------------------------------
Since an issue code is less variable then the message, it would be useful to 
add a filter for this as well. Something along these lines could be added to 
the code:

public FluentIssueCollection withCode( String code ) {
    FluentIssueCollection res = new FluentIssueCollection(resource, messages);
    for (Issue i: issues) {
        if ( i.getCode().equals(code)) {
            res.addIssue( i );
        }
    }
    if (res.getIssueCount() == 0 ) {
        res.addMessage("no issues found with code '"+code+"'");
    }
    return res;
}

Original issue reported on code.google.com by karsten....@googlemail.com on 26 Apr 2012 at 9:29

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 6a3600df8aa0.

Original comment by karsten....@googlemail.com on 26 Apr 2012 at 11:25