changeset 22297:145f995cd2fe

Truffle/Instrumentation: some minor access cleanups
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Fri, 09 Oct 2015 12:17:58 -0400
parents 9c108011f794
children e2e5168618fc 0bd25f39d655
files truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/Instrument.java truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/TagInstrument.java
diffstat 2 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/Instrument.java	Thu Oct 08 17:33:41 2015 -0700
+++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/Instrument.java	Fri Oct 09 12:17:58 2015 -0400
@@ -44,7 +44,7 @@
 
     private boolean isDisposed = false;
 
-    protected Instrument(String instrumentInfo) {
+    Instrument(String instrumentInfo) {
         this.instrumentInfo = instrumentInfo;
     }
 
@@ -68,10 +68,10 @@
         return isDisposed;
     }
 
-    protected final String getInstrumentInfo() {
+    public final String getInstrumentInfo() {
         return instrumentInfo;
     }
 
-    protected abstract void innerDispose();
+    abstract void innerDispose();
 
 }
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/TagInstrument.java	Thu Oct 08 17:33:41 2015 -0700
+++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/TagInstrument.java	Fri Oct 09 12:17:58 2015 -0400
@@ -41,7 +41,7 @@
  */
 public abstract class TagInstrument extends Instrument {
 
-    protected Instrumenter instrumenter;
+    private Instrumenter instrumenter;
 
     private SyntaxTag tag = null;
 
@@ -51,10 +51,14 @@
         this.tag = tag;
     }
 
-    public SyntaxTag getTag() {
+    public final SyntaxTag getTag() {
         return tag;
     }
 
+    protected final Instrumenter getInstrumenter() {
+        return instrumenter;
+    }
+
     static final class BeforeTagInstrument extends TagInstrument {
 
         private final StandardBeforeInstrumentListener listener;
@@ -70,7 +74,7 @@
 
         @Override
         protected void innerDispose() {
-            instrumenter.disposeBeforeTagInstrument();
+            getInstrumenter().disposeBeforeTagInstrument();
         }
     }
 
@@ -89,7 +93,7 @@
 
         @Override
         protected void innerDispose() {
-            instrumenter.disposeAfterTagInstrument();
+            getInstrumenter().disposeAfterTagInstrument();
         }
     }
 }