Skip to content

Commit

Permalink
Merge pull request #1458 from umple/issue1456
Browse files Browse the repository at this point in the history
Fixes #1456 Runtime Exceptions
  • Loading branch information
TimLethbridge committed Jun 10, 2019
2 parents b171966 + 6353eaa commit c82c08d
Show file tree
Hide file tree
Showing 185 changed files with 507 additions and 277 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)>>;!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ class UmpleToPhp {
$<<=gen.translate("didAddMany",av)>> = $<<=instanceIdentifier>>-><<=gen.translate("setManyMethod",av)>>($<<=gen.translate("parameterAll",av)>>);
if (!$<<=gen.translate("didAddMany",av)>>)
{
throw new Exception("Unable to create <<=gen.relatedTranslate("type",av)>>, must not have duplicate <<=gen.translate("associationMany",av)>>.");
throw new Exception("Unable to create <<=gen.relatedTranslate("type",av)>>, must not have duplicate <<=gen.translate("associationMany",av)>>. See http://manual.umple.org?RE001ViolationofImmutability.html");
}!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ class UmpleToPhp {
$<<=gen.translate("didAddMany",av)>> = $<<=instanceIdentifier>>-><<=gen.translate("setManyMethod",av)>>($<<=gen.translate("parameterAll",av)>>);
if (!$<<=gen.translate("didAddMany",av)>>)
{
throw new Exception("Unable to create <<=gen.relatedTranslate("type",av)>>, must have <<=requiredNumber>> or fewer <<=gen.translate("associationMany",av)>>, no duplicates.");
throw new Exception("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");
}!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ class UmpleToPhp {
$<<=gen.translate("didAddMany",av)>> = $<<=instanceIdentifier>>-><<=gen.translate("setManyMethod",av)>>($<<=gen.translate("parameterAll",av)>>);
if (!$<<=gen.translate("didAddMany",av)>>)
{
throw new Exception("Unable to create <<=gen.relatedTranslate("type",av)>>, must have <<=requiredNumber>> <<=gen.translate("associationMany",av)>>");
throw new Exception("Unable to create <<=gen.relatedTranslate("type",av)>>, must have <<=requiredNumber>> <<=gen.translate("associationMany",av)>>. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ class UmpleToPhp {
$<<=gen.translate("didAdd",av)>> = $<<=instanceIdentifier>>-><<=gen.translate("setMethod",av)>>($<<=gen.translate("parameterOne",av)>>);
if (!$<<=gen.translate("didAdd",av)>>)
{
throw new Exception("Unable to create <<=gen.relatedTranslate("associationOne",av)>> due to <<=gen.translate("associationOne",av)>>");
throw new Exception("Unable to create <<=gen.relatedTranslate("associationOne",av)>> due to <<=gen.translate("associationOne",av)>>. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class UmpleToPhp {
constructor_AssociationAssignOneToOne <<!<</*constructor_AssociationAssignOneToOne*/>>
if ($<<=gen.translate("parameterOne",av)>> == null || $<<=gen.translate("parameterOne",av)>>-><<=gen.relatedTranslate("getMethod",av)>>() != null)
{
throw new Exception("Unable to create <<=gen.relatedTranslate("type",av)>> due to <<=gen.translate("parameterOne",av)>>");
throw new Exception("Unable to create <<=gen.relatedTranslate("type",av)>> due to <<=gen.translate("parameterOne",av)>>. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
$<<=instanceIdentifier>>-><<=gen.translate("associationOne",av)>> = $<<=gen.translate("parameterOne",av)>>;!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ class UmpleToPhp {
constructor_AssociationAssignUndirectionalOne <<!<</*constructor_AssociationAssignUndirectionalOne*/>>
if (!$<<=instanceIdentifier>>-><<=gen.translate("setMethod",av)>>($<<=gen.translate("parameterOne",av)>>))
{
throw new Exception("Unable to create <<=gen.relatedTranslate("type",av)>> due to <<=gen.translate("parameterOne",av)>>");
throw new Exception("Unable to create <<=gen.relatedTranslate("type",av)>> due to <<=gen.translate("parameterOne",av)>>. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ class UmpleToPhp {
constructor_AttributeAssignUnique <<!<</*constructor_AttributeAssignUnique*/>>
if (!$this-><<=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");
}!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ class UmpleToRuby {
constructor_AssociationAssignImmutableOptionalMany <<!<</*constructor_AssociationAssignImmutableOptionalMany*/>>
@<<=gen.translate("associationMany",av)>> = []
<<=gen.translate("didAddMany",av)>> = <<=gen.translate("setManyMethod",av)>>(<<=gen.translate("parameterAll",av)>>)
raise "Unable to create <<=gen.relatedTranslate("type",av)>>, must not have duplicate @<<=gen.translate("associationMany",av)>>" unless <<=gen.translate("didAddMany",av)>>!>>
raise "Unable to create <<=gen.relatedTranslate("type",av)>>, must not have duplicate @<<=gen.translate("associationMany",av)>>. See http://manual.umple.org?RE001ViolationofImmutability.html" unless <<=gen.translate("didAddMany",av)>>!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ class UmpleToRuby {
constructor_AssociationAssignImmutableOptionalN <<!<</*constructor_AssociationAssignImmutableOptionalN*/>><<# String requiredNumber = "" + av.getMultiplicity().getUpperBound(); #>>
@<<=gen.translate("associationMany",av)>> = []
<<=gen.translate("didAddMany",av)>> = <<=gen.translate("setManyMethod",av)>>(<<=gen.translate("parameterAll",av)>>)
raise "Unable to create <<=gen.relatedTranslate("type",av)>>, must have <<=requiredNumber>> or fewer @<<=gen.translate("associationMany",av)>>, no duplicates" unless <<=gen.translate("didAddMany",av)>>!>>
raise "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" unless <<=gen.translate("didAddMany",av)>>!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ class UmpleToRuby {
#>>
@<<=gen.translate("associationMany",av)>> = []
<<=gen.translate("didAddMany",av)>> = <<=gen.translate("setManyMethod",av)>>(<<=gen.translate("parameterAll",av)>>)
raise "Unable to create <<=gen.relatedTranslate("type",av)>>, must have <<=requiredNumber>> @<<=gen.translate("associationMany",av)>>" unless <<=gen.translate("didAddMany",av)>>!>>
}
raise "Unable to create <<=gen.relatedTranslate("type",av)>>, must have <<=requiredNumber>> @<<=gen.translate("associationMany",av)>>. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html" unless <<=gen.translate("didAddMany",av)>>!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ class UmpleToRuby {
constructor_AssociationAssignOne <<!<</*constructor_AssociationAssignOne*/>>
@<<=gen.translate("associationOne",av)>> = nil
<<=gen.translate("didAdd",av)>> = <<=gen.translate("setMethod",av)>>(<<=gen.translate("parameterOne",av)>>)
raise "Unable to create <<=gen.relatedTranslate("associationOne",av)>> due to @<<=gen.translate("associationOne",av)>>" unless <<=gen.translate("didAdd",av)>>!>>
raise "Unable to create <<=gen.relatedTranslate("associationOne",av)>> due to @<<=gen.translate("associationOne",av)>>. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html" unless <<=gen.translate("didAdd",av)>>!>>
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class UmpleToRuby {
constructor_AssociationAssignUndirectionalOne <<!<</*constructor_AssociationAssignUndirectionalOne*/>>
unless <<=gen.translate("setMethod",av)>>(<<=gen.translate("parameterOne",av)>>)
raise "Unable to create <<=gen.relatedTranslate("type",av)>> due to <<=gen.translate("parameterOne",av)>>"
raise "Unable to create <<=gen.relatedTranslate("type",av)>> due to <<=gen.translate("parameterOne",av)>>. See http://manual.umple.org?RE002ViolationofAssociationMultiplicity.html"
end!>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ class UmpleToRuby {
constructor_AttributeAssignUnique <<!<</*constructor_AttributeAssignUnique*/>>
@<<=av.getName()>> = nil
if (!<<=gen.translate("setMethod", av)>>(<<=gen.translate("parameterOne", av)>>))
raise ArgumentError, 'Cannot create due to duplicate <<=av.getName()>>'
raise ArgumentError, 'Cannot create due to duplicate <<=av.getName()>>. See http://manual.umple.org?RE003ViolationofUniqueness.html'
end!>>
}
2 changes: 1 addition & 1 deletion build/reference/0101gettingStarted.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ edited and never should be edited, since You can always embed native methods (i
Java, Php, etc.) in the Umple, or else use Umple's <a href="BeforeandAfterStatements.html">aspect oriented</a>
capabilities to alter the effects of generated code. As a result the concept of 'round
tripping' is obsolete in Umple. You should treat Umple-generated code just
lke you would treat bytecode-or machine code, i.e. as a development
like you would treat bytecode-or machine code, i.e. as a development
artifact that can be thrown away and recreated. Nevertheless, we have
endeavoured to make the generated code as clean and readable as possible
so you can verify its correctness and learn how it works.</li>
Expand Down
4 changes: 2 additions & 2 deletions build/reference/0122structureOfUmpleCode.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ explicitly include. This is because one of the key points about Umple is
that it <i>generates</i> a high percentage of the methods you would
normally need to write by hand if you were programming directly in the
target language. In other words, when you compile Umple constructs such as
assocations, attributes and state machines, you are generating many
associations, attributes and state machines, you are generating many
methods that you can call; the set of methods you can call is the
generated API. You can find out the API by using Javadoc, or a similar
tool, on the generated code, or you can look at the <a href="APISummary.html"> quick reference manual page.</a> One of the options in <a href="UsingUmpleOnline.html">UmpleOnline</a> is to generate Javadoc output.</p>
Expand All @@ -93,7 +93,7 @@ create a complete definition, also means that you can create
added to add extra features to a system. You can therefore organize your
system, in whole or in part, by <i>feature</i>. The various pieces of code
needed to implement a feature (including entire new classes, or bits such
as associations and methods to add to existing classes), can be therefore
as associations and methods to add to existing classes), can therefore
be grouped together. There are limits to this, however: At the current
time, this mechanism does not allow you to override existing elements,
which you might need to do to add a feature. Taken together, these
Expand Down
6 changes: 3 additions & 3 deletions build/reference/0190convincingSkeptics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ noreferences

<li><b>Rapid application development:</b> Models containing the essential structure of a system can be developed extremely fast, and modified extremely rapidly. This is because most people can edit Umple text faster than they can use a drawing tool. But the ability to use a drawing tool is not sacrificed you can still draw an Umple model as a diagram with <a href="UsingUmpleOnline.html">UmpleOnline</a>!</li><br/>

<li><b>Less code to write:</b> Code for UML constructs like <a href="AssociationDefinition.html">associations</a>, <a href="BasicStateMachines.html">state machines</a> and certain <a href="SingletonPattern.html">patterns</a> is generated. Less code means fewer bugs. Developers can concentrate on the more interesting or critical parts of your code.</li><br/>
<li><b>Less code to write:</b> Code for UML constructs like <a href="AssociationDefinition.html">associations</a>, <a href="BasicStateMachines.html">state machines</a> and certain <a href="SingletonPattern.html">patterns</a> is generated. Less code means fewer bugs. Developers can concentrate on the more interesting or critical parts of their code.</li><br/>

<li><b>Fewer bugs:</b> It is extremely difficult to consistently write bug-free code for complex constructs like <a href="BasicStateMachines.html">state machines</a>, or <a href="AssociationDefinition.html">associations</a> that maintain referential integrity and respect <a href="Multiplicity.html">multiplicity</a> constraints. Umple does this for you.</li><br/>

<li><b>The full power of UML features:</b> Unlike Umple, most other code generators do not generate code that enforces multiplicity in class diagrams, or allows unlimited levels of nesting of state machines. Umple has incorporated the research of several PhD and masters theses to deliver state-of-the-art code generation.</li><br/>

<li><b>Text-diagram duality:</b> Umple allows visualization of key aspects of your code with UmpleOnline. Furthermore the diagram can be edited to change the code, or the code can be edited to change the diagram. Both of these occur in real time.</li><br/>

<li><b>Product-line and feature-oriented development:</b> Umple brings mixin technology to Java and PhP, allowing you to easily build different versions of your software for different customers or hardware platforms. Umple code can also be organized on a feature-by feature basis.</li><br/>
<li><b>Product-line and feature-oriented development:</b> Umple brings mixin technology to Java and PhP, allowing you to easily build different versions of your software for different customers or hardware platforms. Umple code can also be organized on a feature-by-feature basis.</li><br/>

<li><b>Aspect orientation to adapt generated code:</b> You can inject your own code <a href="BeforeandAfterStatements.html">before and after</a> any generated methods to enforce constraints or change semantics.</li><br/>

Expand Down Expand Up @@ -89,7 +89,7 @@ noreferences
<li><b>Compatibility:</b> We use a lot of re-used, proprietary or legacy code that might be incompatible with the new technology:<br/>
<u>Not true for Umple, because:</u>
<ul>
<li>Umple can work with any existing libraries in Java, PHP, Ruby etc. You can subclass existing classes even if you cant see the source; you can write arbitrary code to call APIs of existing libraries, or you can convert existing code to Umple if you wish.</li>
<li>Umple can work with any existing libraries in Java, PHP, Ruby etc. You can subclass existing classes even if you can&quot;t see the source; you can write arbitrary code to call APIs of existing libraries, or you can convert existing code to Umple if you wish.</li>
<li>Umple is particularly good at helping incrementally re-engineer (i.e. umplifiy) legacy code: You can convert your legacy code little-by-little. But you also have the option to leave it unchanged and just use Umple for extensions or new code.</li>
</ul></li><br/>

Expand Down
4 changes: 2 additions & 2 deletions build/reference/0201comment.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ Comments can be either <a href="InlineComments.html">inlineComments</a>, or <a h

<br />

@@example
@@example @@caption Example Showing Inline Comments @@endcaption
@@source manualexamples/UmpleComments1.ump
@@endexample

@@example
@@example @@caption Example Showing Both Inline And Multiline Comments @@endcaption
@@source manualexamples/UmpleComments2.ump
@@endexample
2 changes: 1 addition & 1 deletion build/reference/0304UseStatements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ other model or program entities (i.e. classes) within your current model.</p>
<p>A model file will only be included once, subsequent "use" commands
for the same file will be ignored.</p>

<p>A common technique is create a 'master' Umple file that does nothing but have a list
<p>A common technique is to create a 'master' Umple file that does nothing but have a list
of use statements.</p>

<p>Parts of an individual class can be specified in separate files, and brought together using several use statements. For example the associations or attributes could be in one (or several) files, and the methods could be in one (or more) additional files.</p>
Expand Down
Loading

0 comments on commit c82c08d

Please sign in to comment.