Skip to content

Commit

Permalink
also verify error position for MISSING_SYNCHRONIZED
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Jan 15, 2024
1 parent eee1bb0 commit ae96649
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,11 @@ public void testClassMustBeAbstract_06() throws Exception {
}

@Test public void testSynchronized_1() throws Exception{
XtendClass xtendClass = clazz("class Foo extends Bar { override myMethod() {1} } class Bar { def synchronized int myMethod() {0} }");
helper.assertWarning(xtendClass, XTEND_FUNCTION, MISSING_SYNCHRONIZED);
var source = "class Foo extends Bar { override myMethod() {1} } class Bar { def synchronized int myMethod() {0} }";
XtendClass xtendClass = clazz(source);
helper.assertWarning(xtendClass, XTEND_FUNCTION, MISSING_SYNCHRONIZED,
source.indexOf("myMethod"), "myMethod".length(),
"The overridden method is synchronized, the current one is not synchronized");
}

@Test public void testSynchronized_2() throws Exception{
Expand Down

0 comments on commit ae96649

Please sign in to comment.