google-code-export / umple

Automatically exported from code.google.com/p/umple
1 stars 0 forks source link

Null pointer exception when superclass of a interface is missing #595

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Compile the following code:

interface A {
  isA B;
}

What is the expected output? What do you see instead?

An error message informing that "B" is missing should appear, instead a 
nullPointerException is thrown.

Original issue reported on code.google.com by CraigBry...@gmail.com on 12 Jun 2014 at 4:11

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi Craig, are you working on this issue?

Original comment by PedroAug...@gmail.com on 17 Jun 2014 at 1:58

GoogleCodeExporter commented 9 years ago

Original comment by PedroAug...@gmail.com on 17 Jun 2014 at 2:31

GoogleCodeExporter commented 9 years ago
Cause:

The method addUnlinkedInterfaceExtends()(UmpleInternalParser_CodeClass.ump) 
includes to a interface the references of other interfaces that the first one 
extends. The problem here is that this method includes to the list of extended 
interfaces any value returned by model.getUmpleInterface(extendName) even if 
this value is null (which means the extended interface is not valid, i.e, does 
not exists).

This null value will cause a NullPointerException when running the 
checkExtendsForCyclesInterface method and consequently will abort the parser 
execution.

Solution:

Verify if the value of the variable is different from Null before including it 
to the extends list of a interface. If it is NULL a warning is raised to inform 
that the the extended element is invalid and was ignored by the parser. 

Original comment by PedroAug...@gmail.com on 17 Jun 2014 at 4:26

GoogleCodeExporter commented 9 years ago
Attached the patch that solve this issue and the summary of it.

Original comment by PedroAug...@gmail.com on 18 Jun 2014 at 3:58

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by TimothyCLethbridge on 5 Aug 2014 at 6:58