[ivyplusplus] 03/07: replace @Data and @SneakyThrows decorators with plain Java

Hans-Christoph Steiner eighthave at moszumanska.debian.org
Tue Dec 15 14:15:00 UTC 2015


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

eighthave pushed a commit to branch master
in repository ivyplusplus.

commit 61cee95a6cca5bae65db6bdaef8d7c8dbd1e2515
Author: Hans-Christoph Steiner <hans at eds.org>
Date:   Mon Dec 14 20:57:51 2015 +0100

    replace @Data and @SneakyThrows decorators with plain Java
    
    For whatever reason, these were not working, even though the classes are
    included in lombok.jar.  But they are easy enough to replace with plain
    Java code.
---
 ...pand_data_decorator_into_java_constructor.patch | 55 ++++++++++++++++++++++
 .../expand_sneakythrows_into_plain_java.patch      | 32 +++++++++++++
 debian/patches/series                              |  2 +
 3 files changed, 89 insertions(+)

diff --git a/debian/patches/expand_data_decorator_into_java_constructor.patch b/debian/patches/expand_data_decorator_into_java_constructor.patch
new file mode 100644
index 0000000..4f40a7f
--- /dev/null
+++ b/debian/patches/expand_data_decorator_into_java_constructor.patch
@@ -0,0 +1,55 @@
+--- a/src/com/zwitserloot/ivyplusplus/EnsureVersion.java
++++ b/src/com/zwitserloot/ivyplusplus/EnsureVersion.java
+@@ -25,7 +25,6 @@
+ import java.util.Collections;
+ import java.util.List;
+ 
+-import lombok.Data;
+ import lombok.Getter;
+ import lombok.Setter;
+ 
+@@ -74,10 +73,14 @@
+ 		return true;
+ 	}
+ 	
+-	@Data
+ 	private static class VersionPart implements Comparable<VersionPart> {
+ 		private final int number;
+ 		private final String name;
++
++		public VersionPart(int number, String name) {
++		    this.number = number;
++		    this.name = name;
++		}
+ 		
+ 		public int compareTo(VersionPart o) {
+ 			if (o.name == null) {
+--- a/src/com/zwitserloot/ivyplusplus/CachedUnjar.java
++++ b/src/com/zwitserloot/ivyplusplus/CachedUnjar.java
+@@ -36,7 +36,6 @@
+ import java.util.Set;
+ 
+ import lombok.Cleanup;
+-import lombok.Data;
+ 
+ import org.apache.tools.ant.BuildException;
+ import org.apache.tools.ant.Project;
+@@ -193,11 +192,16 @@
+ 		return out;
+ 	}
+ 	
+-	@Data
+ 	private static class CacheRecord {
+ 		private final String name;
+ 		private final long lastMod, len;
+-		
++
++	    public CacheRecord(String name, long lastMod, long len) {
++		this.name = name;
++		this.lastMod = lastMod;
++		this.len = len;
++	    }
++
+ 		static CacheRecord read(String line) {
+ 			String[] elems = line.split(" ::: ", 3);
+ 			return new CacheRecord(elems[0], Long.parseLong(elems[1]), Long.parseLong(elems[2]));
diff --git a/debian/patches/expand_sneakythrows_into_plain_java.patch b/debian/patches/expand_sneakythrows_into_plain_java.patch
new file mode 100644
index 0000000..d2bc9e4
--- /dev/null
+++ b/debian/patches/expand_sneakythrows_into_plain_java.patch
@@ -0,0 +1,32 @@
+--- a/src/com/zwitserloot/ivyplusplus/mavencentral/CreateArtifactBundle.java
++++ b/src/com/zwitserloot/ivyplusplus/mavencentral/CreateArtifactBundle.java
+@@ -34,8 +34,8 @@
+ import java.util.jar.JarOutputStream;
+ 
+ import lombok.Cleanup;
++import lombok.Lombok;
+ import lombok.Setter;
+-import lombok.SneakyThrows;
+ 
+ import org.apache.tools.ant.BuildException;
+ import org.apache.tools.ant.Task;
+@@ -156,8 +156,8 @@
+ 		}
+ 	}
+ 	
+-	@SneakyThrows(IOException.class)
+ 	private static byte[] replaceVersion(byte[] in, String token_, String replacement_) {
++	    try {
+ 		int start = 0;
+ 		ByteArrayOutputStream out = new ByteArrayOutputStream();
+ 		byte[] token = token_.getBytes("US-ASCII");
+@@ -176,6 +176,9 @@
+ 		}
+ 		
+ 		return out.toByteArray();
++	    } catch (IOException e) {
++		throw Lombok.sneakyThrow(e);
++	    }
+ 	}
+ 	
+ 	private static int find(byte[] haystack, byte[] needle, int start) {
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..0c5e3c6
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+expand_data_decorator_into_java_constructor.patch
+expand_sneakythrows_into_plain_java.patch

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



More information about the pkg-java-commits mailing list