1. 20 Jun, 2016 4 commits
  2. 17 Jun, 2016 4 commits
    • Stephane Nicoll's avatar
      Fix HAL browser entry point with contextPath · 9abca48a
      Stephane Nicoll authored
      Previously, if the `contextPath` of the application wasn't the root, the
      HAL browser could not initialize since the `entryPoint` was referring to
      an invalid location.
      
      This commit makes sure to take the `contextPath` into account.
      
      Closes gh-5814
      9abca48a
    • Stephane Nicoll's avatar
      Update .gitignore · 72b88790
      Stephane Nicoll authored
      72b88790
    • Andy Wilkinson's avatar
      Prevent GC pressure from causing an NPE in SimpleInMemoryRepository · a2446080
      Andy Wilkinson authored
      Previously, SimpleInMemoryRepository used a ConcurrentReferenceHashMap
      to store its locks. The type of map will discard its entries when the
      JVM comes under GC pressure. With the code in its previous form, this
      could lead to a NullPointerException when the following occurred:
      
      1. putIfAbsent returned null indicating that a new entry has been added
         to the map
      2. GC pressure caused the map to discard the new entry
      3. get returned null as the entry has been discard
      
      There are two problems with the existing code:
      
      1. Its usage of a ConcurrentMap is incorrect. The correct usage is:
         a. Call get to see if the map already contains a lock
         b. If the lock is null, create a new one
         c. Call putIfAbsent to add the new lock
         d. If the return value is non-null, another thread has created the
            lock and it should be used. If the return value is null, use the
            new lock created in b.
      2. Once the use of ConcurrentMap has been corrected, the fact that it is
         a ConcurrentReferenceHashMap means that different threads could
         access the same value using different locks. This would occur if one
         thread has retrieved a lock from the map and is using it, while GC
         causes the lock to be removed from the map. Another thread then
         attempts to get the lock and, as GC pressure has remove it, a new
         lock is created allowing concurrent access to the same value.
      
      This commit updates the code to use the ConcurrentMap correctly and also
      replaces the ConcurrentReferenceHashMap with a ConcurrentHashMap. This
      means that the repository will now use slightly more memory but this is
      outweighed by the benefits of thread-safe updates and no risk of an NPE.
      
      Closes gh-6115
      a2446080
    • Andy Wilkinson's avatar
      Prevent JVM from exiting with 1 when main thread is only non-daemon · 13635201
      Andy Wilkinson authored
      DevTools deliberately throws an uncaught exception on the main thread
      as a safe way of causing it to stop processing. This exception is
      caught and swallowed by an uncaught exception handler. Unfortunately,
      this has the unwanted side-effect of causing the JVM to exit with 1
      once all running threads are daemons.
      
      Normally, this isn't a problem. Non-daemon threads, such as those
      started by an embedded servlet container, will keep the JVM alive and
      restarts of the application context will occur when the user makes to
      their application. However, if the user adds DevTools to an
      application that doesn't start any non-daemon threads, i.e. it starts,
      runs, and then exits, it will exit with 1. This causes both
      bootRun in Gradle and spring-boot:run in Maven to report that the
      build has failed. While there's no benefit to using DevTools with an
      application that behaves in this way, the side-effect of causing the
      JVM to exit with 1 is unwanted.
      
      This commit address the problem by updating the uncaught exception
      handler to call System.exit(0) if the JVM is going to exit as a
      result of the uncaught exception causing the main thread to die. In
      other words, if the main thread was the only non-daemon thread, its
      death as a result of the uncaught exception will now cause the JVM
      to exit with 1 rather than 0. If there are other non-daemon threads
      that will keep the JVM alive, the behaviour is unchanged.
      
      Closes gh-5968
      13635201
  3. 16 Jun, 2016 2 commits
  4. 15 Jun, 2016 4 commits
  5. 14 Jun, 2016 2 commits
  6. 11 Jun, 2016 4 commits
  7. 10 Jun, 2016 3 commits
    • Phillip Webb's avatar
      Allow loading from package names without dots · a9b98cad
      Phillip Webb authored
      Update BeanDefinitionLoader to support loading from package names that
      do not contain dots.
      
      Prior to this commit `new BeanDefinitionLoader(registry, "somepackage")`
      would fail because "somepackage" exists and is a resource but does not
      contain valid XML. Somewhat surprisingly the InputStream returned by
      the resource actually contains the listing of files in the package.
      
      Fixes gh-6126
      a9b98cad
    • Ivan Sopov's avatar
      Fix potential offset errors in BasicJsonParser · 15287641
      Ivan Sopov authored
      Update BasicJsonParser to fix potential exceptions if strings happen
      to be empty.
      
      Fixes gh-6136
      15287641
    • Phillip Webb's avatar
      Polish · ed6f11d6
      Phillip Webb authored
      ed6f11d6
  8. 09 Jun, 2016 2 commits
  9. 03 Jun, 2016 1 commit
  10. 01 Jun, 2016 12 commits
  11. 26 May, 2016 1 commit
  12. 25 May, 2016 1 commit
    • Andy Wilkinson's avatar
      Make FileSystemWatcherTests thread-safe · 9f425343
      Andy Wilkinson authored
      The list of changes is written to on one thread and read from on
      another. Without some form of sychronization this is not thread-safe.
      
      This commit makes changes a synchronized list which should guarantee
      that the reading thread can see the changes made by the writing thread.
      It also removes a redundant call to clear the list of changes at the
      start of waitsForPollingInterval.
      
      See gh-6038
      9f425343