Permalink
Browse files

JBRULES-2853 +JBRULES-3341: Fix ReaderResource too

(cherry picked from commit 9403902)
  • Loading branch information...
ge0ffrey committed Mar 29, 2012
1 parent c9d0a5b commit b2a10a65b84ee8c523331a078d4aa067b2f2efed
Showing with 4 additions and 0 deletions.
  1. +4 −0 drools-compiler/src/main/java/org/drools/compiler/DrlParser.java
@@ -30,6 +30,7 @@
import org.drools.io.Resource;
import org.drools.io.impl.ClassPathResource;
import org.drools.io.impl.InputStreamResource;
+import org.drools.io.impl.ReaderResource;
import org.drools.lang.DRLLexer;
import org.drools.lang.DRLParser;
import org.drools.lang.DroolsSentence;
@@ -146,6 +147,9 @@ public PackageDescr parse(final boolean isEditor,
if (resource instanceof ClassPathResource) {
encoding = ((ClassPathResource) resource).getEncoding();
}
+ if (resource instanceof ReaderResource) {
+ encoding = ((ReaderResource) resource).getEncoding();
+ }
if (resource instanceof InputStreamResource) {
encoding = ((InputStreamResource) resource).getEncoding();
}

0 comments on commit b2a10a6

Please sign in to comment.