Skip to content
Permalink
Browse files

added 3 files to explain RuntimeExceptions + modified templates that …

…throw RuntimeExceptions to show links to explanations + modified test files to avoid compilation errors
  • Loading branch information...
fjtheknight committed May 23, 2019
1 parent 0fa8261 commit 760e51426289762e9b2c789f7b09876200a7c560
Showing with 60 additions and 170 deletions.
  1. +1 −1 UmpleToJava/UmpleTLTemplates/constructor_AssociationAssignImmutableOptionalMany.ump
  2. +1 −1 UmpleToJava/UmpleTLTemplates/constructor_AssociationAssignImmutableOptionalN.ump
  3. +1 −1 UmpleToJava/UmpleTLTemplates/constructor_AssociationAssignMandatoryMany.ump
  4. +1 −1 UmpleToJava/UmpleTLTemplates/constructor_AssociationAssignOne.ump
  5. +1 −1 UmpleToJava/UmpleTLTemplates/constructor_AssociationAssignOneToOne.ump
  6. +1 −1 UmpleToJava/UmpleTLTemplates/constructor_AssociationAssignUndirectionalOne.ump
  7. +1 −1 UmpleToJava/UmpleTLTemplates/constructor_AttributeAssignUnique.ump
  8. +1 −1 build/reference/{9605ConstructorAssociationAssignOne.txt → 9601ViolationofImmutability.txt}
  9. +0 −22 build/reference/9602ConstructorAssociationAssignImmutableOptionalMany.txt
  10. +1 −1 ...rence/{9606ConstructorAssociationAssignOneToOne.txt → 9602ViolationofAssociationMultiplicity.txt}
  11. +0 −22 build/reference/9603ConstructorAssociationAssignImmutableOptionalN.txt
  12. +1 −1 build/reference/{9601AssociationGetPrivate.txt → 9603ViolationofUniqueness.txt}
  13. +0 −22 build/reference/9604ConstructorAssociationAssignMandatoryMany.txt
  14. +0 −22 build/reference/9607ConstructorAssociationAssignUndirectionalOne.txt
  15. +0 −22 build/reference/9608ConstructorAttributeAssignUnique.txt
  16. +4 −4 cruise.umple/test/cruise/umple/compiler/RegularFlight.java.txt
  17. +1 −1 cruise.umple/test/cruise/umple/implementation/java/AssociationImportTest_Aware.java.txt
  18. +3 −3 cruise.umple/test/cruise/umple/implementation/java/CascadeDeleteC.java.txt
  19. +1 −1 cruise.umple/test/cruise/umple/implementation/java/CascadeDeleteD.java.txt
  20. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ClassTemplateTest_Attributes.java.txt
  21. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ClassTemplateTest_Import2.java.txt
  22. +4 −4 cruise.umple/test/cruise/umple/implementation/java/CodeInjectionTest_Association.java.txt
  23. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ImmutableUnidirectionalMNTest.java.txt
  24. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ImmutableUnidirectionalMStarTest.java.txt
  25. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ImmutableUnidirectionalManyTest.java.txt
  26. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ImmutableUnidirectionalNTest.java.txt
  27. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ImmutableUnidirectionalOneTest.java.txt
  28. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ImmutableUnidirectionalOptionalNTest.java.txt
  29. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ManyToMNTest_Many.java.txt
  30. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ManyToMStarTest_Many.java.txt
  31. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ManyToNTest_Many.java.txt
  32. +1 −1 cruise.umple/test/cruise/umple/implementation/java/OneToMNTest_MN.java.txt
  33. +1 −1 cruise.umple/test/cruise/umple/implementation/java/OneToMandatoryManyTest_Many.java.txt
  34. +1 −1 cruise.umple/test/cruise/umple/implementation/java/OneToManyTest_Many.java.txt
  35. +1 −1 cruise.umple/test/cruise/umple/implementation/java/OneToNTest_N.java.txt
  36. +1 −1 cruise.umple/test/cruise/umple/implementation/java/OneToOneTest_Association.java.txt
  37. +1 −1 cruise.umple/test/cruise/umple/implementation/java/OneToOneTest_Association2.java.txt
  38. +1 −1 cruise.umple/test/cruise/umple/implementation/java/OneToOptionalNTest_OptionalN.java.txt
  39. +1 −1 cruise.umple/test/cruise/umple/implementation/java/OneToOptionalOneTest_Subordinate.java.txt
  40. +1 −1 cruise.umple/test/cruise/umple/implementation/java/OptionalOneToMNTest_One.java.txt
  41. +1 −1 cruise.umple/test/cruise/umple/implementation/java/OptionalOneToMStarTest_One.java.txt
  42. +1 −1 cruise.umple/test/cruise/umple/implementation/java/OptionalOneToNTest_One.java.txt
  43. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ReflexiveAssociationTest_OneSymmetric.java.txt
  44. +1 −1 ...umple/test/cruise/umple/implementation/java/ReflexiveAssociationTest_OneSymmetricNoParam.java.txt
  45. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ReflexiveAssociationTest_OneToMany.java.txt
  46. +1 −1 cruise.umple/test/cruise/umple/implementation/java/TestUmpleEnumerations_2.java.txt
  47. +1 −1 cruise.umple/test/cruise/umple/implementation/java/UnidirectionalMNTest_Aware.java.txt
  48. +1 −1 cruise.umple/test/cruise/umple/implementation/java/UnidirectionalMStarTest_Aware.java.txt
  49. +1 −1 cruise.umple/test/cruise/umple/implementation/java/UnidirectionalNTest_Aware.java.txt
  50. +1 −1 cruise.umple/test/cruise/umple/implementation/java/UnidirectionalOneTest_Aware.java.txt
  51. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ecommerce/RMI0/Order.java.txt
  52. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ecommerce/RMI0/Product.java.txt
  53. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ecommerce/RMI1/Order.java.txt
  54. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ecommerce/RMI1/Product.java.txt
  55. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ecommerce/WS/Order.java.txt
  56. +1 −1 cruise.umple/test/cruise/umple/implementation/java/ecommerce/WS/Product.java.txt
  57. +1 −1 ...ple/test/cruise/umple/statemachine/implementation/java/nestedStateMachineExtendedByClass.java.txt
@@ -4,6 +4,6 @@ class UmpleToJava {
boolean <<=gen.translate("didAddMany",av)>> = <<=gen.translate("setManyMethod",av)>>(<<=gen.translate("parameterAll",av)>>);
if (!<<=gen.translate("didAddMany",av)>>)
{
throw new RuntimeException("Unable to create <<=gen.relatedTranslate("type",av)>>, must not have duplicate <<=gen.translate("associationMany",av)>>.");
throw new RuntimeException("Unable to create <<=gen.relatedTranslate("type",av)>>, must not have duplicate <<=gen.translate("associationMany",av)>>. See http://manual.umple.org?RE001ViolationofImmutability.html");
}!>>
}
@@ -4,6 +4,6 @@ class UmpleToJava {
boolean <<=gen.translate("didAddMany",av)>> = <<=gen.translate("setManyMethod",av)>>(<<=gen.translate("parameterAll",av)>>);
if (!<<=gen.translate("didAddMany",av)>>)
{
throw new RuntimeException("Unable to create <<=gen.relatedTranslate("type",av)>>, must have <<=requiredNumber>> or fewer <<=gen.translate("associationMany",av)>>, no duplicates.");
throw new RuntimeException("Unable to create <<=gen.relatedTranslate("type",av)>>, must have <<=requiredNumber>> or fewer <<=gen.translate("associationMany",av)>>, no duplicates. See http://manual.umple.org?RE001ViolationofImmutability.html");
}!>>
}
@@ -19,6 +19,6 @@ class UmpleToJava {
boolean <<=gen.translate("didAddMany",av)>> = <<=gen.translate("setManyMethod",av)>>(<<=gen.translate("parameterAll",av)>>);
if (!<<=gen.translate("didAddMany",av)>>)
{
throw new RuntimeException("Unable to create <<=gen.relatedTranslate("type",av)>>, must have <<=requiredNumber>> <<=gen.translate("associationMany",av)>>");
throw new RuntimeException("Unable to create <<=gen.relatedTranslate("type",av)>>, must have <<=requiredNumber>> <<=gen.translate("associationMany",av)>>. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}!>>
}
@@ -3,6 +3,6 @@ class UmpleToJava {
boolean <<=gen.translate("didAdd",av)>> = <<=gen.translate("setMethod",av)>>(<<=gen.translate("parameterOne",av)>>);
if (!<<=gen.translate("didAdd",av)>>)
{
throw new RuntimeException("Unable to create <<=gen.relatedTranslate("associationOne",av)>> due to <<=gen.translate("associationOne",av)>>");
throw new RuntimeException("Unable to create <<=gen.relatedTranslate("associationOne",av)>> due to <<=gen.translate("associationOne",av)>>. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}!>>
}
@@ -2,7 +2,7 @@ class UmpleToJava {
constructor_AssociationAssignOneToOne <<!<</*constructor_AssociationAssignOneToOne*/>>
if (<<=gen.translate("parameterOne",av)>> == null || <<=gen.translate("parameterOne",av)>>.<<=gen.relatedTranslate("getMethod",av)>>() != null)
{
throw new RuntimeException("Unable to create <<=gen.relatedTranslate("type",av)>> due to <<=gen.translate("parameterOne",av)>>");
throw new RuntimeException("Unable to create <<=gen.relatedTranslate("type",av)>> due to <<=gen.translate("parameterOne",av)>>. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
<<=gen.translate("associationOne",av)>> = <<=gen.translate("parameterOne",av)>>;!>>
}
@@ -2,6 +2,6 @@ class UmpleToJava {
constructor_AssociationAssignUndirectionalOne <<!<</*constructor_AssociationAssignUndirectionalOne*/>>
if (!<<=gen.translate("setMethod",av)>>(<<=gen.translate("parameterOne",av)>>))
{
throw new RuntimeException("Unable to create <<=gen.relatedTranslate("type",av)>> due to <<=gen.translate("parameterOne",av)>>");
throw new RuntimeException("Unable to create <<=gen.relatedTranslate("type",av)>> due to <<=gen.translate("parameterOne",av)>>. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}!>>
}
@@ -2,6 +2,6 @@ class UmpleToJava {
constructor_AttributeAssignUnique <<!<</*constructor_AttributeAssignUnique*/>>
if (!<<=gen.translate("setMethod", av)>>(<<=gen.translate("parameterOne", av)>>))
{
throw new RuntimeException("Cannot create due to duplicate <<=av.getName()>>");
throw new RuntimeException("Cannot create due to duplicate <<=av.getName()>>. See http://manual.umple.org?RE003ViolationofUniqueness.html");
}!>>
}
@@ -1,4 +1,4 @@
RE005 ConstructorAssociationAssignOne.
RE001 Violation of Immutability
Runtime Exceptions
noreferences

This file was deleted.

@@ -1,4 +1,4 @@
RE006 ConstructorAssociationAssignOneToOne.
RE002 Violation of Association Multiplicity
Runtime Exceptions
noreferences

This file was deleted.

@@ -1,4 +1,4 @@
RE001 AssociationGetPrivate
RE003 Violation of Uniqueness
Runtime Exceptions
noreferences

This file was deleted.

This file was deleted.

This file was deleted.

@@ -37,19 +37,19 @@ public class RegularFlight
time = aTime;
if (!setFlightNumber(aFlightNumber))
{
throw new RuntimeException("Cannot create due to duplicate flightNumber");
throw new RuntimeException("Cannot create due to duplicate flightNumber. See http://manual.umple.org?RE003ViolationofUniqueness.html");
}
if (!setFlightNumber3(aFlightNumber3))
{
throw new RuntimeException("Cannot create due to duplicate flightNumber3");
throw new RuntimeException("Cannot create due to duplicate flightNumber3. See http://manual.umple.org?RE003ViolationofUniqueness.html");
}
if (!setFlightNumber4(aFlightNumber4))
{
throw new RuntimeException("Cannot create due to duplicate flightNumber4");
throw new RuntimeException("Cannot create due to duplicate flightNumber4. See http://manual.umple.org?RE003ViolationofUniqueness.html");
}
if (!setLala(aLala))
{
throw new RuntimeException("Cannot create due to duplicate lala");
throw new RuntimeException("Cannot create due to duplicate lala. See http://manual.umple.org?RE003ViolationofUniqueness.html");
}
}

@@ -22,7 +22,7 @@ public class Mentor
{
if (!setStudent(aStudent))
{
throw new RuntimeException("Unable to create Mentor due to aStudent");
throw new RuntimeException("Unable to create Mentor due to aStudent. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
}

@@ -23,13 +23,13 @@ public class C
{
if (aMyD == null || aMyD.getC() != null)
{
throw new RuntimeException("Unable to create C due to aMyD");
throw new RuntimeException("Unable to create C due to aMyD. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
myD = aMyD;
boolean didAddB = setB(aB);
if (!didAddB)
{
throw new RuntimeException("Unable to create myC due to b");
throw new RuntimeException("Unable to create myC due to b. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
}

@@ -39,7 +39,7 @@ public class C
boolean didAddB = setB(aB);
if (!didAddB)
{
throw new RuntimeException("Unable to create myC due to b");
throw new RuntimeException("Unable to create myC due to b. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
}

@@ -22,7 +22,7 @@ public class D
{
if (aC == null || aC.getMyD() != null)
{
throw new RuntimeException("Unable to create D due to aC");
throw new RuntimeException("Unable to create D due to aC. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
c = aC;
}
@@ -75,7 +75,7 @@ public class Mentor
x = nextX++;
if (!setId(aId))
{
throw new RuntimeException("Cannot create due to duplicate id");
throw new RuntimeException("Cannot create due to duplicate id. See http://manual.umple.org?RE003ViolationofUniqueness.html");
}
}

@@ -31,7 +31,7 @@ public class Student
boolean didAddMentors = setMentors(allMentors);
if (!didAddMentors)
{
throw new RuntimeException("Unable to create Student, must have at least 1 mentors");
throw new RuntimeException("Unable to create Student, must have at least 1 mentors. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
courses = new ArrayList<Course>();
}
@@ -28,25 +28,25 @@ public class Student
boolean didAddM2 = setM2(aM2);
if (!didAddM2)
{
throw new RuntimeException("Unable to create two due to m2");
throw new RuntimeException("Unable to create two due to m2. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
m3s = new ArrayList<Mentor>();
boolean didAddM3s = setM3s(allM3s);
if (!didAddM3s)
{
throw new RuntimeException("Unable to create Student, must have 1 to 3 m3s");
throw new RuntimeException("Unable to create Student, must have 1 to 3 m3s. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
m4s = new ArrayList<Mentor>();
boolean didAddM4s = setM4s(allM4s);
if (!didAddM4s)
{
throw new RuntimeException("Unable to create Student, must have 4 to 7 m4s");
throw new RuntimeException("Unable to create Student, must have 4 to 7 m4s. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
m5s = new ArrayList<Mentor>();
boolean didAddM5s = setM5s(allM5s);
if (!didAddM5s)
{
throw new RuntimeException("Unable to create Student, must have at least 2 m5s");
throw new RuntimeException("Unable to create Student, must have at least 2 m5s. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
m6s = new ArrayList<Mentor>();
}
@@ -32,7 +32,7 @@ public class Student
boolean didAddMentors = setMentors(allMentors);
if (!didAddMentors)
{
throw new RuntimeException("Unable to create Student, must have 2 to 4 mentors");
throw new RuntimeException("Unable to create Student, must have 2 to 4 mentors. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
}

@@ -32,7 +32,7 @@ public class Student
boolean didAddMentors = setMentors(allMentors);
if (!didAddMentors)
{
throw new RuntimeException("Unable to create Student, must have at least 1 mentors");
throw new RuntimeException("Unable to create Student, must have at least 1 mentors. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
}

@@ -32,7 +32,7 @@ public class Student
boolean didAddMentors = setMentors(allMentors);
if (!didAddMentors)
{
throw new RuntimeException("Unable to create Student, must not have duplicate mentors.");
throw new RuntimeException("Unable to create Student, must not have duplicate mentors. See http://manual.umple.org?RE001ViolationofImmutability.html");
}
}

@@ -32,7 +32,7 @@ public class Student
boolean didAddMentors = setMentors(allMentors);
if (!didAddMentors)
{
throw new RuntimeException("Unable to create Student, must have 3 mentors");
throw new RuntimeException("Unable to create Student, must have 3 mentors. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
}

@@ -29,7 +29,7 @@ public class Student
canSetMentor = true;
if (!setMentor(aMentor))
{
throw new RuntimeException("Unable to create Student due to aMentor");
throw new RuntimeException("Unable to create Student due to aMentor. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
}

@@ -32,7 +32,7 @@ public class Student
boolean didAddMentors = setMentors(allMentors);
if (!didAddMentors)
{
throw new RuntimeException("Unable to create Student, must have 3 or fewer mentors, no duplicates.");
throw new RuntimeException("Unable to create Student, must have 3 or fewer mentors, no duplicates. See http://manual.umple.org?RE001ViolationofImmutability.html");
}
}

@@ -28,7 +28,7 @@ public class Mentor
boolean didAddStudents = setStudents(allStudents);
if (!didAddStudents)
{
throw new RuntimeException("Unable to create Mentor, must have 3 to 4 students");
throw new RuntimeException("Unable to create Mentor, must have 3 to 4 students. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
}

@@ -28,7 +28,7 @@ public class Mentor
boolean didAddStudents = setStudents(allStudents);
if (!didAddStudents)
{
throw new RuntimeException("Unable to create Mentor, must have at least 4 students");
throw new RuntimeException("Unable to create Mentor, must have at least 4 students. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
}

@@ -28,7 +28,7 @@ public class Mentor
boolean didAddStudents = setStudents(allStudents);
if (!didAddStudents)
{
throw new RuntimeException("Unable to create Mentor, must have 2 students");
throw new RuntimeException("Unable to create Mentor, must have 2 students. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
}

@@ -26,7 +26,7 @@ public class Pupil
boolean didAddMentor = setMentor(aMentor);
if (!didAddMentor)
{
throw new RuntimeException("Unable to create pupil due to mentor");
throw new RuntimeException("Unable to create pupil due to mentor. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
}

0 comments on commit 760e514

Please sign in to comment.
You can’t perform that action at this time.