From b173a148daa73b9b974719cabeaf902c6294d47b Mon Sep 17 00:00:00 2001 From: Tim Middleton Date: Tue, 5 Mar 2024 13:40:18 +0800 Subject: [PATCH] Fix failures --- coherence-visualvm-plugin/pom.xml | 8 ------- .../plugin/visualvm/VisualVMInstaller.java | 21 +++++++++---------- .../tracer/AbstractCoherenceMonitorProbe.java | 8 +++---- .../visualvm/tracer/CustomFormatter.java | 15 +++++++------ pom.xml | 3 ++- 5 files changed, 23 insertions(+), 32 deletions(-) diff --git a/coherence-visualvm-plugin/pom.xml b/coherence-visualvm-plugin/pom.xml index ebcdee5..75d4222 100644 --- a/coherence-visualvm-plugin/pom.xml +++ b/coherence-visualvm-plugin/pom.xml @@ -130,14 +130,6 @@ coherence-discovery - - - com.oracle.coherence.plugin.visualvm - coherence-visualvm-tracer - 1.7.0-SNAPSHOT - provided - - org.hamcrest hamcrest diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMInstaller.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMInstaller.java index a571063..95b4efb 100644 --- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMInstaller.java +++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMInstaller.java @@ -65,12 +65,12 @@ public void restored() CoherenceApplicationTypeFactory.initialize(); // register the tracer probes - if (provider == null) + if (m_provider == null) { - provider = new TracerPackageProviderImpl(); + m_provider = new TracerPackageProviderImpl(); } - TracerSupport.getInstance().registerPackageProvider(provider); + TracerSupport.getInstance().registerPackageProvider(m_provider); } /** @@ -86,15 +86,14 @@ public void uninstalled() CoherenceApplicationTypeFactory.shutdown(); // un-register the tracer probes - if (provider == null) + if (m_provider == null) { - provider = new TracerPackageProviderImpl(); + m_provider = new TracerPackageProviderImpl(); } - TracerSupport.getInstance().unregisterPackageProvider(provider); + TracerSupport.getInstance().unregisterPackageProvider(m_provider); } - - + /** * Provider of Coherence tracer probes. */ @@ -111,7 +110,7 @@ public TracerPackage[] getPackages(Application application) { return new ClusterMonitorPackage[] {new ClusterMonitorPackage(application)}; } - } + } - private TracerPackageProviderImpl provider; - } + private transient TracerPackageProviderImpl m_provider; + } diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/AbstractCoherenceMonitorProbe.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/AbstractCoherenceMonitorProbe.java index 3547ce3..1d481c4 100644 --- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/AbstractCoherenceMonitorProbe.java +++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/AbstractCoherenceMonitorProbe.java @@ -58,7 +58,7 @@ public AbstractCoherenceMonitorProbe(int valuesCount, ProbeItemDescriptor[] item this.f_resolver = resolver; } - public synchronized final long[] getItemValues(long timestamp) + public final synchronized long[] getItemValues(long timestamp) { VisualVMModel model = f_resolver.getMonitoredData(); if (model != null) @@ -91,7 +91,7 @@ protected long getValueAsLong(Object oValue) } if (oValue instanceof Integer) { - return (long)((Integer)oValue); + return ((Integer)oValue); } if (oValue instanceof String) { @@ -126,8 +126,8 @@ protected long[] getSingValue(VisualVMModel model, VisualVMModel.DataType dataTy private final int f_nValuesCount; - protected final long[] ZERO_VALUES2 = new long[]{0L,0L}; - protected final long[] ZERO_VALUES1 = new long[]{0L}; + protected static final long[] ZERO_VALUES2 = new long[]{0L,0L}; + protected static final long[] ZERO_VALUES1 = new long[]{0L}; // ----- constants ------------------------------------------------------ diff --git a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/CustomFormatter.java b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/CustomFormatter.java index f987bd9..4a38b2e 100644 --- a/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/CustomFormatter.java +++ b/coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/tracer/CustomFormatter.java @@ -40,30 +40,29 @@ public class CustomFormatter public CustomFormatter(int factor, String units) { - this.factor = factor; - this.units = units; + this.m_nFactor = factor; + this.m_sUnits = units; } @Override public String formatValue(long value, int format) { - return FORMAT.format(value / (double) this.factor); + return FORMAT.format(value / (double) this.m_nFactor); } @Override public String getUnits(int format) { - return this.units; + return this.m_sUnits; } // ----- constants ------------------------------------------------------ private static final NumberFormat FORMAT = NumberFormat.getInstance(); - - + // ----- data members --------------------------------------------------- - private final int factor; - private final String units; + private final int m_nFactor; + private final String m_sUnits; } diff --git a/pom.xml b/pom.xml index ccf0ba6..5b93b57 100644 --- a/pom.xml +++ b/pom.xml @@ -136,7 +136,8 @@ org-graalvm-visualvm-host ${visualvm.version} - + + org.graalvm.visualvm.modules org-graalvm-visualvm-modules-tracer