Merge pull request #449 from PascalSchumacher/setter_getter_synchronization

AMQ-7402: Inconsistent synchronization of getters/setters of some cla…
This commit is contained in:
Jean-Baptiste Onofré 2020-02-13 08:15:57 +01:00 committed by GitHub
commit a9d89572ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View File

@ -504,7 +504,7 @@ public class TopicSubscription extends AbstractSubscription {
this.messageEvictionStrategy = messageEvictionStrategy;
}
public int getMaxProducersToAudit() {
public synchronized int getMaxProducersToAudit() {
return maxProducersToAudit;
}
@ -515,7 +515,7 @@ public class TopicSubscription extends AbstractSubscription {
}
}
public int getMaxAuditDepth() {
public synchronized int getMaxAuditDepth() {
return maxAuditDepth;
}

View File

@ -260,7 +260,7 @@ public abstract class AbstractPendingMessageCursor implements PendingMessageCurs
* @return the maxProducersToAudit
*/
@Override
public int getMaxProducersToAudit() {
public synchronized int getMaxProducersToAudit() {
return maxProducersToAudit;
}
@ -279,7 +279,7 @@ public abstract class AbstractPendingMessageCursor implements PendingMessageCurs
* @return the maxAuditDepth
*/
@Override
public int getMaxAuditDepth() {
public synchronized int getMaxAuditDepth() {
return maxAuditDepth;
}

View File

@ -19,8 +19,8 @@ package org.apache.activemq.management;
public class SizeStatisticImpl extends StatisticImpl {
private long count;
private long maxSize;
private long minSize;
private volatile long maxSize;
private volatile long minSize;
private long totalSize;
private SizeStatisticImpl parent;
@ -94,21 +94,21 @@ public class SizeStatisticImpl extends StatisticImpl {
/**
* @return the maximum size of any step
*/
public synchronized void setMaxSize(long size) {
public void setMaxSize(long size) {
maxSize = size;
}
/**
* @return the minimum size of any step
*/
public synchronized long getMinSize() {
public long getMinSize() {
return minSize;
}
/**
* @return the maximum size of any step
*/
public synchronized void setMinSize(long size) {
public void setMinSize(long size) {
minSize = size;
}

View File

@ -122,7 +122,7 @@ public class HashIndex<Key,Value> implements Index<Key,Value> {
private Metadata.Marshaller metadataMarshaller = new Metadata.Marshaller();
private HashBin.Marshaller<Key,Value> hashBinMarshaller = new HashBin.Marshaller<Key,Value>(this);
private Marshaller<Key> keyMarshaller;
private volatile Marshaller<Key> keyMarshaller;
private Marshaller<Value> valueMarshaller;
@ -392,7 +392,7 @@ public class HashIndex<Key,Value> implements Index<Key,Value> {
*
* @param marshaller
*/
public synchronized void setKeyMarshaller(Marshaller<Key> marshaller) {
public void setKeyMarshaller(Marshaller<Key> marshaller) {
this.keyMarshaller = marshaller;
}