You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2019/11/02 20:29:15 UTC

[groovy] 03/07: Fix illegal access warning `java.util.Observable.changed`

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 5694a1187252dfb91379b1ed634c191abbc6a4f4
Author: Daniel Sun <su...@apache.org>
AuthorDate: Fri Nov 1 23:49:45 2019 +0800

    Fix illegal access warning `java.util.Observable.changed`
---
 src/test/groovy/GroovyMethodsTest.groovy | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/test/groovy/GroovyMethodsTest.groovy b/src/test/groovy/GroovyMethodsTest.groovy
index fcbf3dd..0c9d5d3 100644
--- a/src/test/groovy/GroovyMethodsTest.groovy
+++ b/src/test/groovy/GroovyMethodsTest.groovy
@@ -99,9 +99,14 @@ class GroovyMethodsTest extends GroovyTestCase {
     void testAsCoercionInterface() {
         def letters = ['a', 'b', 'c']
         def ol = new ObserverLike()
-        def o = new Observable()
+        def o = new Observable() {
+            @Override
+            synchronized void setChanged() {
+                super.setChanged()
+            }
+        }
         o.addObserver(ol as Observer) // addObserver takes Observer as param
-        letters.each{ o.changed = true; o.notifyObservers(it) }
+        letters.each{ o.setChanged(); o.notifyObservers(it) }
         assert ol.observed == letters
     }