qdox/0001-Port-to-JFlex-1.7.0.patch

40 lines
1.7 KiB
Diff
Raw Normal View History

From 31f530b26bd4625ffe41aa16c48836455ef81c23 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Fri, 7 Jun 2019 10:39:34 +0200
Subject: [PATCH] Port to JFlex 1.7.0
---
src/grammar/lexer.flex | 2 +-
.../java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/grammar/lexer.flex b/src/grammar/lexer.flex
index 9b567ff..cd9d5b6 100644
--- a/src/grammar/lexer.flex
+++ b/src/grammar/lexer.flex
@@ -168,7 +168,7 @@ import java.util.*;
}
public JFlexLexer( java.io.InputStream stream, java.io.Writer writer ) {
- this( stream );
+ this( new java.io.InputStreamReader( stream, java.nio.charset.Charset.forName( "UTF-8" ) ) );
this.writer = writer;
}
diff --git a/src/main/java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java b/src/main/java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java
index c947f9b..5b415c0 100644
--- a/src/main/java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java
+++ b/src/main/java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java
@@ -112,7 +112,7 @@ public class ClassLoaderLibrary
if ( sourceStream != null )
{
Builder builder = getModelBuilder();
- JavaLexer lexer = new JFlexLexer( sourceStream );
+ JavaLexer lexer = new JFlexLexer( new java.io.InputStreamReader( sourceStream, java.nio.charset.Charset.forName( "UTF-8" ) ) );
Parser parser = new Parser( lexer, builder );
parser.setDebugLexer( debugLexer );
parser.setDebugParser( debugParser );
--
2.21.0