[concurrent] Switch to javapackages-local

Marek Goldmann goldmann at fedoraproject.org
Tue Jun 24 19:41:55 UTC 2014


commit 2895344c7b7e59ddaeddb91be6874f1a7d96fb15
Author: Marek Goldmann <marek.goldmann at gmail.com>
Date:   Tue Jun 24 21:41:43 2014 +0200

    Switch to javapackages-local

 JDK-8-support.patch |   61 +++++++++++++++++++++++++++++++++++++++++++++++++++
 concurrent.spec     |   34 +++++++++++-----------------
 2 files changed, 74 insertions(+), 21 deletions(-)
---
diff --git a/JDK-8-support.patch b/JDK-8-support.patch
new file mode 100644
index 0000000..ee8a66c
--- /dev/null
+++ b/JDK-8-support.patch
@@ -0,0 +1,61 @@
+From f61819223b7e6015f31e022793ff030fe3e28717 Mon Sep 17 00:00:00 2001
+From: Marek Goldmann <marek.goldmann at gmail.com>
+Date: Tue, 24 Jun 2014 17:36:53 +0200
+Subject: [PATCH] JDK 8 support
+
+---
+ ConcurrentHashMap.java | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/ConcurrentHashMap.java b/ConcurrentHashMap.java
+index 23a4ed4..3c5f265 100644
+--- a/ConcurrentHashMap.java
++++ b/ConcurrentHashMap.java
+@@ -675,7 +675,7 @@ public class ConcurrentHashMap
+    *               <code>null</code>.
+    */
+ 
+-  protected Object remove(Object key, Object value) {
++  public boolean remove(Object key, Object value) {
+     /*
+       Find the entry, then 
+         1. Set value field to null, to force get() to retry
+@@ -697,7 +697,7 @@ public class ConcurrentHashMap
+ 
+       for (;;) {
+         if (e == null)
+-          return null;
++          return false;
+         if (e.hash == hash && eq(key, e.key)) 
+           break;
+         e = e.next;
+@@ -705,7 +705,7 @@ public class ConcurrentHashMap
+ 
+       Object oldValue = e.value;
+       if (value != null && !value.equals(oldValue))
+-        return null;
++        return false;
+      
+       e.value = null;
+ 
+@@ -714,7 +714,7 @@ public class ConcurrentHashMap
+         head = new Entry(p.hash, p.key, p.value, head);
+       tab[index] = head;
+       seg.count--;
+-      return oldValue;
++      return true;
+     }
+   }
+ 
+@@ -946,7 +946,7 @@ public class ConcurrentHashMap
+       if (!(o instanceof Map.Entry))
+         return false;
+       Map.Entry e = (Map.Entry)o;
+-      return ConcurrentHashMap.this.remove(e.getKey(), e.getValue()) != null;
++      return ConcurrentHashMap.this.remove(e.getKey(), e.getValue()) == true;
+     }
+     public int size() {
+       return ConcurrentHashMap.this.size();
+-- 
+1.9.3
+
diff --git a/concurrent.spec b/concurrent.spec
index 769d2db..b6dac5d 100644
--- a/concurrent.spec
+++ b/concurrent.spec
@@ -30,7 +30,7 @@
 
 Name:           concurrent
 Version:        1.3.4
-Release:        18%{?dist}
+Release:        19%{?dist}
 Epoch:          0
 Summary:        Utility classes for concurrent Java programming
 License:        Public Domain
@@ -39,6 +39,7 @@ Source0:        http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/current/con
 Source1:        %{name}-%{version}.build.xml
 Source2:        %{name}-%{version}.pom
 Patch0:         concurrent-build.patch
+Patch1:         JDK-8-support.patch
 URL:            http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html
 Group:          Development/Libraries/Java
 
@@ -46,6 +47,7 @@ BuildArch:      noarch
 
 BuildRequires:  jpackage-utils
 BuildRequires:  ant
+BuildRequires:  javapackages-local
 
 Requires:       jpackage-utils
 
@@ -70,6 +72,7 @@ mv concurrent src/EDU/oswego/cs/dl/util
 # Build with debug on
 pushd src/EDU/oswego/cs/dl/util/concurrent
 %patch0
+%patch1 -p1
 popd
 sed -i -e 's/..\/sun-u.c.license.pdf/http:\/\/gee.cs.oswego.edu\/dl\/classes\/EDU\/oswego\/cs\/dl\/util\/sun-u.c.license.pdf/' src/EDU/oswego/cs/dl/util/concurrent/intro.html
 
@@ -84,33 +87,22 @@ ant \
 popd
 
 %install
-install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
-install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
-install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
-
 # JAR
-install -m 644 src/EDU/oswego/cs/dl/util/concurrent/lib/%{name}.jar \
-               $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
+%mvn_artifact %{SOURCE2} src/EDU/oswego/cs/dl/util/concurrent/lib/concurrent.jar
 
 # JAVADOCS
-cp -pr src/EDU/oswego/cs/dl/util/concurrent/docs/* \
-       $RPM_BUILD_ROOT%{_javadocdir}/%{name}
-# POM
-install -pm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
-
-# DEPMAP
-%add_maven_depmap JPP-%{name}.pom %{name}.jar -a "oswego-concurrent:concurrent"
-
-%files
-%{_javadir}/*.jar
-%{_mavenpomdir}/*
-%{_mavendepmapfragdir}/*
+%mvn_install -J src/EDU/oswego/cs/dl/util/concurrent/docs/
+
+%files -f .mfiles
+%dir %{_javadir}/%{name}
 %doc src/EDU/oswego/cs/dl/util/concurrent/intro.html
 
-%files javadoc
-%doc %{_javadocdir}/%{name}
+%files javadoc -f .mfiles-javadoc
 
 %changelog
+* Tue Jun 24 2014 Marek Goldmann <mgoldman at redhat.com> - 0:1.3.4-19
+- Switch to javapackages-local
+
 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0:1.3.4-18
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 


More information about the scm-commits mailing list