Fixing issue 961. Check to make sure a subclass does not have an asso… #982

Merged
merged 3 commits into from Feb 4, 2017

Projects

None yet

2 participants

@katcavers
Contributor

…ciation that is not a specialization with the same role name as its superclass.

Description

This PR provides a fix for the case where a subclass declares an association that is named the same as an association in one of its superclasses, but is not a specialization.
Added a new error message (180).

Tests

Added 3 tests to UmpleParserTest.java to test the cases this error should be thrown.

Closes #961

@katcavers katcavers Fixing issue 961. Check to make sure a subclass does not have an asso…
…ciation that is not a specialization with the same role name as its superclass.
863d1bb
@katcavers katcavers requested a review from vahdat-ab Jan 29, 2017
@vahdat-ab
Member

Thanks @katcavers
Please consider the following items.
If the file E180DuplicateRoleNameSubclass.ump is compiled, it outputs two times the error 180.
Your solution cannot detect the following example:

class A{
  0..1 -> * B;
}
class B{
   isA A;
   0..1 -> * D bs;
}
class D{}
@katcavers katcavers Fixing up duplicate generated errors and generated role names conflic…
…ting with user-derived rolenames.
a33b9d2
@vahdat-ab
Member

In the following example, it shows two times the same error message. It doesn't happen in other cases

class A{
  0..1 -> * B;
}
class B{
   isA A;
}
class D{
  isA B;
  0..1 -> * D bs;
}
class C{}

The following example just raises one error, which is correct.

class A{
  0..1 -> * B;
}
class B{
   isA A;
}
class D{
  isA B;
  0..1 -> * C bs;
}
class C{}
@katcavers katcavers Fixing duplicate error message issu 961
a28f9f4
@vahdat-ab
Member

Thanks @katcavers

@vahdat-ab vahdat-ab merged commit 12f6b32 into master Feb 4, 2017

2 of 4 checks passed

continuous-integration/appveyor/branch AppVeyor build failed
Details
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment