[Debian-med-packaging] Bug#542253: libgdcm-java: Covariant return type for gdcm::ImageToImageFilter::GetOutput

Mathieu Malaterre mathieu.malaterre at gmail.com
Tue Aug 18 16:52:48 UTC 2009


Package: libgdcm-java
Version: 2.0.12-10
Severity: normal


In order to compile with ecj the debian package used the following patch (*).
However this slightly change from upstream where a covariant return type is being
done with Java. A better patch would be to force the compiler to use Java 5.

Index: Wrapping/Java/CMakeLists.txt
===================================================================
--- Wrapping/Java/CMakeLists.txt  (revision 5949)
+++ Wrapping/Java/CMakeLists.txt  (working copy)
@@ -67,7 +67,10 @@
 ADD_CUSTOM_COMMAND(
   OUTPUT ${LIBRARY_OUTPUT_PATH}/gdcm.jar
 # 1. run the custom command only when the gdcmJAVA_wrap.cxx has been generated (which means all *.java should be there)
-  COMMAND ${JAVA_COMPILE} ARGS "gdcm/*.java" #${javafiles}
+# Some compiler are picky about Java version. For instance covariant return type was only added to Java 5, so to
+# please compiler such as ecj (Eclipse Java Compiler 0.894_R34x) explicitly state we want 1.5 version to compile
+# gdcm::ImageToImageFilter::GetOutput() const as covariant return type
+  COMMAND ${JAVA_COMPILE} ARGS -source 1.5 "gdcm/*.java" #${javafiles}
 # 2. now that the *.class have been generated construct the jar file. We can only rely on the gdcm.java / gdcm.class
 # to build dependencie, I am pretty sure it will break parallel builds... oh well
   COMMAND ${JAVA_ARCHIVE} ARGS cvf ${LIBRARY_OUTPUT_PATH}/gdcm.jar gdcm/*.class


Please consider

(*)
$ cat java_covariant_return_type.patch
Java 1.2 does not have covariant return type. Work around issue
by removing subclass function

--- gdcm-2.0.10.orig/Wrapping/Java/gdcm.i       (revision 5856)
+++ gdcm-2.0.10/Wrapping/Java/gdcm.i    (working copy)
@@ -563,6 +563,7 @@
 //%include "gdcmPythonFilter.h"
 %include "gdcmTagPath.h"
 %include "gdcmPixmapToPixmapFilter.h"
+%ignore gdcm::ImageToImageFilter::GetOutput() const;
 %include "gdcmImageToImageFilter.h"
 %include "gdcmSOPClassUIDToIOD.h"
 %include "gdcmImageChangeTransferSyntax.h"



-- System Information:
Debian Release: 5.0.2
  APT prefers stable
  APT policy: (500, 'stable'), (200, 'testing'), (100, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-bpo.1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libgdcm-java depends on:
ii  default-jre [java2-run 1.5-30            Standard Java or Java compatible R
ii  java-gcj-compat [java2 1.0.78-2          Java runtime environment using GIJ
ii  libc6                  2.9-12            GNU C Library: Shared libraries
ii  libexpat1              2.0.1-4           XML parsing C library - runtime li
ii  libgcc1                1:4.4.0-5         GCC support library
ii  libgdcm2.0             2.0.12-10+b1      Grassroots DICOM runtime libraries
ii  libopenjpeg2           1.3+dfsg-4        JPEG 2000 image compression/decomp
ii  libssl0.9.8            0.9.8g-15+lenny1  SSL shared libraries
ii  libstdc++6             4.4.0-5           The GNU Standard C++ Library v3
ii  libuuid1               2.16-3            Universally Unique ID library
ii  openjdk-6-jre [java2-r 6b11-9.1+lenny2   OpenJDK Java runtime, using Hotspo
ii  sun-java6-jre [java2-r 6-12-1            Sun Java(TM) Runtime Environment (
ii  zlib1g                 1:1.2.3.3.dfsg-15 compression library - runtime

libgdcm-java recommends no packages.

Versions of packages libgdcm-java suggests:
ii  gij [java-virtual-machin 4:4.3.2-2       The GNU Java bytecode interpreter
ii  gij-4.3 [java-virtual-ma 4.3.2-2         The GNU Java bytecode interpreter
ii  java-gcj-compat [java-vi 1.0.78-2        Java runtime environment using GIJ
ii  java-gcj-compat-headless 1.0.78-2        Java runtime environment using GIJ
ii  openjdk-6-jre-headless [ 6b11-9.1+lenny2 OpenJDK Java runtime, using Hotspo
ii  sun-java6-jre [java-virt 6-12-1          Sun Java(TM) Runtime Environment (

-- no debconf information





More information about the Debian-med-packaging mailing list