use of org.eclipse.titan.designer.AST.TTCN3.statements.Function_Instance_Statement in project titan.EclipsePlug-ins by eclipse.
the class UnusedRetval method process.
@Override
public void process(final IVisitableNode node, final Problems problems) {
if (node instanceof Unknown_Instance_Statement) {
final Unknown_Instance_Statement u = (Unknown_Instance_Statement) node;
final Statement s = u.getRealStatement();
if (s instanceof Function_Instance_Statement) {
final Function_Instance_Statement f = (Function_Instance_Statement) s;
final Assignment assignment = f.getReference().getRefdAssignment(CompilationTimeStamp.getBaseTimestamp(), false);
if (assignment != null) {
String msg;
switch(assignment.getAssignmentType()) {
case A_FUNCTION_RVAL:
case A_EXT_FUNCTION_RVAL:
msg = MessageFormat.format(UNUSEDRETURN1, assignment.getIdentifier().getDisplayName());
problems.report(f.getLocation(), msg);
break;
case A_FUNCTION_RTEMP:
case A_EXT_FUNCTION_RTEMP:
msg = MessageFormat.format(UNUSEDRETURN2, assignment.getIdentifier().getDisplayName());
problems.report(f.getLocation(), msg);
break;
default:
break;
}
}
}
}
}
Aggregations