Replace collection.size() > 0 with not collection.isEmpty() (DataDog/dd-trace-java#1420)

This commit is contained in:
Richard Startin 2020-05-01 15:50:08 +01:00 committed by Trask Stalnaker
parent b36a7aef8c
commit 95cac497d2
3 changed files with 3 additions and 3 deletions

View File

@ -82,7 +82,7 @@ public interface Instrumenter {
instrumentationPrimaryName = instrumentationName;
enabled = Config.get().isIntegrationEnabled(instrumentationNames, defaultEnabled());
if (contextStore().size() > 0) {
if (!contextStore().isEmpty()) {
contextProvider = new FieldBackedProvider(this);
} else {
contextProvider = NoopContextProvider.INSTANCE;

View File

@ -181,7 +181,7 @@ public class MuzzleVersionScanPlugin {
if (ref.getSuperName() != null) {
builder.append(" extends<").append(ref.getSuperName()).append(">");
}
if (ref.getInterfaces().size() > 0) {
if (!ref.getInterfaces().isEmpty()) {
builder.append(" implements ");
for (final String iface : ref.getInterfaces()) {
builder.append(" <").append(iface).append(">");

View File

@ -62,7 +62,7 @@ public class HibernateDecorator extends OrmClientDecorator {
} else if (annotations.contains("javax.persistence.Entity")) {
// We were given an instance of an entity.
name = entity.getClass().getName();
} else if (entity instanceof List && ((List) entity).size() > 0) {
} else if (entity instanceof List && !((List) entity).isEmpty()) {
// We have a list of entities.
name = entityName(((List) entity).get(0));
}