Skip to content

Commit eceaa9b

Browse files
committed
Dirty hack for fixing xtext#8 (File system concurrency problem using
@jsnative)
1 parent 7d6de58 commit eceaa9b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/de/itemis/xtend/auto/gwt/JsNative.xtend

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ class JsNativeProcessor extends AbstractMethodProcessor {
5858
val startIndex = contents.substring(0, markerStart).lastIndexOf('{')
5959
val endIndex = contents.substring(markerStart).indexOf('}') + markerStart
6060
val jsCode = annotatedMethod.body.toString.trimTripleQuotes
61-
path.contents = contents.substring(0, startIndex)+"/*-{"+jsCode+"}-*/;"+contents.substring(endIndex+1)
61+
62+
val newContents = contents.substring(0, startIndex) + "/*-{" + jsCode + "}-*/;" +
63+
contents.substring(endIndex + 1)
64+
path.contents = newContents
65+
do {
66+
Thread.sleep(100);
67+
} while (path.contents.toString != newContents)
6268
}
6369

6470
private def String trimTripleQuotes(String s) {

0 commit comments

Comments
 (0)