This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 69708 - Exception when check cascade style sheet
Summary: Exception when check cascade style sheet
Status: RESOLVED WONTFIX
Alias: None
Product: web
Classification: Unclassified
Component: CSS Visual Tools (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-01 15:39 UTC by _ viendu
Modified: 2009-12-21 05:05 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ viendu 2005-12-01 15:39:53 UTC
Using Netbeans beta 2, under Mandrake linux, to check a cascade style sheet
(using the green arrow down button), an exception is thrown.  The content of a
css file (test.css) is:

table.componentList img {
  behavior:url();
}

The exception:
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.String.charAt(String.java:558)
	at org.w3c.flute.parser.Parser.url(Parser.java:2772)
	at org.w3c.flute.parser.Parser.term(Parser.java:2466)
	at org.w3c.flute.parser.Parser.expr(Parser.java:2202)
	at org.w3c.flute.parser.Parser.declaration(Parser.java:2081)
	at org.w3c.flute.parser.Parser.styleRule(Parser.java:1405)
	at org.w3c.flute.parser.Parser.afterImportDeclaration(Parser.java:561)
	at org.w3c.flute.parser.Parser.parserUnit(Parser.java:498)
	at org.w3c.flute.parser.Parser.parseStyleSheet(Parser.java:107)
	at org.w3c.flute.parser.Parser.parseStyleSheet(Parser.java:119)
	at
org.netbeans.modules.css.actions.CheckStyleAction.performAction(CheckStyleAction.java:90)
	at org.openide.util.actions.NodeAction$3.run(NodeAction.java:531)
	at
org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.actionPerformed(ActionsBridge.java:81)
	at org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:74)
	at
org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:24)
	at
org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.doRun(ActionsBridge.java:72)
	at org.netbeans.modules.openide.util.ActionsBridge$1.run(ActionsBridge.java:41)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:471)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:904)
Comment 1 Petr Pisl 2005-12-08 17:48:22 UTC
It looks like problem in the w3c parser. I'm afraid we will not have time to fix
it in NB 5.0 timeframe
Comment 2 Marek Fukala 2007-10-22 11:35:24 UTC
This is a bug in Flute parser implementation, specifically in Parser.url() method: 

String urlname = n.image.substring(4, n.image.length()-1).trim();

...is errorneous since it supposes the content of the URL in some form which doesn't need to be always true.

I tried Flute 1.3, but it contains the same error.

So we can:
1) fix the Flute parser sources and distribute patched version. W3C license allows this IMHO.
2) replace the Flute parser by some other, like Batik
3) just catch the exceptions from the parser and present them to the user in some more reasonable form.

My preference is - do #3 in any case, then probably #1, then #2

Opinions?

BTW, there is more issue related to bugs in flute, I marked them by FLUTE status whiteboard.

Comment 3 Marek Fukala 2007-11-03 21:55:07 UTC
I have implemented the option #3 - a message about internal flute error is written into the css check output window +
the exception is logged with INFO level.

I am leaving the issue opened so we can track the flute problem somehow.

Checking in CheckStyleAction.java;
/cvs/web/css/src/org/netbeans/modules/css/actions/CheckStyleAction.java,v  <--  CheckStyleAction.java
new revision: 1.3; previous revision: 1.2
done
Comment 4 Marek Fukala 2008-02-25 16:38:09 UTC
minor issue, fixed on nb side already
Comment 5 Jiri Prox 2008-04-11 01:13:55 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 6 Quality Engineering 2009-12-21 05:05:43 UTC
This bug was reported against NetBeans IDE 6.0 or an older release, or against a non-maintained module. NetBeans team does not have enough resources to get to this issue, therefore we are closing the issue as a WONTFIX. If you are interested in providing a patch for this bug, please see our NetFIX guidelines for how to proceed. 

We apologize for any inconvenience.


Thank you.
The NetBeans Team