Skip to content
Commits on Source (5)
language: java
jdk:
- openjdk7
- oraclejdk8
- openjdk8
- openjdk11
script: mvn clean verify
qdox2 (2.0.0-1) unstable; urgency=medium
* New upstream version 2.0.0.
* Declare compliance with Debian Policy 4.4.1.
* Switch to debhelper-compat = 12.
-- Markus Koschany <apo@debian.org> Fri, 13 Dec 2019 00:24:45 +0100
qdox2 (2.0~M10-1) unstable; urgency=medium
* New upstream version 2.0~M10.
......
......@@ -6,7 +6,7 @@ Uploaders:
Markus Koschany <apo@debian.org>
Build-Depends:
byacc-j,
debhelper (>= 11),
debhelper-compat (= 12),
default-jdk,
default-jdk-doc,
jflex (>= 1.7.0),
......@@ -15,7 +15,7 @@ Build-Depends:
libmaven-javadoc-plugin-java,
libmockito-java,
maven-debian-helper
Standards-Version: 4.3.0
Standards-Version: 4.4.1
Vcs-Git: https://salsa.debian.org/java-team/qdox2.git
Vcs-Browser: https://salsa.debian.org/java-team/qdox2
Homepage: https://github.com/paul-hammant/qdox
......
......@@ -10,7 +10,7 @@
<name>QDox</name>
<groupId>com.thoughtworks.qdox</groupId>
<artifactId>qdox</artifactId>
<version>2.0-M10</version>
<version>2.0.0</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-M10</tag>
<tag>qdox-2.0.0</tag>
</scm>
<developers>
......@@ -139,12 +139,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<version>2.22.1</version>
<configuration>
<reuseForks>false</reuseForks>
</configuration>
......@@ -174,7 +174,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<version>3.8.2</version>
<configuration>
<templateFile>${basedir}/src/site/templates/site.vm</templateFile>
</configuration>
......@@ -298,7 +298,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<version>2.22.1</version>
<executions>
<execution>
<goals>
......@@ -311,7 +311,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>2.0.0</version>
<version>3.2.0</version>
<configuration>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<postBuildHookScript>verify</postBuildHookScript>
......@@ -322,6 +322,10 @@
</goals>
<settingsFile>src/it/settings.xml</settingsFile>
<debug>true</debug>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
</configuration>
<executions>
<execution>
......
......@@ -56,7 +56,7 @@ import java.util.Stack;
%token <ival> PLUSPLUS MINUSMINUS
%token <sval> SUPER
%token <sval> EQUALS STAREQUALS SLASHEQUALS PERCENTEQUALS PLUSEQUALS MINUSEQUALS LESSTHAN2EQUALS GREATERTHAN2EQUALS GREATERTHAN3EQUALS AMPERSANDEQUALS CIRCUMFLEXEQUALS VERTLINEEQUALS
%type <type> PrimitiveType ReferenceType ArrayType ClassOrInterfaceType
%type <type> PrimitiveType ReferenceType ArrayType ClassOrInterfaceType TypeVariable
%type <annoval> Expression Literal Annotation ElementValue ElementValueArrayInitializer
%type <annoval> ConditionalExpression ConditionalOrExpression ConditionalAndExpression InclusiveOrExpression ExclusiveOrExpression AndExpression
%type <annoval> EqualityExpression RelationalExpression ShiftExpression AdditiveExpression MultiplicativeExpression
......@@ -1441,20 +1441,50 @@ Type: PrimitiveType
// ClassOrInterfaceType
// TypeVariable
// ArrayType
ReferenceType: ArrayType
ReferenceType: TypeVariable
| ArrayType
| ClassOrInterfaceType
;
// Actually
// ClassOrInterfaceType:
// ClassType
// InterfaceType
// ClassType:
// {Annotation} Identifier [TypeArguments]
// ClassOrInterfaceType . {Annotation} Identifier [TypeArguments]
// {Annotation} TypeIdentifier [TypeArguments]
// PackageName . {Annotation} TypeIdentifier [TypeArguments]
// ClassOrInterfaceType . {Annotation} TypeIdentifier [TypeArguments]
// InterfaceType:
// ClassType
// Parser can't see the difference
ClassOrInterfaceType: QualifiedIdentifier /* =PackageName */ DOT Annotations_opt IDENTIFIER
{
TypeDef td = new TypeDef($1 + '.' + $4,0);
$$ = typeStack.push(td);
}
TypeArguments_opt
{
$$ = typeStack.pop();
};
|
TypeDeclSpecifier
{
TypeDef td = new TypeDef($1,0);
$$ = typeStack.push(td);
}
TypeArguments_opt
{
$$ = typeStack.pop();
};
// TypeVariable:
// {Annotation} Identifier
TypeVariable: Annotations_opt QualifiedIdentifier
{
$$ = new TypeDef($2,0);
}
;
// ArrayType:
// PrimitiveType Dims
......@@ -1649,20 +1679,6 @@ PrimitiveType: BYTE
;
// Actually
// ClassOrInterfaceType: ClassType | InterfaceType;
// ClassType: TypeDeclSpecifier TypeArguments_opt
// InterfaceType: TypeDeclSpecifier TypeArguments_opt
// Parser can't see the difference
ClassOrInterfaceType: TypeDeclSpecifier
{
TypeDef td = new TypeDef($1,0);
$$ = typeStack.push(td);
}
TypeArguments_opt
{
$$ = typeStack.pop();
};
// Actually
// TypeDeclSpecifier: TypeName | ClassOrInterfaceType . Identifier
// TypeName: Identifier | TypeName . Identifier
TypeDeclSpecifier: QualifiedIdentifier
......
......@@ -143,6 +143,11 @@ public class DefaultJavaClass
public JavaType getSuperClass()
{
JavaType result = null;
if(isPrimitive()) {
return null;
}
JavaClass OBJECT_JAVACLASS = getJavaClassLibrary().getJavaClass( "java.lang.Object" );
JavaClass ENUM_JAVACLASS = getJavaClassLibrary().getJavaClass( "java.lang.Enum" );
......
......@@ -324,7 +324,7 @@
## Workaround for DOXIA-150 due to a non-desired behaviour in p-u
## @see org.codehaus.plexus.util.xml.Xpp3Dom#toString()
## @see org.codehaus.plexus.util.xml.Xpp3Dom#toUnescapedString()
#set ( $documentHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" )
#set ( $documentHeader = "<?xml version=""1.0"" encoding=""UTF-8""?>" )
#set ( $documentHeader = $documentHeader.replaceAll( "\\", "" ) )
#if ( $item.name == "script" )
$StringUtils.replace( $item.toUnescapedString(), $documentHeader, "" )
......
......@@ -90,4 +90,14 @@ public class ClassResolutionTest
assertEquals( "some.pack.Test.Inner.Inner2", parameter.getType().getFullyQualifiedName() );
assertEquals( "some.pack.Test.Inner.Inner2", parameter.getFullyQualifiedName() );
}
public void testIsAWithPrimitives()
{
JavaProjectBuilder builder = new JavaProjectBuilder();
String source = "class Foo { public byte[] bar() { return null; } }";
builder.addSource( new StringReader( source ) );
JavaMethod method = builder.getClassByName("Foo").getMethods().get(0);
JavaClass returns = method.getReturns();
assertFalse(returns.isA(builder.getClassByName("java.lang.Object")));
}
}
......@@ -3,8 +3,10 @@ package com.thoughtworks.qdox;
import static org.mockito.Mockito.*;
import java.io.StringReader;
import java.util.Collection;
import java.util.Collections;
import com.thoughtworks.qdox.model.impl.DefaultJavaParameterizedType;
import junit.framework.TestCase;
import com.thoughtworks.qdox.model.JavaClass;
......@@ -140,6 +142,26 @@ public class GenericsTest extends TestCase {
assertEquals("Bar", builder.getClassByName("Bar").getName());
}
public void testShouldUnderstandAnnotationsOnTypeParameters() {
String source = "import com.foo.Item;\n" +
"public class Bar {\n" +
" public static Collection<Item> foo() { }\n" +
" public static Collection<com.foo.Item> foo2() { }\n" +
" public static Collection<@Annot Item> foo3() { }\n" +
" public static Collection<@Annot com.foo.Item> foo4() { }\n" +
" public static Collection<com.foo.@Annot Item> foo5() { }\n" +
"}";
builder.addSource(new StringReader(source));
JavaClass bar = builder.getClassByName("Bar");
assertEquals("Bar", bar.getName());
assertEquals(builder.getClassByName("com.foo.Item"), (( (DefaultJavaParameterizedType)bar.getMethods().get(0).getReturns()).getActualTypeArguments().get(0)));
assertEquals(builder.getClassByName("com.foo.Item"), (( (DefaultJavaParameterizedType)bar.getMethods().get(1).getReturns()).getActualTypeArguments().get(0)));
assertEquals(builder.getClassByName("com.foo.Item"), (( (DefaultJavaParameterizedType)bar.getMethods().get(2).getReturns()).getActualTypeArguments().get(0)));
assertEquals(builder.getClassByName("com.foo.Item"), (( (DefaultJavaParameterizedType)bar.getMethods().get(3).getReturns()).getActualTypeArguments().get(0)));
assertEquals(builder.getClassByName("com.foo.Item"), (( (DefaultJavaParameterizedType)bar.getMethods().get(4).getReturns()).getActualTypeArguments().get(0)));
}
public void testGenericField() {
// Also see QDOX-77
String source = "" +
......
......@@ -1639,8 +1639,6 @@ public class JavaProjectBuilderTest extends TestCase
" SomeEnum(String string, int integer, String[] stringArray) {\n" +
" }\r\n" +
"}";
builder.setDebugParser( true );
builder.addSource( new StringReader( source ) );
}
......@@ -1766,8 +1764,6 @@ public class JavaProjectBuilderTest extends TestCase
"MyAnnoInterface{}\n" +
"interface NewLineInterface \n" +
"{}";
// builder.setDebugLexer( true );
builder.setDebugParser( true );
JavaSource jSource = builder.addSource( new StringReader( source ) );
assertEquals( 3, jSource.getClassByName( "MyClass" ).getLineNumber() );
assertEquals( 5, jSource.getClassByName( "MyClass" ).getFieldByName( "CONSTANT1" ).getLineNumber() );
......
......@@ -3055,7 +3055,6 @@ public class ParserTest extends TestCase {
setupLex( 0 );
Parser parser = new Parser( lexer, builder );
parser.setDebugParser( true );
parser.parse();
ArgumentCaptor<ClassDef> classCaptor = ArgumentCaptor.forClass( ClassDef.class );
......