• Andy Wilkinson's avatar
    Make TestInterceptor thread-safe · 5854ea18
    Andy Wilkinson authored
    Previously, TestInterceptor used an int to keep a count of how often
    it had been called. The count was incremented on one thread and
    read on another thread. This lead to intermittent test failures as the
    field was not declared volatile and a stale value would sometimes be
    returned.
    
    This commit updates TestInterceptor to use an AtomicInteger that's
    held in a final field. This ensures that getCount() will not return
    stale values and also ensures that the count can safely be incremented
    concurrently.
    
    Closes gh-1997
    5854ea18
Name
Last commit
Last update
docs Loading commit data...
eclipse Loading commit data...
spring-boot Loading commit data...
spring-boot-actuator Loading commit data...
spring-boot-autoconfigure Loading commit data...
spring-boot-cli Loading commit data...
spring-boot-dependencies Loading commit data...
spring-boot-docs Loading commit data...
spring-boot-full-build Loading commit data...
spring-boot-integration-tests Loading commit data...
spring-boot-parent Loading commit data...
spring-boot-samples Loading commit data...
spring-boot-starters Loading commit data...
spring-boot-tools Loading commit data...
spring-boot-versions Loading commit data...
.gitignore Loading commit data...
.settings-template.xml Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.adoc Loading commit data...
LICENSE.txt Loading commit data...
README.adoc Loading commit data...
pom.xml Loading commit data...