Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #987 from jblang94/resolve_issue_925
Resolve issue 925
- Loading branch information
Showing
26 changed files
with
1,457 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
W072 Refactored Final State | ||
Errors and Warnings | ||
noreferences | ||
|
||
@@description | ||
|
||
<h2>Umple sematic warning when do activities, exit actions, outgoing transitions, and/or nested state machines are removed by the compiler from final states.</h2> | ||
|
||
<p> | ||
In Umple, final states are allowed to be empty, or they can contain entry actions. | ||
</p> | ||
|
||
|
||
@@example | ||
@@source manualexamples/W072RefactoredFinalState1.ump | ||
@@endexample | ||
|
||
@@example | ||
@@source manualexamples/W072RefactoredFinalState2.ump | ||
@@endexample | ||
|
||
@@example | ||
@@source manualexamples/W072RefactoredFinalState3.ump | ||
@@endexample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
cruise.umple/test/cruise/umple/compiler/486_finalState_hasDoActivity.ump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class X { | ||
status{ | ||
on{ | ||
turnoff -> off; | ||
powerOff-> FINAL; | ||
} | ||
off{ | ||
turnOn -> on; | ||
} | ||
final FINAL{ | ||
do{exe();} | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
cruise.umple/test/cruise/umple/compiler/486_finalState_hasEntryAction.ump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class X { | ||
status{ | ||
on{ | ||
turnoff -> off; | ||
powerOff-> FINAL; | ||
} | ||
off{ | ||
turnOn -> on; | ||
} | ||
final FINAL{ | ||
entry/{entry();} | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
cruise.umple/test/cruise/umple/compiler/486_finalState_hasExitAction.ump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class X { | ||
status{ | ||
on{ | ||
turnoff -> off; | ||
powerOff-> FINAL; | ||
} | ||
off{ | ||
turnOn -> on; | ||
} | ||
final FINAL{ | ||
exit/{exit();} | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
cruise.umple/test/cruise/umple/compiler/486_finalState_hasNestedStateMachine.ump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
class X { | ||
status{ | ||
on{ | ||
turnoff -> off; | ||
powerOff-> FINAL; | ||
} | ||
off{ | ||
turnOn -> on; | ||
} | ||
final FINAL{ | ||
nestedSm { | ||
s1 { | ||
-> s2; | ||
} | ||
s2 { | ||
|
||
} | ||
} | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
cruise.umple/test/cruise/umple/compiler/486_finalState_hasTransition.ump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class X { | ||
status{ | ||
on{ | ||
turnoff -> off; | ||
powerOff-> FINAL; | ||
} | ||
off{ | ||
turnOn -> on; | ||
} | ||
final FINAL{ | ||
reboot -> on; | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
cruise.umple/test/cruise/umple/compiler/486_finalState_isEmpty.ump
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class X { | ||
status{ | ||
on{ | ||
turnoff -> off; | ||
powerOff-> FINAL; | ||
} | ||
off{ | ||
turnOn -> on; | ||
} | ||
final FINAL{ | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
...mple/test/cruise/umple/statemachine/implementation/java/refactorFinalState_empty.java.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/*PLEASE DO NOT EDIT THIS CODE*/ | ||
/*This code was generated using the UMPLE @UMPLE_VERSION@ modeling language!*/ | ||
|
||
package example; | ||
|
||
public class X | ||
{ | ||
|
||
//------------------------ | ||
// MEMBER VARIABLES | ||
//------------------------ | ||
|
||
//X State Machines | ||
public enum Status { on, off, FINAL } | ||
private Status status; | ||
|
||
//------------------------ | ||
// CONSTRUCTOR | ||
//------------------------ | ||
|
||
public X() | ||
{ | ||
setStatus(Status.on); | ||
} | ||
|
||
//------------------------ | ||
// INTERFACE | ||
//------------------------ | ||
|
||
public String getStatusFullName() | ||
{ | ||
String answer = status.toString(); | ||
return answer; | ||
} | ||
|
||
public Status getStatus() | ||
{ | ||
return status; | ||
} | ||
|
||
public boolean turnoff() | ||
{ | ||
boolean wasEventProcessed = false; | ||
|
||
Status aStatus = status; | ||
switch (aStatus) | ||
{ | ||
case on: | ||
setStatus(Status.off); | ||
wasEventProcessed = true; | ||
break; | ||
default: | ||
// Other states do respond to this event | ||
} | ||
|
||
return wasEventProcessed; | ||
} | ||
|
||
public boolean powerOff() | ||
{ | ||
boolean wasEventProcessed = false; | ||
|
||
Status aStatus = status; | ||
switch (aStatus) | ||
{ | ||
case on: | ||
setStatus(Status.FINAL); | ||
wasEventProcessed = true; | ||
break; | ||
default: | ||
// Other states do respond to this event | ||
} | ||
|
||
return wasEventProcessed; | ||
} | ||
|
||
public boolean turnOn() | ||
{ | ||
boolean wasEventProcessed = false; | ||
|
||
Status aStatus = status; | ||
switch (aStatus) | ||
{ | ||
case off: | ||
setStatus(Status.on); | ||
wasEventProcessed = true; | ||
break; | ||
default: | ||
// Other states do respond to this event | ||
} | ||
|
||
return wasEventProcessed; | ||
} | ||
|
||
private void setStatus(Status aStatus) | ||
{ | ||
status = aStatus; | ||
|
||
// entry actions and do activities | ||
switch(status) | ||
{ | ||
case FINAL: | ||
delete(); | ||
break; | ||
} | ||
} | ||
|
||
public void delete() | ||
{} | ||
|
||
} |
Oops, something went wrong.