1 | package de.uka.ipd.sdq.stoex.analyser.exceptions; |
2 | |
3 | import de.uka.ipd.sdq.errorhandling.IIssue; |
4 | import de.uka.ipd.sdq.stoex.analyser.visitors.TypeEnum; |
5 | |
6 | public class ExpectedTypeMismatchIssue implements IIssue { |
7 | |
8 | private String expectedType; |
9 | private TypeEnum foundType; |
10 | |
11 | public ExpectedTypeMismatchIssue(TypeEnum expectedType, TypeEnum type) { |
12 | this.expectedType = expectedType.name(); |
13 | this.foundType = type; |
14 | } |
15 | |
16 | public ExpectedTypeMismatchIssue(String expectedType, TypeEnum type) { |
17 | this.expectedType = expectedType; |
18 | this.foundType = type; |
19 | } |
20 | |
21 | public String getMessage() { |
22 | return |
23 | "Expected Type and Actual Type mismatch.\nInfered Type: " + |
24 | ( foundType == null ? "unknown" : foundType.name() ) + |
25 | ", Expected Type: "+expectedType; |
26 | } |
27 | |
28 | } |