Bug 116767

Summary: Java: Call URLClassLoader.close once our runtime baseline is Java 7
Product: LibreOffice Reporter: Stephan Bergmann <sberg.fun>
Component: LibreOfficeAssignee: Stephan Bergmann <sberg.fun>
Status: RESOLVED WONTFIX    
Severity: normal CC: xiscofauli
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=145527
Whiteboard: target:6.4.0 target:7.4.0 target:7.3.5 target:7.3.4
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 103257    

Description Stephan Bergmann 2018-04-03 09:58:08 UTC
See coverity resource leak reports 1371366 (scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java), 1371372 (scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java), and 1371376 (scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java), which I closed for now: "java.net.URLClassLoader derives from Closeable only since Java 7 (and we still support older), so best ignore this for now."
Comment 1 Xisco FaulĂ­ 2018-07-02 23:05:51 UTC
Dear Stephan Bergmann,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.
Comment 2 QA Administrators 2019-08-01 03:37:19 UTC Comment hidden (obsolete)
Comment 3 Stephan Bergmann 2019-08-01 06:41:29 UTC
On master towards LO 6.4, the Java baseline is >= 7 now since <https://gerrit.libreoffice.org/plugins/gitiles/core/+/aafc10c9edb61e13ac557c7e43c8d4a31dce4f37%5E!/> "Bump Java baseline to Java 8", so we can go ahead.
Comment 4 Commit Notification 2019-08-08 11:29:12 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/418533f0af7cd303d559c8fb136c49e7e9fb0d79%5E%21

Related tdf#116767: Call URLClassLoader.close

It will be available in 6.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Stephan Bergmann 2019-08-08 11:38:06 UTC
Unlike closing the URLClassLoader obtained via ClassLoaderFactory.getURLClassLoader in scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java in the commit of comment 4 (which was not listed among the three files reported by Coverity in comment 0), closing the URLClassLoader obtained via ClassLoaderFactory.getURLClassLoader in the three files reported by Coverity in comment 0 is not (easily) doable:  In each case, the URLClassLoader is passed on to other classes that hold references to it, so it must only be closed when those other class instances are finalized (and which happens automatically).  So resolving as WONTFIX.

(Details about the Coverity reports mentioned in comment 0 are lost to history, btw.)
Comment 6 Commit Notification 2022-05-31 12:53:20 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2a263cbdaf16c723a93af020ebc11b3e07210242

tdf#145527 Revert "Related tdf#116767: Call URLClassLoader.close"

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2022-05-31 16:51:03 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/f167224bd9643824393039a57b3d4cd6654dbb4c

tdf#145527 Revert "Related tdf#116767: Call URLClassLoader.close"

It will be available in 7.3.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2022-06-01 17:13:44 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-7-3-4":

https://git.libreoffice.org/core/commit/a994ee5b1f1270eefbe1b3e9b7a5cf866ba924d9

tdf#145527 Revert "Related tdf#116767: Call URLClassLoader.close"

It will be available in 7.3.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.