Uploaded image for project: 'Maven Project Info Reports Plugin'
  1. Maven Project Info Reports Plugin
  2. MPIR-199

ProjectInfoReportUtils.java : Avoid using blocking call [ url.openStream() ] while opening stream from an URL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.1, 2.1.2, 2.2
    • 2.3
    • dependencies
    • None
    • any, with no internet connectivity [=~ intranet , behind proxy etc.. ]

    Description

      This issue is related to http://jira.codehaus.org/browse/MPIR-150

      it would be nice if url.openStream();
      from

      ProjectInfoReportUtils.java
      InputStream in =null;
      
      try
      {
        in = url.openStream();
      

      can be replaced with

      //Define constant TIMEOUT with pre set timeout
       
        InputStream in =null;
      
        try
        {
         URLConnection conn = url.openConnection();
         conn.setConnectTimeout(TIMEOUT);
         conn.setReadTimeout(TIMEOUT);
         in = conn.getInputStream();
      

      url.openStream(); is a blocking call that makes caller wait forever and eventually timeouts at the end

      Attachments

        Activity

          People

            siveton Siveton Vincent
            prashant.bhate Prashant Bhate
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: