This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The following invalid @charset declaration makes the library crash: @charset="utf-8"; (it is invalid because of the "=" sign which should not be there) The exception is as follows: Exception in thread "main" org.w3c.mwi.mobileok.basic.TestException: One or more exceptions were caught while processing the resources: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 java.lang.String.substring(String.java:1949) org.w3c.mwi.mobileok.basic.CSSUtils.extractCSSWarnings(CSSUtils.java:277) org.w3c.mwi.mobileok.basic.CssContent.<init>(CssContent.java:119) org.w3c.mwi.mobileok.basic.MobileOKDecodedContentFactory.decodeContent(MobileOKDecodedContentFactory.java:93) org.w3c.mwi.mobileok.basic.Resource.decode(Resource.java:239) org.w3c.mwi.mobileok.basic.Preprocessor.processResource(Preprocessor.java:475) org.w3c.mwi.mobileok.basic.Preprocessor.access$0(Preprocessor.java:450) org.w3c.mwi.mobileok.basic.Preprocessor$2.run(Preprocessor.java:513) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) java.lang.Thread.run(Thread.java:636) at org.w3c.mwi.mobileok.basic.Preprocessor.preprocess(Preprocessor.java:420) at org.w3c.mwi.mobileok.basic.Tester.getPreprocessorResults(Tester.java:140) at org.w3c.mwi.mobileok.basic.Tester.main(Tester.java:397)
The code was taking for granted that the line that contains the invalid at-rule would contain a space, leading to the out of range exception. Code sanitized. Created a bug on the CSS validator because the messages returned by the CSS validator are a bit misleading in that case: http://www.w3.org/Bugs/Public/show_bug.cgi?id=10124 (bug 10124)