From 3adc1424f2179dc8e15c46dcedb15a6a01d8d53b Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Nov 10 2017 09:11:45 +0000 Subject: Update to upstream version 20.0 --- diff --git a/.gitignore b/.gitignore index dc08db2..13ea633 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /guava-17.0.tar.xz /v18.0.tar.xz /v18.0.tar.gz +/v20.0.tar.gz diff --git a/guava-java8.patch b/guava-java8.patch deleted file mode 100644 index 45fbaa5..0000000 --- a/guava-java8.patch +++ /dev/null @@ -1,45 +0,0 @@ -From e1cc5f8e84ab071654d31a55f11db207188c7567 Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Fri, 20 Jun 2014 09:29:44 +0200 -Subject: [PATCH] Implement reflection methods required by Java 8 - ---- - guava/src/com/google/common/reflect/Types.java | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - -diff --git a/guava/src/com/google/common/reflect/Types.java b/guava/src/com/google/common/reflect/Types.java -index 0f05f78..d5bd950 100644 ---- a/guava/src/com/google/common/reflect/Types.java -+++ b/guava/src/com/google/common/reflect/Types.java -@@ -29,6 +29,8 @@ import com.google.common.collect.ImmutableList; - import com.google.common.collect.Iterables; - - import java.io.Serializable; -+import java.lang.annotation.Annotation; -+import java.lang.reflect.AnnotatedType; - import java.lang.reflect.AnnotatedElement; - import java.lang.reflect.Array; - import java.lang.reflect.GenericArrayType; -@@ -371,6 +373,22 @@ final class Types { - return false; - } - } -+ -+ @Override public T getAnnotation(Class annotationClass) { -+ return null; -+ } -+ -+ @Override public Annotation[] getAnnotations() { -+ return new Annotation[0]; -+ } -+ -+ @Override public Annotation[] getDeclaredAnnotations() { -+ return new Annotation[0]; -+ } -+ -+ @Override public AnnotatedType[] getAnnotatedBounds() { -+ return new AnnotatedType[0]; -+ } - } - - static final class WildcardTypeImpl implements WildcardType, Serializable { diff --git a/guava-jdk8-HashMap-testfix.patch b/guava-jdk8-HashMap-testfix.patch deleted file mode 100644 index d4f2f9d..0000000 --- a/guava-jdk8-HashMap-testfix.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -ur guava-18.0.vanilla/guava/src/com/google/common/collect/Maps.java guava-18.0/guava/src/com/google/common/collect/Maps.java ---- guava-18.0.vanilla/guava/src/com/google/common/collect/Maps.java 2014-08-25 18:39:22.000000000 +0000 -+++ guava-18.0/guava/src/com/google/common/collect/Maps.java 2015-06-03 21:02:12.498000000 +0000 -@@ -206,11 +206,15 @@ - return expectedSize + 1; - } - if (expectedSize < Ints.MAX_POWER_OF_TWO) { -- return expectedSize + expectedSize / 3; -+ // This is the calculation used in JDK8 to resize when a putAll -+ // happens; it seems to be the most conservative calculation we -+ // can make. 0.75 is the default load factor. -+ return (int) ((float) expectedSize / 0.75F + 1.0F); - } - return Integer.MAX_VALUE; // any large value - } - -+ - /** - * Creates a mutable {@code HashMap} instance with the same mappings as - * the specified map. -diff -ur guava-18.0.vanilla/guava-tests/test/com/google/common/collect/MapsTest.java guava-18.0/guava-tests/test/com/google/common/collect/MapsTest.java ---- guava-18.0.vanilla/guava-tests/test/com/google/common/collect/MapsTest.java 2014-08-25 18:39:22.000000000 +0000 -+++ guava-18.0/guava-tests/test/com/google/common/collect/MapsTest.java 2015-06-03 21:04:15.463000000 +0000 -@@ -156,7 +156,8 @@ - Field tableField = HashMap.class.getDeclaredField("table"); - tableField.setAccessible(true); - Object[] table = (Object[]) tableField.get(hashMap); -- return table.length; -+ // In JDK8, table is set lazily, so it may be null. -+ return table == null ? 0 : table.length; - } - - public void testCapacityForLargeSizes() { diff --git a/guava.spec b/guava.spec index 7999c10..ba9bb1e 100644 --- a/guava.spec +++ b/guava.spec @@ -1,10 +1,6 @@ -%if 0%{?fedora} -%bcond_without testlib -%endif - Name: guava -Version: 18.0 -Release: 11%{?dist} +Version: 20.0 +Release: 1%{?dist} Summary: Google Core Libraries for Java License: ASL 2.0 URL: https://github.com/google/guava @@ -12,17 +8,13 @@ BuildArch: noarch Source0: https://github.com/google/guava/archive/v%{version}.tar.gz -Patch0: %{name}-java8.patch -Patch1: guava-jdk8-HashMap-testfix.patch - BuildRequires: maven-local BuildRequires: mvn(com.google.code.findbugs:jsr305) +BuildRequires: mvn(com.google.guava:guava) +BuildRequires: mvn(junit:junit) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) +BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin) BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:) -%if %{with testlib} -BuildRequires: mvn(com.google.truth:truth) -BuildRequires: mvn(junit:junit) -%endif %description Guava is a suite of core and expanded libraries that include @@ -38,24 +30,18 @@ Summary: Javadoc for %{name} %description javadoc API documentation for %{name}. -%if %{with testlib} %package testlib -Summary: The guava-testlib subartefact +Summary: The guava-testlib artifact %description testlib -guava-testlib provides additional functionality for conveinent unit testing -%endif +guava-testlib provides additional functionality for conveninent unit testing %prep %setup -q -%patch0 -p1 -%patch1 -p1 + find . -name '*.jar' -delete %pom_disable_module guava-gwt -%if %{without testlib} -%pom_disable_module guava-testlib -%endif %pom_remove_plugin -r :animal-sniffer-maven-plugin %pom_remove_plugin :maven-gpg-plugin %pom_remove_dep jdk:srczip guava @@ -68,6 +54,22 @@ find . -name '*.jar' -delete %pom_xpath_inject /pom:project/pom:build/pom:plugins/pom:plugin/pom:configuration/pom:instructions "<_nouses>true" guava/pom.xml +%pom_remove_dep -r :animal-sniffer-annotations +%pom_remove_dep -r :error_prone_annotations +%pom_remove_dep -r :j2objc-annotations + +annotations=$( + fgrep -hr -e com.google.j2objc.annotations \ + -e com.google.errorprone.annotation -e org.codehaus.mojo.animal_sniffer \ + | sort -u \ + | sed 's/.*\.\([^.]*\);/\1/' \ + | paste -sd\| +) +# guava started using quite a few annotation libraries for code quality, which +# we don't have. This ugly regex is supposed to remove their usage from the code +find -name '*.java' | xargs sed -ri \ + "s/^import .*\.($annotations);//;s/@($annotations)"'\>\s*(\((("[^"]*")|([^)]*))\))?//' + %build %mvn_file :%{name} %{name} @@ -80,17 +82,18 @@ find . -name '*.jar' -delete %mvn_install %files -f .mfiles-guava -%doc AUTHORS CONTRIBUTORS README* +%doc CONTRIBUTORS README* %license COPYING %files javadoc -f .mfiles-javadoc %license COPYING -%if %{with testlib} %files testlib -f .mfiles-guava-testlib -%endif %changelog +* Mon Nov 06 2017 Michael Simacek - 20.0-1 +- Update to upstream version 20.0 + * Wed Jul 26 2017 Fedora Release Engineering - 18.0-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild diff --git a/sources b/sources index 1c4d28b..8da3b65 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ca638e9f4bd4abb20222169e2f63e4cc v18.0.tar.gz +SHA512 (v20.0.tar.gz) = 2adac0e4987cb531f67843bba94c52c610fbd30de72d6d80e7d446ec100393cebdc139ec6eb630c156778be9a5d464b8aa92534cb2a67a88a370858dc610ab64