Accepting request 662846 from Java:packages
fix build against QDox 2.0 OBS-URL: https://build.opensuse.org/request/show/662846 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xmlgraphics-fop?expand=0&rev=39
This commit is contained in:
commit
6b3663a3f9
151
fop-2.1-QDox-2.0.patch
Normal file
151
fop-2.1-QDox-2.0.patch
Normal file
@ -0,0 +1,151 @@
|
||||
diff -urEbwB fop-2.1/src/codegen/java/org/apache/fop/tools/EventProducerCollector.java fop-2.1.new/src/codegen/java/org/apache/fop/tools/EventProducerCollector.java
|
||||
--- fop-2.1/src/codegen/java/org/apache/fop/tools/EventProducerCollector.java 2016-01-07 15:13:29.000000000 +0100
|
||||
+++ fop-2.1.new/src/codegen/java/org/apache/fop/tools/EventProducerCollector.java 2019-01-01 19:11:50.659094055 +0100
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
+import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -31,14 +32,11 @@
|
||||
import org.apache.fop.events.model.EventProducerModel;
|
||||
import org.apache.fop.events.model.EventSeverity;
|
||||
|
||||
-import com.thoughtworks.qdox.JavaDocBuilder;
|
||||
-import com.thoughtworks.qdox.model.DefaultDocletTagFactory;
|
||||
+import com.thoughtworks.qdox.JavaProjectBuilder;
|
||||
import com.thoughtworks.qdox.model.DocletTag;
|
||||
-import com.thoughtworks.qdox.model.DocletTagFactory;
|
||||
import com.thoughtworks.qdox.model.JavaClass;
|
||||
import com.thoughtworks.qdox.model.JavaMethod;
|
||||
import com.thoughtworks.qdox.model.JavaParameter;
|
||||
-import com.thoughtworks.qdox.model.Type;
|
||||
|
||||
/**
|
||||
* Finds EventProducer interfaces and builds the event model for them.
|
||||
@@ -61,22 +59,12 @@
|
||||
PRIMITIVE_MAP = Collections.unmodifiableMap(m);
|
||||
}
|
||||
|
||||
- private DocletTagFactory tagFactory;
|
||||
private List<EventModel> models = new java.util.ArrayList<EventModel>();
|
||||
|
||||
/**
|
||||
* Creates a new EventProducerCollector.
|
||||
*/
|
||||
EventProducerCollector() {
|
||||
- this.tagFactory = createDocletTagFactory();
|
||||
- }
|
||||
-
|
||||
- /**
|
||||
- * Creates the {@link DocletTagFactory} to be used by the collector.
|
||||
- * @return the doclet tag factory
|
||||
- */
|
||||
- protected DocletTagFactory createDocletTagFactory() {
|
||||
- return new DefaultDocletTagFactory();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,12 +77,11 @@
|
||||
*/
|
||||
public boolean scanFile(File src)
|
||||
throws IOException, EventConventionException, ClassNotFoundException {
|
||||
- JavaDocBuilder builder = new JavaDocBuilder(this.tagFactory);
|
||||
+ JavaProjectBuilder builder = new JavaProjectBuilder();
|
||||
builder.addSource(src);
|
||||
- JavaClass[] classes = builder.getClasses();
|
||||
+ Collection<JavaClass> classes = builder.getClasses();
|
||||
boolean eventProducerFound = false;
|
||||
- for (int i = 0, c = classes.length; i < c; i++) {
|
||||
- JavaClass clazz = classes[i];
|
||||
+ for (JavaClass clazz : classes) {
|
||||
if (clazz.isInterface() && implementsInterface(clazz, CLASSNAME_EVENT_PRODUCER)) {
|
||||
processEventProducerInterface(clazz);
|
||||
eventProducerFound = true;
|
||||
@@ -104,9 +91,9 @@
|
||||
}
|
||||
|
||||
private boolean implementsInterface(JavaClass clazz, String intf) {
|
||||
- JavaClass[] classes = clazz.getImplementedInterfaces();
|
||||
- for (int i = 0, c = classes.length; i < c; i++) {
|
||||
- JavaClass cl = classes[i];
|
||||
+ List<JavaClass> classes = clazz.getInterfaces();
|
||||
+ for (int i = 0, c = classes.size(); i < c; i++) {
|
||||
+ JavaClass cl = classes.get(i);
|
||||
if (cl.getFullyQualifiedName().equals(intf)) {
|
||||
return true;
|
||||
}
|
||||
@@ -123,9 +110,9 @@
|
||||
protected void processEventProducerInterface(JavaClass clazz)
|
||||
throws EventConventionException, ClassNotFoundException {
|
||||
EventProducerModel prodMeta = new EventProducerModel(clazz.getFullyQualifiedName());
|
||||
- JavaMethod[] methods = clazz.getMethods(true);
|
||||
- for (int i = 0, c = methods.length; i < c; i++) {
|
||||
- JavaMethod method = methods[i];
|
||||
+ List<JavaMethod> methods = clazz.getMethods(true);
|
||||
+ for (int i = 0, c = methods.size(); i < c; i++) {
|
||||
+ JavaMethod method = methods.get(i);
|
||||
EventMethodModel methodMeta = createMethodModel(method);
|
||||
prodMeta.addMethod(methodMeta);
|
||||
}
|
||||
@@ -136,20 +123,20 @@
|
||||
|
||||
private EventMethodModel createMethodModel(JavaMethod method)
|
||||
throws EventConventionException, ClassNotFoundException {
|
||||
- JavaClass clazz = method.getParentClass();
|
||||
+ JavaClass clazz = method.getDeclaringClass();
|
||||
//Check EventProducer conventions
|
||||
- if (!method.getReturnType().isVoid()) {
|
||||
+ if (!method.getReturns().isVoid()) {
|
||||
throw new EventConventionException("All methods of interface "
|
||||
+ clazz.getFullyQualifiedName() + " must have return type 'void'!");
|
||||
}
|
||||
String methodSig = clazz.getFullyQualifiedName() + "." + method.getCallSignature();
|
||||
- JavaParameter[] params = method.getParameters();
|
||||
- if (params.length < 1) {
|
||||
+ List<JavaParameter> params = method.getParameters();
|
||||
+ if (params.size() < 1) {
|
||||
throw new EventConventionException("The method " + methodSig
|
||||
+ " must have at least one parameter: 'Object source'!");
|
||||
}
|
||||
- Type firstType = params[0].getType();
|
||||
- if (firstType.isPrimitive() || !"source".equals(params[0].getName())) {
|
||||
+ JavaClass firstType = params.get(0).getJavaClass();
|
||||
+ if (firstType.isPrimitive() || !"source".equals(params.get(0).getName())) {
|
||||
throw new EventConventionException("The first parameter of the method " + methodSig
|
||||
+ " must be: 'Object source'!");
|
||||
}
|
||||
@@ -164,12 +151,12 @@
|
||||
}
|
||||
EventMethodModel methodMeta = new EventMethodModel(
|
||||
method.getName(), severity);
|
||||
- if (params.length > 1) {
|
||||
- for (int j = 1, cj = params.length; j < cj; j++) {
|
||||
- JavaParameter p = params[j];
|
||||
+ if (params.size() > 1) {
|
||||
+ for (int j = 1, cj = params.size(); j < cj; j++) {
|
||||
+ JavaParameter p = params.get(j);
|
||||
Class<?> type;
|
||||
- JavaClass pClass = p.getType().getJavaClass();
|
||||
- if (p.getType().isPrimitive()) {
|
||||
+ JavaClass pClass = p.getJavaClass();
|
||||
+ if (pClass.isPrimitive()) {
|
||||
type = PRIMITIVE_MAP.get(pClass.getName());
|
||||
if (type == null) {
|
||||
throw new UnsupportedOperationException(
|
||||
@@ -182,10 +169,10 @@
|
||||
methodMeta.addParameter(type, p.getName());
|
||||
}
|
||||
}
|
||||
- Type[] exceptions = method.getExceptions();
|
||||
- if (exceptions != null && exceptions.length > 0) {
|
||||
+ List<JavaClass> exceptions = method.getExceptions();
|
||||
+ if (exceptions != null && exceptions.size() > 0) {
|
||||
//We only use the first declared exception because that is always thrown
|
||||
- JavaClass cl = exceptions[0].getJavaClass();
|
||||
+ JavaClass cl = exceptions.get(0);
|
||||
methodMeta.setExceptionClass(cl.getFullyQualifiedName());
|
||||
methodMeta.setSeverity(EventSeverity.FATAL); //In case it's not set in the comments
|
||||
}
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 4 16:20:13 UTC 2019 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
- Added patch:
|
||||
* fop-2.1-QDox-2.0.patch
|
||||
+ Build against QDox >= 2
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 6 21:54:53 UTC 2018 - Fridrich Strba <fstrba@suse.com>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package xmlgraphics-fop
|
||||
#
|
||||
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2000-2008, JPackage Project
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
@ -42,6 +42,7 @@ Patch3: fix-javadoc-java8.patch
|
||||
Patch4: java8-compatibility.patch
|
||||
# PATCH-FEATURE-OPENSUSE reproducible-build-manifest.patch -- boo#1110024
|
||||
Patch5: reproducible-build-manifest.patch
|
||||
Patch6: fop-2.1-QDox-2.0.patch
|
||||
BuildRequires: ant >= 1.6.5
|
||||
BuildRequires: apache-commons-io >= 2.4
|
||||
BuildRequires: apache-commons-logging
|
||||
@ -53,7 +54,7 @@ BuildRequires: java-devel >= 1.8
|
||||
BuildRequires: javapackages-local
|
||||
BuildRequires: javapackages-tools
|
||||
BuildRequires: libxslt
|
||||
BuildRequires: qdox >= 1.12
|
||||
BuildRequires: qdox >= 2.0
|
||||
BuildRequires: servlet_api
|
||||
BuildRequires: unzip
|
||||
BuildRequires: xml-commons-apis >= 1.3
|
||||
@ -92,6 +93,7 @@ rm src/java/org/apache/fop/util/bitmap/JAIMonochromeBitmapConverter.java
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
|
||||
cp %{SOURCE2} %{SOURCE3} %{SOURCE4} .
|
||||
# Replace keyword "VERSION" in XML files with the real one:
|
||||
|
Loading…
Reference in New Issue
Block a user