Add patch for Java 8

This commit is contained in:
Mikolaj Izdebski 2014-06-20 09:34:03 +02:00
parent 4b07e1c1f9
commit 217749801a
2 changed files with 53 additions and 0 deletions

48
guava-java8.patch Normal file
View File

@ -0,0 +1,48 @@
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.Array;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.GenericDeclaration;
@@ -368,6 +370,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 {
--
1.9.3

View File

@ -7,6 +7,7 @@ URL: http://code.google.com/p/guava-libraries
# git clone https://code.google.com/p/guava-libraries/
# (cd ./guava-libraries && git archive --format=tar --prefix=guava-%{version}/ v%{version}) | xz >guava-%{version}.tar.xz
Source0: %{name}-%{version}.tar.xz
Patch0: %{name}-java8.patch
BuildRequires: java-devel >= 0:1.7.0
BuildRequires: maven-local
@ -33,6 +34,7 @@ API documentation for %{name}.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
find . -name '*.jar' -delete
%pom_disable_module guava-gwt
@ -60,6 +62,9 @@ find . -name '*.jar' -delete
%doc COPYING
%changelog
* Fri Jun 20 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 17.0-1
- Add patch for Java 8
* Tue Jun 17 2014 Roland Grunberg <rgrunber@redhat.com> - 15.0-4
- Do not generate uses directive for exports.