Uploaded image for project: 'Commons Validator'
  1. Commons Validator
  2. VALIDATOR-16

ValidatorAction class issue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.1.1 (alpha)
    • None
    • None
    • None
    • Operating System: other
      Platform: PC

    • 28257

    Description

      I'm currently using commons-validator 1.1.1 in a Java Web Start client bundled
      with jre 1.4.2.
      Whenever using a JNLP file to download the application, commons-validator hangs
      in ValidatorAction class and to be more precise, it hangs in readJavascriptFile
      method.

      Debugging that method I found a while loop that reads a javascript resource
      based on InputStream.available() and InputStream.read() methods.
      It seems that inside a Web Start environment, available() method always returns
      a positive number while read() method is returning a negative number (-1) which
      leads to a infinite loop.

      That doesn't happen using a regular jar or class file to kick off the
      application. I really don't know why this happens in Web Start environment but
      either way, I've listened that InputStream.available() is not a very trusted
      method. Does it make sense?

      I've also downloaded commons-validator 1.1.2 but it has the same issue.
      I've also tested Java Web Start bundled with jre 1.5 beta - it does not hang in
      this environment.
      The same behavior happens in a W2K/XP box as in a Mandrake Linux box.

      Mike

      Attachments

        Activity

          People

            Unassigned Unassigned
            mike@summa-tech.com Liaw Mike
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: