From 7fadb9ce200c03af44273f0544e0ae746ac65eb2 Mon Sep 17 00:00:00 2001 From: hns Date: Mon, 10 Apr 2006 11:25:22 +0000 Subject: [PATCH] * Add property read access to methods registered by PropertyRecorder. Fixes bug 458 . * Make all PropertyRecorder methods synchronized. --- src/helma/scripting/rhino/GlobalObject.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/helma/scripting/rhino/GlobalObject.java b/src/helma/scripting/rhino/GlobalObject.java index 14d0354c..706bdf0c 100644 --- a/src/helma/scripting/rhino/GlobalObject.java +++ b/src/helma/scripting/rhino/GlobalObject.java @@ -100,6 +100,10 @@ public class GlobalObject extends ImporterTopLevel implements PropertyRecorder { * @return the property for the given name */ public synchronized Object get(String name, Scriptable start) { + // register property for PropertyRecorder interface + if (isRecording) { + changedProperties.add(name); + } return super.get(name, start); } @@ -670,7 +674,7 @@ public class GlobalObject extends ImporterTopLevel implements PropertyRecorder { /** * Tell this PropertyRecorder to start recording changes to properties */ - public void startRecording() { + public synchronized void startRecording() { changedProperties = new HashSet(); isRecording = true; } @@ -678,7 +682,7 @@ public class GlobalObject extends ImporterTopLevel implements PropertyRecorder { /** * Tell this PropertyRecorder to stop recording changes to properties */ - public void stopRecording() { + public synchronized void stopRecording() { isRecording = false; } @@ -688,14 +692,14 @@ public class GlobalObject extends ImporterTopLevel implements PropertyRecorder { * * @return a Set containing the names of changed properties */ - public Set getChangeSet() { + public synchronized Set getChangeSet() { return changedProperties; } /** * Clear the set of changed properties. */ - public void clearChangeSet() { + public synchronized void clearChangeSet() { changedProperties = null; } }