Commit 92d084f2 authored by Miklos Magyari's avatar Miklos Magyari
Browse files

possible null exception fix; circular check fix


Signed-off-by: Miklos Magyari's avatarMiklos Magyari <miklos.magyari@sigmatechnology.se>
parent 2840bbd2
......@@ -278,7 +278,9 @@ public final class ClassTypeBody extends TTCN3Scope implements IReferenceChainEl
final Type_type type = returnType != null ? returnType.getTypetypeTtcn3() : null;
final Type_type localType = localReturnType != null ? localReturnType.getTypetypeTtcn3() : null;
if (type != localType) {
localDefinition.getType(timestamp).getLocation().reportSemanticError(RETURNTYPEMISMATCH);
if (localReturnType != null) {
localReturnType.getLocation().reportSemanticError(RETURNTYPEMISMATCH);
}
definition.getType(timestamp).getLocation().reportSemanticError(OVERRIDDENRETURNTYPE);
}
if (! ((Def_Function)definition).getFormalParameterList().isSame(timestamp, ((Def_Function)localDefinition).getFormalParameterList())) {
......
......@@ -138,6 +138,9 @@ public final class ContentAssistProcessor implements IContentAssistProcessor {
}
final CompilationTimeStamp timestamp = tempModule.getLastCompilationTimeStamp();
if (timestamp == null) {
return null;
}
if (ref != null) {
Assignment assignment = scope.getAssBySRef(timestamp, ref);
......@@ -292,6 +295,9 @@ public final class ContentAssistProcessor implements IContentAssistProcessor {
private void getClassProposals(Module module, Reference ref, Scope scope, ProposalCollector propCollector, int offset) {
if (ref != null && scope != null) {
final CompilationTimeStamp timestamp = module.getLastCompilationTimeStamp();
if (timestamp == null) {
return;
}
Assignment assignment = scope.getAssBySRef(timestamp, ref);
if (assignment instanceof Def_Var) {
IType type = assignment.getType(timestamp);
......@@ -344,6 +350,9 @@ public final class ContentAssistProcessor implements IContentAssistProcessor {
private void getFunctionProposals(Module module, Reference functionRef, Scope scope, ProposalCollector propCollector, int offset) {
final CompilationTimeStamp timestamp = module.getLastCompilationTimeStamp();
if (timestamp == null) {
return;
}
if (functionRef != null && scope != null) {
Scope fscope = scope.getAssignmentsScope();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment