Update to upstream version 20.0

This commit is contained in:
Michael Simacek 2017-11-10 11:11:45 +02:00
parent 69c77c20a2
commit 3adc1424f2
5 changed files with 31 additions and 105 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@
/guava-17.0.tar.xz
/v18.0.tar.xz
/v18.0.tar.gz
/v20.0.tar.gz

View File

@ -1,45 +0,0 @@
From e1cc5f8e84ab071654d31a55f11db207188c7567 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
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 extends Annotation> T getAnnotation(Class<T> 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 {

View File

@ -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 <i>mutable</i> {@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() {

View File

@ -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(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
%if %{with testlib}
BuildRequires: mvn(com.google.truth:truth)
BuildRequires: mvn(com.google.guava:guava)
BuildRequires: mvn(junit:junit)
%endif
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:)
%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</_nouses>" 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 <msimacek@redhat.com> - 20.0-1
- Update to upstream version 20.0
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 18.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

View File

@ -1 +1 @@
ca638e9f4bd4abb20222169e2f63e4cc v18.0.tar.gz
SHA512 (v20.0.tar.gz) = 2adac0e4987cb531f67843bba94c52c610fbd30de72d6d80e7d446ec100393cebdc139ec6eb630c156778be9a5d464b8aa92534cb2a67a88a370858dc610ab64