Patch to compile with Java 7
Emmanuel Bourg
8 years ago
0 | 0 |
libxstream-java (1.4.8-1) unstable; urgency=medium
|
1 | 1 |
|
2 | 2 |
* New upstream release
|
|
3 |
* Added a patch to compile with Java 7
|
3 | 4 |
* Moved the package to Git
|
4 | 5 |
|
5 | 6 |
-- Emmanuel Bourg <ebourg@apache.org> Wed, 29 Apr 2015 17:53:25 +0200
|
|
0 |
Description: Replaces the call to Method.isDefault() by a reflexive call to compile with Java 7
|
|
1 |
Author: Emmanuel Bourg <ebourg@apache.org>
|
|
2 |
Forwarded: not-needed
|
|
3 |
--- a/xstream/src/java/com/thoughtworks/xstream/mapper/LambdaMapper.java
|
|
4 |
+++ b/xstream/src/java/com/thoughtworks/xstream/mapper/LambdaMapper.java
|
|
5 |
@@ -42,7 +42,7 @@
|
|
6 |
for (int i = 0; replacement == null && i < interfaces.length; i++) {
|
|
7 |
final Class<?> iface = interfaces[i];
|
|
8 |
for (final Method method : iface.getMethods()) {
|
|
9 |
- if (!method.isDefault() && !Modifier.isStatic(method.getModifiers())) {
|
|
10 |
+ if (!isDefault(method) && !Modifier.isStatic(method.getModifiers())) {
|
|
11 |
replacement = iface;
|
|
12 |
break;
|
|
13 |
}
|
|
14 |
@@ -57,4 +57,12 @@
|
|
15 |
}
|
|
16 |
return super.serializedClass(replacement == null ? type : replacement);
|
|
17 |
}
|
|
18 |
+
|
|
19 |
+ private boolean isDefault(Method m) {
|
|
20 |
+ try {
|
|
21 |
+ return (Boolean) Method.class.getMethod("isDefault").invoke(m);
|
|
22 |
+ } catch (Exception e) {
|
|
23 |
+ return false;
|
|
24 |
+ }
|
|
25 |
+ }
|
|
26 |
}
|
|
0 |
01-java7-compatibility.patch
|