Replace collection.size() > 0 with not collection.isEmpty() (DataDog/dd-trace-java#1420)
This commit is contained in:
parent
b36a7aef8c
commit
95cac497d2
|
@ -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;
|
||||
|
|
|
@ -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(">");
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue