Browse Source

Polishing

pull/28406/head
Juergen Hoeller 6 years ago
parent
commit
fdf936c3e2
  1. 12
      spring-context/src/main/java/org/springframework/context/annotation/DeferredImportSelector.java
  2. 1
      spring-messaging/src/main/java/org/springframework/messaging/simp/user/MultiServerUserRegistry.java
  3. 5
      spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionInterceptorTests.java

12
spring-context/src/main/java/org/springframework/context/annotation/DeferredImportSelector.java

@ -16,8 +16,6 @@ @@ -16,8 +16,6 @@
package org.springframework.context.annotation;
import java.util.Objects;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.lang.Nullable;
@ -108,13 +106,17 @@ public interface DeferredImportSelector extends ImportSelector { @@ -108,13 +106,17 @@ public interface DeferredImportSelector extends ImportSelector {
return false;
}
Entry entry = (Entry) other;
return (Objects.equals(this.metadata, entry.metadata) &&
Objects.equals(this.importClassName, entry.importClassName));
return (this.metadata.equals(entry.metadata) && this.importClassName.equals(entry.importClassName));
}
@Override
public int hashCode() {
return Objects.hash(this.metadata, this.importClassName);
return (this.metadata.hashCode() * 31 + this.importClassName.hashCode());
}
@Override
public String toString() {
return this.importClassName;
}
}
}

1
spring-messaging/src/main/java/org/springframework/messaging/simp/user/MultiServerUserRegistry.java

@ -560,7 +560,6 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati @@ -560,7 +560,6 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati
}
return map;
}
}
}

5
spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionInterceptorTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -40,6 +40,7 @@ import static org.mockito.BDDMockito.*; @@ -40,6 +40,7 @@ import static org.mockito.BDDMockito.*;
* Mock object based tests for TransactionInterceptor.
*
* @author Rod Johnson
* @author Juergen Hoeller
* @since 16.03.2003
*/
public class TransactionInterceptorTests extends AbstractTransactionAspectTests {
@ -49,7 +50,7 @@ public class TransactionInterceptorTests extends AbstractTransactionAspectTests @@ -49,7 +50,7 @@ public class TransactionInterceptorTests extends AbstractTransactionAspectTests
@Override
protected Object advised(Object target, PlatformTransactionManager ptm, TransactionAttributeSource[] tas) throws Exception {
protected Object advised(Object target, PlatformTransactionManager ptm, TransactionAttributeSource[] tas) {
TransactionInterceptor ti = new TransactionInterceptor();
ti.setTransactionManager(ptm);
ti.setTransactionAttributeSources(tas);

Loading…
Cancel
Save