New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when using nested classes for generalization #1159

Closed
TimLethbridge opened this Issue Nov 24, 2017 · 2 comments

Comments

@TimLethbridge
Member

TimLethbridge commented Nov 24, 2017

Umple allows one class to be nested inside another as a way to represent generalization. We believe this feature is not commonly used, but it is useful to illustrate large generalization hierarchies, or for cases where one wants to add a subclass with just a minor difference from a superclass.

However there is a bug in parsing in the following case.

class TopHat{
  class Question{
   boolean status;
  }

 class HomeworkQuestion{
    isA Question;
    Date dueDate;
  }
}

The following is the stack trace:

Exception java.lang.NullPointerException in
java.lang.NullPointerException
	at cruise.umple.compiler.UmpleInternalParser.checkExtendsForCycles(UmpleInternalParser.java:2527)
	at cruise.umple.compiler.UmpleInternalParser.postTokenClassAnalysis(UmpleInternalParser.java:2021)
	at cruise.umple.compiler.UmpleInternalParser.postTokenAnalysis(UmpleInternalParser.java:1286)
	at cruise.umple.compiler.UmpleInternalParser.analyze(UmpleInternalParser.java:1067)
	at cruise.umple.compiler.UmpleModel.run(UmpleModel.java:1463)
	at cruise.umple.UmpleConsoleMain.runConsole(UmpleConsoleMain.java:143)
	at cruise.umple.UmpleConsoleMain.main(UmpleConsoleMain.java:204)

@TimLethbridge

This comment has been minimized.

Show comment
Hide comment
@TimLethbridge

TimLethbridge Jan 13, 2018

Member

Here is another case. I am going to mark this as easy, as I think this should help make this debuggable.

class Hospital {
class Hospital {

}
}
Member

TimLethbridge commented Jan 13, 2018

Here is another case. I am going to mark this as easy, as I think this should help make this debuggable.

class Hospital {
class Hospital {

}
}
@TimLethbridge

This comment has been minimized.

Show comment
Hide comment
@TimLethbridge

TimLethbridge Jan 21, 2018

Member

Fixed by #1201

Member

TimLethbridge commented Jan 21, 2018

Fixed by #1201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment