[cronometer] 04/05: Fixed the build failure with Java 9 (Closes: #893122)

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Sun Mar 18 20:56:46 GMT 2018


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository cronometer.

commit db2620d0ca8afa07f8d1c68f5ef01f28f4ad57c2
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Sun Mar 18 21:54:57 2018 +0100

    Fixed the build failure with Java 9 (Closes: #893122)
---
 debian/changelog                           |  1 +
 debian/control                             |  4 ++--
 debian/patches/03_use_java_1.5.diff        | 18 ----------------
 debian/patches/06_java9_compatibility.diff | 34 ++++++++++++++++++++++++++++++
 debian/patches/series                      |  2 +-
 5 files changed, 38 insertions(+), 21 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7d8233c..7ae279a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 cronometer (0.9.9+dfsg-2) UNRELEASED; urgency=medium
 
   * Team upload.
+  * Fixed the build failure with Java 9 (Closes: #893122)
   * Standards-Version updated to 4.1.3
   * Switch to debhelper level 11
   * Use secure Vcs-* URLs
diff --git a/debian/control b/debian/control
index 656091a..d15c4cb 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
 Uploaders: Ryan Kavanagh <ryanakca at kubuntu.org>
 Build-Depends: debhelper (>= 11), javahelper (>= 0.25)
-Build-Depends-Indep: default-jdk,
+Build-Depends-Indep: default-jdk (>= 2:1.8),
  ant,
  libjfreechart-java,
  libswingx-java
@@ -16,7 +16,7 @@ Homepage: http://cronometer.com/download/
 Package: cronometer
 Architecture: all
 Depends: ${java:Depends}, ${misc:Depends},
- default-jre | java6-runtime | java7-runtime
+ default-jre (>= 2.1.8) | java8-runtime
 Recommends: ${java:Recommends}
 Description: CRON-o-Meter - Exercise and nutrient intake tracker
  Easy to use daily nutrient intake tracker that includes nutritional
diff --git a/debian/patches/03_use_java_1.5.diff b/debian/patches/03_use_java_1.5.diff
deleted file mode 100644
index 5f645fb..0000000
--- a/debian/patches/03_use_java_1.5.diff
+++ /dev/null
@@ -1,18 +0,0 @@
-Description: Use java 1.5; 1.4 causes a FTBFS
-Author: Ryan Kavanagh <ryanakca at kubuntu.org>
-Forwarded: not-needed
-Origin: vendor
-Last-Update: 2011-10-23
-Index: cronometer/build.xml
-===================================================================
---- cronometer.orig/build.xml	2011-10-23 11:01:29.521397378 -0400
-+++ cronometer/build.xml	2011-10-23 11:02:07.289584660 -0400
-@@ -23,7 +23,7 @@
- 	                
- 	<!-- Compile the java code from ${src} into ${build} -->
- 	<target name="compile" description="compile the source">
--		<javac source="1.4" srcdir="${source}" destdir="${build}">
-+		<javac source="1.5" srcdir="${source}" destdir="${build}">
- 			<classpath>
- 				<fileset dir="${build}/lib">
- 					<include name="*.jar"/>
diff --git a/debian/patches/06_java9_compatibility.diff b/debian/patches/06_java9_compatibility.diff
new file mode 100644
index 0000000..c81cc91
--- /dev/null
+++ b/debian/patches/06_java9_compatibility.diff
@@ -0,0 +1,34 @@
+Description: Sets the source encoding and replaces sun.misc.BASE64Encoder to fix the build failure with Java 9
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: no
+--- a/build.xml
++++ b/build.xml
+@@ -23,7 +23,7 @@
+ 	                
+ 	<!-- Compile the java code from ${src} into ${build} -->
+ 	<target name="compile" description="compile the source">
+-		<javac source="1.4" srcdir="${source}" destdir="${build}">
++		<javac source="1.4" srcdir="${source}" destdir="${build}" encoding="ISO-8859-1">
+ 			<classpath>
+ 				<fileset dir="${build}/lib">
+ 					<include name="*.jar"/>
+--- a/src/ca/spaz/cron/ExportWizard.java
++++ b/src/ca/spaz/cron/ExportWizard.java
+@@ -17,7 +17,7 @@
+ 
+ import org.w3c.dom.*;
+ 
+-import sun.misc.BASE64Encoder;
++import java.util.Base64;
+ import ca.spaz.cron.datasource.Datasources;
+ import ca.spaz.cron.datasource.FoodProxy;
+ import ca.spaz.cron.metrics.Metric;
+@@ -111,7 +111,7 @@
+  
+    private String encodeCredentials() {
+       try {
+-         return new BASE64Encoder().encode((username.getText() + '\n' + new String(password.getPassword())).getBytes("UTF-8"));
++         return Base64.getEncoder().encodeToString((username.getText() + '\n' + new String(password.getPassword())).getBytes("UTF-8"));
+       } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+       }
diff --git a/debian/patches/series b/debian/patches/series
index 0f1e9e7..95b76fd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,3 @@
 01_no_mswin_taskdefs.diff
-03_use_java_1.5.diff
 05_dont_check_for_updates.diff
+06_java9_compatibility.diff

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/cronometer.git



More information about the pkg-java-commits mailing list