[Git][java-team/qdox2][master] 7 commits: Import Upstream version 2.0~M9
Markus Koschany
gitlab at salsa.debian.org
Tue Oct 2 17:40:15 BST 2018
Markus Koschany pushed to branch master at Debian Java Maintainers / qdox2
Commits:
a0a80f05 by Markus Koschany at 2018-10-02T11:59:43Z
Import Upstream version 2.0~M9
- - - - -
1967b0db by Markus Koschany at 2018-10-02T11:59:46Z
Import Debian changes 2.0~M9-1
qdox2 (2.0~M9-1) unstable; urgency=medium
* New upstream version 2.0~M9.
* Declare compliance with Debian Policy 4.1.5.
- - - - -
c2153867 by Markus Koschany at 2018-10-02T12:00:15Z
Declare compliance with Debian Policy 4.2.1.
- - - - -
9af3662b by Markus Koschany at 2018-10-02T12:00:39Z
d/rules: Remove obsolete inputstreamctor option because it makes the build
FTBFS. Tighten B-D on jflex.
- - - - -
0f898dfa by Markus Koschany at 2018-10-02T12:01:26Z
Update changelog
- - - - -
0e78bd75 by Markus Koschany at 2018-10-02T16:11:19Z
Add debian/JFlexLexer.java and add the old JFlexLexer InputStream constructor
back.
JFlexLexer.java is generated by jflex from src/grammar/lexer.flex. However the
--inputstreamctor option was removed upstream in 1.7.0. Since qdox2 upstream
has not updated the software to work with the latest jflex version, we use the
generated JFlexLexer.java and add the old constructor back. There is certainly
a smarter way to solve that, probably by fixing the lexer.flex file and
updating the qdox2 code and tests.
- - - - -
2435b541 by Markus Koschany at 2018-10-02T16:32:53Z
Update changelog
- - - - -
12 changed files:
- + debian/JFlexLexer.java
- debian/changelog
- debian/control
- debian/rules
- pom.xml
- src/grammar/lexer.flex
- src/grammar/parser.y
- src/main/java/com/thoughtworks/qdox/builder/impl/ModelBuilder.java
- src/main/java/com/thoughtworks/qdox/parser/impl/BinaryClassParser.java
- src/test/java/com/thoughtworks/qdox/JavaProjectBuilderTest.java
- src/test/java/com/thoughtworks/qdox/parser/LexerTest.java
- src/test/java/com/thoughtworks/qdox/parser/ParserTest.java
Changes:
=====================================
debian/JFlexLexer.java
=====================================
The diff for this file was not included because it is too large.
=====================================
debian/changelog
=====================================
@@ -1,3 +1,20 @@
+qdox2 (2.0~M9-2) unstable; urgency=medium
+
+ * Declare compliance with Debian Policy 4.2.1.
+ * d/rules: Remove obsolete inputstreamctor option because it makes the build
+ FTBFS. Tighten B-D on jflex.
+ * Add debian/JFlexLexer.java and add the old JFlexLexer InputStream
+ constructor back.
+
+ -- Markus Koschany <apo at debian.org> Tue, 02 Oct 2018 18:14:57 +0200
+
+qdox2 (2.0~M9-1) unstable; urgency=medium
+
+ * New upstream version 2.0~M9.
+ * Declare compliance with Debian Policy 4.1.5.
+
+ -- Markus Koschany <apo at debian.org> Sun, 29 Jul 2018 04:05:56 +0200
+
qdox2 (2.0~M8-2) unstable; urgency=medium
* Ignore the test failure for now but forward the issue upstream.
=====================================
debian/control
=====================================
@@ -9,13 +9,13 @@ Build-Depends:
debhelper (>= 11),
default-jdk,
default-jdk-doc,
- jflex (>= 1.6.1),
+ jflex (>= 1.7.0),
junit4,
libmaven-exec-plugin-java,
libmaven-javadoc-plugin-java,
libmockito-java,
maven-debian-helper
-Standards-Version: 4.1.3
+Standards-Version: 4.2.1
Vcs-Git: https://anonscm.debian.org/git/pkg-java/qdox2.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/qdox2.git
Homepage: https://github.com/paul-hammant/qdox
=====================================
debian/rules
=====================================
@@ -4,8 +4,11 @@
dh $@
override_dh_auto_build:
- 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
+ #FIXME: JFlexLexer.java is the generated output of lexer.flex with jflex 1.7.0
+ #FIXME: plus the old JFlexLexer InputStream constructor
+ cp debian/JFlexLexer.java src/main/java/com/thoughtworks/qdox/parser/impl
dh_auto_build
get-orig-source:
=====================================
pom.xml
=====================================
@@ -10,7 +10,7 @@
<name>QDox</name>
<groupId>com.thoughtworks.qdox</groupId>
<artifactId>qdox</artifactId>
- <version>2.0-M8</version>
+ <version>2.0-M9</version>
<url>https://github.com/paul-hammant/qdox</url>
<description>
@@ -36,7 +36,7 @@
<connection>scm:git:https://github.com/paul-hammant/qdox.git</connection>
<developerConnection>scm:git:ssh://git@github.com/paul-hammant/qdox.git</developerConnection>
<url>https://github.com/paul-hammant/qdox</url>
- <tag>qdox-2.0-M8</tag>
+ <tag>qdox-2.0-M9</tag>
</scm>
<developers>
@@ -360,7 +360,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.8.2</version>
+ <version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
=====================================
src/grammar/lexer.flex
=====================================
@@ -227,6 +227,7 @@ JavadocEnd = "*"+ "/"
}
<NAME_OR_MODIFIER> {
{Id} / {WhiteSpace}* "." { popState(); pushState(NAME); return Parser.IDENTIFIER; }
+ {Id} / {WhiteSpace}* ";" { popState(); return Parser.IDENTIFIER; }
"static" { return Parser.STATIC; }
"transitive" { return Parser.TRANSITIVE; }
}
=====================================
src/grammar/parser.y
=====================================
@@ -907,6 +907,7 @@ Primary: PrimaryNoNewArray
// MethodInvocation
// MethodReference
PrimaryNoNewArray: Literal
+ | MethodInvocation
| PrimitiveType Dims_opt DOT CLASS
{
$$ = new TypeRefDef(new TypeDef($1.getName(), $2));
@@ -924,7 +925,6 @@ PrimaryNoNewArray: Literal
{
$$ = new TypeRefDef(new TypeDef($1, $2));
}
- | MethodInvocation
| MethodReference
| QualifiedIdentifier
{
@@ -980,7 +980,11 @@ TypeArgumentsOrDiamond_opt:
// Primary . [TypeArguments] Identifier ( [ArgumentList] )
// super . [TypeArguments] Identifier ( [ArgumentList] )
// TypeName . super . [TypeArguments] Identifier ( [ArgumentList] )
-MethodInvocation: IDENTIFIER PARENOPEN ArgumentList_opt PARENCLOSE
+MethodInvocation: Primary DOT TypeParameters_opt IDENTIFIER PARENOPEN ArgumentList_opt PARENCLOSE
+ {
+ $$ = new MethodInvocationDef( $1 + "." + $4, null);
+ }
+ | IDENTIFIER PARENOPEN ArgumentList_opt PARENCLOSE
{
$$ = new MethodInvocationDef($1, null);
}
=====================================
src/main/java/com/thoughtworks/qdox/builder/impl/ModelBuilder.java
=====================================
@@ -499,7 +499,15 @@ public class ModelBuilder implements Builder {
{
return null;
}
+
JavaClass declaringClass = getContext( genericDeclaration );
+ // can't select a declaring class based on the genericDeclaration
+ // likely method specifies its own genericDecleration
+ if ( declaringClass == null )
+ {
+ return null;
+ }
+
TypeResolver typeResolver = TypeResolver.byClassName( declaringClass.getBinaryName(), classLibrary, source.getImports() );
DefaultJavaTypeVariable<G> result = new DefaultJavaTypeVariable<G>( typeVariableDef.getName(), typeResolver );
=====================================
src/main/java/com/thoughtworks/qdox/parser/impl/BinaryClassParser.java
=====================================
@@ -50,7 +50,10 @@ public class BinaryClassParser
{
try
{
- if(declaringClazz.getPackage() != null)
+ // Spec change in Java 9:
+ // "If this class represents an array type, a primitive type or void, this method returns null."
+ // This means that classes without package will get a package with empty name
+ if ( declaringClazz.getPackage() != null && !"".equals( declaringClazz.getPackage().getName() ) )
{
binaryBuilder.addPackage( new PackageDef( declaringClazz.getPackage().getName() ) );
}
=====================================
src/test/java/com/thoughtworks/qdox/JavaProjectBuilderTest.java
=====================================
@@ -1645,6 +1645,21 @@ public class JavaProjectBuilderTest extends TestCase
assertTrue( classA.getImplements().equals( Arrays.asList( builder.getClassByName( "Itf2" ) ) ) );
}
+ public void testGenericEnumMethod() throws Exception {
+ String source = "package java.time.temporal;\r\n" +
+ "public final class IsoFields {\r\n" +
+ " private static enum Field implements TemporalField {\r\n" +
+ " DAY_OF_QUARTER {\r\n" +
+ " public <R extends Temporal> R adjustInto(R temporal, long newValue) {\r\n" +
+ " return null;\r\n" +
+ " }\r\n" +
+ " }\r\n" +
+ " }\r\n" +
+ "}";
+
+ builder.addSource( new StringReader( source ) );
+ }
+
public void testDeclarationSignatureWithGenerics() {
String source = "import java.util.List;"
+ "public interface Test {"
@@ -1708,6 +1723,16 @@ public class JavaProjectBuilderTest extends TestCase
builder.addSource( new StringReader( source ) );
}
+ public void testSimpleModule()
+ {
+ String source = "module bar {\r\n" +
+ " requires foo.foo;\r\n" +
+ "}";
+
+ builder.addSource( new StringReader( source ) );
+
+ }
+
public void testLineNumbers() {
String source = "package foo.bar;\n" +
"/** some javadoc */\n" +
=====================================
src/test/java/com/thoughtworks/qdox/parser/LexerTest.java
=====================================
@@ -902,14 +902,18 @@ public class LexerTest extends TestCase {
throws Exception
{
String in = "open module module.module {\n" +
+ " requires requires;\n" +
" requires requires.requires;\n" +
" requires transitive transitive.transitive;\n" +
" requires static requires.transitive;\n" +
" requires transitive static requires.transitive;\n" +
+ " exports exports;\n" +
" exports exports.exports;\n" +
" exports to.to to to.to, to.to;\n" +
+ " opens opens;\n" +
" opens opens.opens;\n" +
" opens to.to to to.to, to.to;\n" +
+ " uses uses;\n" +
" uses uses.uses;\n" +
" provides with.with with with.with, with.with;\n" +
"}";
@@ -921,7 +925,11 @@ public class LexerTest extends TestCase {
assertLex( Parser.DOT, lexer );
assertLex( Parser.IDENTIFIER, "module", lexer );
assertLex( Parser.BRACEOPEN, lexer );
-
+
+ assertLex( Parser.REQUIRES, lexer );
+ assertLex( Parser.IDENTIFIER, "requires", lexer );
+ assertLex( Parser.SEMI, lexer );
+
assertLex( Parser.REQUIRES, lexer );
assertLex( Parser.IDENTIFIER, "requires", lexer );
assertLex( Parser.DOT, lexer );
@@ -950,6 +958,10 @@ public class LexerTest extends TestCase {
assertLex( Parser.IDENTIFIER, "transitive", lexer );
assertLex( Parser.SEMI, lexer );
+ assertLex( Parser.EXPORTS, lexer );
+ assertLex( Parser.IDENTIFIER, "exports", lexer );
+ assertLex( Parser.SEMI, lexer );
+
assertLex( Parser.EXPORTS, lexer );
assertLex( Parser.IDENTIFIER, "exports", lexer );
assertLex( Parser.DOT, lexer );
@@ -970,6 +982,10 @@ public class LexerTest extends TestCase {
assertLex( Parser.IDENTIFIER, "to", lexer );
assertLex( Parser.SEMI, lexer );
+ assertLex( Parser.OPENS, lexer );
+ assertLex( Parser.IDENTIFIER, "opens", lexer );
+ assertLex( Parser.SEMI, lexer );
+
assertLex( Parser.OPENS, lexer );
assertLex( Parser.IDENTIFIER, "opens", lexer );
assertLex( Parser.DOT, lexer );
@@ -990,6 +1006,10 @@ public class LexerTest extends TestCase {
assertLex( Parser.IDENTIFIER, "to", lexer );
assertLex( Parser.SEMI, lexer );
+ assertLex( Parser.USES, lexer );
+ assertLex( Parser.IDENTIFIER, "uses", lexer );
+ assertLex( Parser.SEMI, lexer );
+
assertLex( Parser.USES, lexer );
assertLex( Parser.IDENTIFIER, "uses", lexer );
assertLex( Parser.DOT, lexer );
=====================================
src/test/java/com/thoughtworks/qdox/parser/ParserTest.java
=====================================
@@ -3022,6 +3022,56 @@ public class ParserTest extends TestCase {
verify( builder ).endField();
verify( builder ).endClass();
}
+
+ public void testStringBasedEnum()
+ throws Exception
+ {
+ setupLex( Parser.PUBLIC );
+ setupLex( Parser.ENUM );
+ setupLex( Parser.IDENTIFIER, "StringBasedEnum" );
+
+ setupLex( Parser.BRACEOPEN );
+
+ setupLex( Parser.IDENTIFIER, "LIST" );
+ setupLex( Parser.PARENOPEN );
+ setupLex( Parser.IDENTIFIER, "List" );
+ setupLex( Parser.DOT );
+ setupLex( Parser.CLASS );
+ setupLex( Parser.DOT );
+ setupLex( Parser.IDENTIFIER, "getName" );
+ setupLex( Parser.PARENOPEN );
+ setupLex( Parser.PARENCLOSE );
+ setupLex( Parser.PARENCLOSE );
+ setupLex( Parser.SEMI );
+
+ setupLex( Parser.IDENTIFIER, "StringBasedEnum" );
+ setupLex( Parser.PARENOPEN );
+ setupLex( Parser.IDENTIFIER, "String" );
+ setupLex( Parser.IDENTIFIER, "className" );
+ setupLex( Parser.PARENCLOSE );
+ setupLex( Parser.CODEBLOCK, "}" );
+
+ setupLex( Parser.BRACECLOSE );
+ setupLex( 0 );
+
+ Parser parser = new Parser( lexer, builder );
+ parser.setDebugParser( true );
+ parser.parse();
+
+ ArgumentCaptor<ClassDef> classCaptor = ArgumentCaptor.forClass( ClassDef.class );
+ ArgumentCaptor<FieldDef> fieldCaptor = ArgumentCaptor.forClass( FieldDef.class );
+ ArgumentCaptor<ExpressionDef> argumentCaptor = ArgumentCaptor.forClass( ExpressionDef.class );
+ ArgumentCaptor<MethodDef> methodCaptor = ArgumentCaptor.forClass( MethodDef.class );
+
+ verify( builder ).beginClass( classCaptor.capture() );
+ verify( builder ).beginField( fieldCaptor.capture() );
+ verify( builder ).addArgument( argumentCaptor.capture() );
+ verify( builder ).endField();
+ verify( builder ).beginConstructor();
+ verify( builder ).addParameter( fieldCaptor.capture() );
+ verify( builder ).endConstructor( methodCaptor.capture() );
+ verify( builder ).endClass();
+ }
private void setupLex(int token, String value) {
lexValues.add( token );
View it on GitLab: https://salsa.debian.org/java-team/qdox2/compare/6d24b7049ae281edcfa75e69dc7bb2546afb4760...2435b541774c97ff85849b4614c699afaa5c0560
--
View it on GitLab: https://salsa.debian.org/java-team/qdox2/compare/6d24b7049ae281edcfa75e69dc7bb2546afb4760...2435b541774c97ff85849b4614c699afaa5c0560
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20181002/ee730065/attachment.html>
More information about the pkg-java-commits
mailing list