Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/TransitionPropertiesParser.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/TransitionPropertiesParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/TransitionPropertiesParser.java
index 3ce6eb50608..dbc5318f655 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/TransitionPropertiesParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/custom-src/org/eclipse/papyrus/uml/diagram/statemachine/custom/parsers/TransitionPropertiesParser.java
@@ -405,7 +405,10 @@ public class TransitionPropertiesParser implements IParser, ISemanticParser {
else {
int start = 0;
while (cutLength > 0) {
- int newStart = body.indexOf(System.lineSeparator(), start);
+ // use "\n" instead of System.lineSeparator, since we code embedded into a model
+ // might not be destined for the development machine, e.g. contain eventually only
+ // \n, also the model is opened on a windows machine.
+ int newStart = body.indexOf("\n", start); //$NON-NLS-1$
if (newStart > 0) {
cutLength--;
start = newStart + 1;
@@ -415,6 +418,10 @@ public class TransitionPropertiesParser implements IParser, ISemanticParser {
}
}
if (start > 0) {
+ // handle case that line end is preceded by a \r
+ if (start >= 2 && body.charAt(start-1) == '\r') {
+ return body.substring(0, start - 2) + DOTS;
+ }
return body.substring(0, start - 1) + DOTS;
}
return body;

Back to the top