Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2013-11-12 17:00:34 +0000
committerAnsgar Radermacher2013-11-12 17:02:36 +0000
commit83bea6eb06573d5f890e1052c9963257388443b6 (patch)
treed74e064833cb399beb44edb65ef0ff9b86190005
parent088f1befe5b45ffc97737cc3e3a75074e9c622d6 (diff)
downloadorg.eclipse.papyrus-83bea6eb06573d5f890e1052c9963257388443b6.tar.gz
org.eclipse.papyrus-83bea6eb06573d5f890e1052c9963257388443b6.tar.xz
org.eclipse.papyrus-83bea6eb06573d5f890e1052c9963257388443b6.zip
- bug 399864 [CDT/StateMachine] Papyrus shall enable to see code on transitions: Replace System.lineSeparator with '\n'
-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