Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-15479

Refactor resource closing


    • Icon: Task Task
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 25.0.0.Final
    • None
    • None

      Currently some codepoints do a manual safe close without a util library, some code points have custom util methods. Some projects have dependencies to more than one util and use more than one. Some custom utils log the failure, some not. Some standard libraries have a trace on the attempt to close and on the failure, some not. Some close statements lack of proper error handling, some do not free the closed resource.

      Goal: Standardize the closing of resources, close all relevant resources and free them, properly reporting errors. Gain the possibility to trace potential resource leaks.
      java.io.Closeable requires a idempotent behaviour, java.lang.AutoCloseable recommends it.

      Current utilities in use:

      org.xnio.IoUtils.safeClose offers the most complete set of features:

      • Closeable, Closeable..., AutoCloseable
      • null check
      • trace the attempt to close
      • trace the error, if one occurs

            xf01213 Boris Unckel (Inactive)
            xf01213 Boris Unckel (Inactive)
            0 Vote for this issue
            1 Start watching this issue