Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-17647 Clean up code via static code review sweep for 2.7
  3. SAK-17661

A couple of potential failures to close InputStream in Portal, as seen via Static code sweep

    Details

    • Type: Sub-task
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.0
    • Fix Version/s: 2.7.0
    • Component/s: Portal
    • Labels:
      None
    • Environment:
      Static code review - Sakai-2-7.0-M2

      Description

      [1] org.sakaiproject.portal.charon.velocity.VelocityPortalRenderEngine
      InputStream not closed by end of of method Line 107, but as init method probably only happens once.

      InputStream in = this.getClass().getResourceAsStream(portalConfig );

      [2] More interestingly, the same at line 175. The catch Exception is overly broad and hides the hints about this.getClass().getResourceAsStream("/" + portalSkin + "/options.config") leaking.

      try

      { Properties p = new Properties(); p.load(this.getClass().getResourceAsStream( "/" + portalSkin + "/options.config")); rc.setOptions(p); }

      catch (Exception ex)

      { log.info("No options loaded ", ex); }

        Gliffy Diagrams

          Zeplin

            Attachments

              Activity

                People

                Assignee:
                dhorwitz David Horwitz
                Reporter:
                a.m.berg@uva.nl Alan Berg
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Git Integration