From 051003681361fd0d74d2f69a798ad644f9fe59b2 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Sun, 18 Aug 2019 12:52:37 +0200 Subject: [PATCH] port to jflex 1.7.0 --- .gitignore | 13 +++++++----- 0001-Port-to-JFlex-1.7.0.patch | 39 ++++++++++++++++++++++++++++++++++ qdox.spec | 11 +++++++--- 3 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 0001-Port-to-JFlex-1.7.0.patch diff --git a/.gitignore b/.gitignore index 02ce7c3..e9fe0a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,11 @@ -qdox-1.6.1-src.tar.gz -qdox-1.9.2-src.tar.gz -qdox-1.10.1.tar.bz2 -qdox-1.11-project.tar.bz2 -qdox-1.12-project.tar.bz2 +/results_* +/*.src.rpm + +/qdox-1.6.1-src.tar.gz +/qdox-1.9.2-src.tar.gz +/qdox-1.10.1.tar.bz2 +/qdox-1.11-project.tar.bz2 +/qdox-1.12-project.tar.bz2 /qdox-1.12.1-project.tar.bz2 /qdox-2.0-M2-project.tar.gz /qdox-2.0-M3-project.tar.gz diff --git a/0001-Port-to-JFlex-1.7.0.patch b/0001-Port-to-JFlex-1.7.0.patch new file mode 100644 index 0000000..441858b --- /dev/null +++ b/0001-Port-to-JFlex-1.7.0.patch @@ -0,0 +1,39 @@ +From 31f530b26bd4625ffe41aa16c48836455ef81c23 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +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 + diff --git a/qdox.spec b/qdox.spec index 2870a4f..ea44eab 100644 --- a/qdox.spec +++ b/qdox.spec @@ -3,7 +3,7 @@ Summary: Extract class/interface/method definitions from sources Name: qdox Version: 2.0 -Release: 5.%{vertag}%{?dist} +Release: 6.%{vertag}%{?dist} Epoch: 0 License: ASL 2.0 URL: https://github.com/paul-hammant/qdox @@ -15,6 +15,7 @@ Source1: qdox-MANIFEST.MF # Remove bundled binaries which are possibly proprietary Source2: generate-tarball.sh +Patch0: 0001-Port-to-JFlex-1.7.0.patch BuildRequires: maven-local BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin) @@ -41,6 +42,7 @@ API docs for %{name}. %prep %setup -q -n %{name}-%{version}-%{vertag} +%patch0 -p1 find -name *.jar -delete rm -rf bootstrap @@ -57,8 +59,8 @@ rm -rf bootstrap %build # Generate scanners (upstream does this with maven-jflex-plugin) -jflex --inputstreamctor -d src/main/java/com/thoughtworks/qdox/parser/impl src/grammar/lexer.flex -jflex --inputstreamctor -d src/main/java/com/thoughtworks/qdox/parser/impl src/grammar/commentlexer.flex +jflex -d src/main/java/com/thoughtworks/qdox/parser/impl src/grammar/lexer.flex +jflex -d src/main/java/com/thoughtworks/qdox/parser/impl src/grammar/commentlexer.flex # Build artifact %mvn_build -f -- -Dqdox.byaccj.executable=byaccj @@ -76,6 +78,9 @@ jar ufm target/%{name}-%{version}*.jar %{SOURCE1} %doc LICENSE.txt %changelog +* Sun Aug 18 2019 Fabio Valentini - 0:2.0-6.M9 +- Port to jflex 1.7.0. + * Fri Jul 26 2019 Fedora Release Engineering - 0:2.0-5.M9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild