summaryrefslogtreecommitdiffstats
path: root/theme-compiler
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-02-18 22:15:39 +0200
committerVaadin Code Review <review@vaadin.com>2013-02-19 08:21:27 +0000
commit638bb9263d867f300123acc9023f27ee242e6079 (patch)
tree23e807edc72ff01f943a5a8ab8ba9c9bf754fd55 /theme-compiler
parent9af9a2d1e6dcd6546d181deb6f4537d6d2a4f595 (diff)
downloadvaadin-framework-638bb9263d867f300123acc9023f27ee242e6079.tar.gz
vaadin-framework-638bb9263d867f300123acc9023f27ee242e6079.zip
Fixed logic error causing IOException if stream supports mark (#10851)
The current logic caused mark() never to be called if the original InputStream supports mark (isMarkSupported()). This in turn causes an IOException when reset is called and no mark has been set. Change-Id: I781ed8e9d355d22bd8e43acb5c5e9c8da90f66a0
Diffstat (limited to 'theme-compiler')
-rw-r--r--theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java19
-rw-r--r--theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj4
2 files changed, 14 insertions, 9 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java
index 928c889956..3863a30379 100644
--- a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java
+++ b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.java
@@ -152,6 +152,7 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants {
/**
* This method parses only one rule (style rule or at-rule, except
+ *
* @charset).
*
* @param source
@@ -314,10 +315,12 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants {
String encoding = source.getEncoding();
InputStream input = source.getByteStream();
if (!input.markSupported()) {
+ // If mark is not supported, wrap it in a stream which supports mark
input = new BufferedInputStream(input);
source.setByteStream(input);
- input.mark(100);
}
+ // Mark either the original stream or the wrapped stream
+ input.mark(100);
if (encoding == null) {
encoding = "ASCII";
@@ -6436,6 +6439,13 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants {
return false;
}
+ private boolean jj_3R_252() {
+ if (jj_scan_token(HASH)) {
+ return true;
+ }
+ return false;
+ }
+
private boolean jj_3R_184() {
if (jj_scan_token(SEMICOLON)) {
return true;
@@ -6451,13 +6461,6 @@ public class Parser implements org.w3c.css.sac.Parser, ParserConstants {
return false;
}
- private boolean jj_3R_252() {
- if (jj_scan_token(HASH)) {
- return true;
- }
- return false;
- }
-
private boolean jj_3R_239() {
Token xsp;
xsp = jj_scanpos;
diff --git a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj
index a0bd883101..1f9221de88 100644
--- a/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj
+++ b/theme-compiler/src/com/vaadin/sass/internal/parser/Parser.jj
@@ -319,10 +319,12 @@ public class Parser implements org.w3c.css.sac.Parser {
String encoding = source.getEncoding();
InputStream input = source.getByteStream();
if (!input.markSupported()) {
+ // If mark is not supported, wrap it in a stream which supports mark
input = new BufferedInputStream(input);
source.setByteStream(input);
- input.mark(100);
}
+ // Mark either the original stream or the wrapped stream
+ input.mark(100);
if(encoding == null){
encoding = "ASCII";