NPE if extension attribute string is empty
Submitted by Arpad Lovassy
Assigned to Arpad Lovassy
Link to original bug (#509294)
Description
NPE if extension attribute string is empty
Typically it happens during typing
java.lang.NullPointerException
at java.io.StringReader.<init>
(StringReader.java:50)
at org.eclipse.titan.designer.parsers.extensionattributeparser.ExtensionAttributeAnalyzer.parse(ExtensionAttributeAnalyzer.java:47)
at org.eclipse.titan.designer.AST.TTCN3.types.PortTypeBody.checkAttributes(PortTypeBody.java:681)
at org.eclipse.titan.designer.AST.TTCN3.types.Port_Type.check(Port_Type.java:125)
at org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Type.check(Def_Type.java:184)
at org.eclipse.titan.designer.AST.TTCN3.definitions.Def_Type.check(Def_Type.java:162)
at org.eclipse.titan.designer.AST.TTCN3.definitions.Definitions.check(Definitions.java:396)
at org.eclipse.titan.designer.AST.TTCN3.definitions.TTCN3Module.check(TTCN3Module.java:443)
at org.eclipse.titan.designer.AST.brokenpartsanalyzers.BrokenPartsViaReferences.processStartModules(BrokenPartsViaReferences.java:402)
at org.eclipse.titan.designer.AST.brokenpartsanalyzers.BrokenPartsViaReferences.collectBrokenParts(BrokenPartsViaReferences.java:249)
at org.eclipse.titan.designer.AST.brokenpartsanalyzers.BrokenPartsViaReferences.execute(BrokenPartsViaReferences.java:91)
at org.eclipse.titan.designer.parsers.ProjectSourceSemanticAnalyzer.analyzeMultipleProjectsSemantically(ProjectSourceSemanticAnalyzer.java:395)
at org.eclipse.titan.designer.parsers.ProjectSourceParser.internalDoAnalyzeWithReferences(ProjectSourceParser.java:770)
at org.eclipse.titan.designer.parsers.ProjectSourceParser.access$4(ProjectSourceParser.java:668)
at org.eclipse.titan.designer.parsers.ProjectSourceParser$10.runInWorkspace(ProjectSourceParser.java:968)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Example code 1: code to start with. Start typing after "extensio", pressing the "n" will make the NPE happen immediatelly
module Test {
type record R {}
type port PT message { inout R } with { extensio
type component CT { port PT p }
}
Example code 2: complete code
module Test {
type record R {}
type port PT message { inout R } with { extension "internal" }
type component CT { port PT p }
}