ICEpdf
  1. ICEpdf
  2. PDF-25

Stackoverflow bug found on Defs.property when running as applet

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 3.0
    • Fix Version/s: 4.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      JDK 1.6u7, Windows XP SP2, IExplorer 8 or FireFox 3.x

      Description

      Hi! I am evaluating IcePdf to use it for an applet that will print the PDF referenced by an URL, but it does not work, and I get this error:

      Code:

       java.lang.StackOverflowError
        at java.lang.ref.ReferenceQueue.poll(Unknown Source)
        at java.util.WeakHashMap.expungeStaleEntries(Unknown Source)
        at java.util.WeakHashMap.getTable(Unknown Source)
        at java.util.WeakHashMap.get(Unknown Source)
        at java.util.Collections$SynchronizedMap.get(Unknown Source)
        at sun.security.provider.PolicyFile.implies(Unknown Source)
        at java.security.ProtectionDomain.implies(Unknown Source)
        at java.security.AccessControlContext.checkPermission(Unknown Source)
        at java.security.AccessController.checkPermission(Unknown Source)
        at java.lang.SecurityManager.checkPermission(Unknown Source)
        at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
        at java.lang.System.getProperty(Unknown Source)
        at org.icepdf.core.util.Defs.property(Unknown Source)
        at org.icepdf.core.util.Defs.property(Unknown Source)
        at org.icepdf.core.util.Defs.property(Unknown Source)
       



      The problem seems to be at org.icepdf.core.util.Defs.property:

      Code:

       
       public static String property(String paramString1, String paramString2)
         {
           try
           {
             return System.getProperty(paramString1, paramString2);
           }
           catch (SecurityException localSecurityException)
           {
             property(paramString1, paramString2);
           }
           return paramString2;
         }
       
       
      If a SecurityException is produced, the catch will recursively call the property "ad infinitum" an eventually that will cause an StackOverflowError, what it should do is present me with the error message of the SecurityException.

        Activity

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Francisco Peredo
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: