Uploaded image for project: 'SmartSprites'
  1. SmartSprites
  2. SMARTSPRITES-78

SmartSprites 0.2.7 throws StringIndexOutOfBoundsExeception when run in Windows system

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.2.7
    • Fix Version/s: 0.2.8
    • Labels:
      None

      Description

      When SmartSprites run in Windows system, it throws this exception:

      ---------------------------------------------------
      INFO: Initializing Spring FrameworkServlet 'spring'
      Jan 24, 2011 9:49:25 AM org.apache.catalina.core.StandardContext loadOnStartup
      SEVERE: Servlet / threw load() exception
      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      at java.lang.String.substring(String.java:1937)
      at org.carrot2.labs.smartsprites.SpriteBuilder.createProcessedCss(SpriteBuilder.java:327)
      at org.carrot2.labs.smartsprites.SpriteBuilder.rewriteCssFiles(SpriteBuilder.java:260)
      at org.carrot2.labs.smartsprites.SpriteBuilder.buildSprites(SpriteBuilder.java:211)
      ...
      ---------------------------------------------------

      I think the problem is on this part of the code:

      "originalCssFile.lastIndexOf(File.separatorChar)"

      The css file is using the forward slash "/", but when the SmartSprites runs in Windows, it will try to look for "\", which is not found!
      /** sprite: iconSprite; sprite-image: url('../../../img/bg_sprite_icons.png'); sprite-layout: vertical; */

        Attachments

          Activity

            People

            • Assignee:
              stachoo Stanisław Osiński
              Reporter:
              davcai David Cai
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0h
                0h
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h