port to jflex 1.7.0

This commit is contained in:
Fabio Valentini 2019-08-18 12:52:37 +02:00
parent 1727b9134f
commit 0510036813
No known key found for this signature in database
GPG Key ID: 5AC5F572E5D410AF
3 changed files with 55 additions and 8 deletions

13
.gitignore vendored
View File

@ -1,8 +1,11 @@
qdox-1.6.1-src.tar.gz /results_*
qdox-1.9.2-src.tar.gz /*.src.rpm
qdox-1.10.1.tar.bz2
qdox-1.11-project.tar.bz2 /qdox-1.6.1-src.tar.gz
qdox-1.12-project.tar.bz2 /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-1.12.1-project.tar.bz2
/qdox-2.0-M2-project.tar.gz /qdox-2.0-M2-project.tar.gz
/qdox-2.0-M3-project.tar.gz /qdox-2.0-M3-project.tar.gz

View File

@ -0,0 +1,39 @@
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

View File

@ -3,7 +3,7 @@
Summary: Extract class/interface/method definitions from sources Summary: Extract class/interface/method definitions from sources
Name: qdox Name: qdox
Version: 2.0 Version: 2.0
Release: 5.%{vertag}%{?dist} Release: 6.%{vertag}%{?dist}
Epoch: 0 Epoch: 0
License: ASL 2.0 License: ASL 2.0
URL: https://github.com/paul-hammant/qdox URL: https://github.com/paul-hammant/qdox
@ -15,6 +15,7 @@ Source1: qdox-MANIFEST.MF
# Remove bundled binaries which are possibly proprietary # Remove bundled binaries which are possibly proprietary
Source2: generate-tarball.sh Source2: generate-tarball.sh
Patch0: 0001-Port-to-JFlex-1.7.0.patch
BuildRequires: maven-local BuildRequires: maven-local
BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin)
@ -41,6 +42,7 @@ API docs for %{name}.
%prep %prep
%setup -q -n %{name}-%{version}-%{vertag} %setup -q -n %{name}-%{version}-%{vertag}
%patch0 -p1
find -name *.jar -delete find -name *.jar -delete
rm -rf bootstrap rm -rf bootstrap
@ -57,8 +59,8 @@ rm -rf bootstrap
%build %build
# Generate scanners (upstream does this with maven-jflex-plugin) # 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 -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/commentlexer.flex
# Build artifact # Build artifact
%mvn_build -f -- -Dqdox.byaccj.executable=byaccj %mvn_build -f -- -Dqdox.byaccj.executable=byaccj
@ -76,6 +78,9 @@ jar ufm target/%{name}-%{version}*.jar %{SOURCE1}
%doc LICENSE.txt %doc LICENSE.txt
%changelog %changelog
* Sun Aug 18 2019 Fabio Valentini <decathorpe@gmail.com> - 0:2.0-6.M9
- Port to jflex 1.7.0.
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.0-5.M9 * Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.0-5.M9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild