Fix FTBFS due to access to internal class sun.reflect.Reflection
Resolves: #1981014
This commit is contained in:
parent
b402e5e4e1
commit
7acec1a144
|
@ -0,0 +1,33 @@
|
|||
From d839be75837da2bc51712af5ae123657c67de30d Mon Sep 17 00:00:00 2001
|
||||
From: Chris Kelley <ckelley@redhat.com>
|
||||
Date: Mon, 16 Aug 2021 21:22:27 +0100
|
||||
Subject: [PATCH] Fix build error depending on class removed in Java 11
|
||||
|
||||
---
|
||||
src/main/java/org/jboss/jdeparser/Assertions.java | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/org/jboss/jdeparser/Assertions.java b/src/main/java/org/jboss/jdeparser/Assertions.java
|
||||
index 017c645..a931b88 100644
|
||||
--- a/src/main/java/org/jboss/jdeparser/Assertions.java
|
||||
+++ b/src/main/java/org/jboss/jdeparser/Assertions.java
|
||||
@@ -18,15 +18,13 @@
|
||||
|
||||
package org.jboss.jdeparser;
|
||||
|
||||
-import sun.reflect.Reflection;
|
||||
-
|
||||
/**
|
||||
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
|
||||
*/
|
||||
class Assertions {
|
||||
static boolean callerIs(Class<?> clazz) {
|
||||
try {
|
||||
- return Reflection.getCallerClass(3) == clazz;
|
||||
+ return StackWalker.getInstance().getCallerClass() == clazz;
|
||||
} catch (Throwable ignored) {}
|
||||
// dunno
|
||||
return true;
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -3,12 +3,13 @@
|
|||
|
||||
Name: jdeparser
|
||||
Version: 2.0.3
|
||||
Release: 8%{?dist}
|
||||
Release: 9%{?dist}
|
||||
Summary: Source generator library for Java
|
||||
License: ASL 2.0
|
||||
URL: https://github.com/jdeparser/jdeparser2
|
||||
# old repos https://github.com/jdeparser/jdeparser
|
||||
Source0: %{url}/archive/%{namedversion}/%{name}-%{namedversion}.tar.gz
|
||||
Patch: 0001-Fix-build-error-depending-on-class-removed-in-Java-1.patch
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: java-1.8.0-openjdk-devel
|
||||
|
@ -30,6 +31,7 @@ This package contains the API documentation for %{name}.
|
|||
|
||||
%prep
|
||||
%setup -q -n jdeparser2-%{namedversion}
|
||||
%patch -p1
|
||||
|
||||
%build
|
||||
# Use Java 8 as sun.reflect.Reflection is removed in Java 11.
|
||||
|
@ -46,6 +48,9 @@ export JAVA_HOME=%{_jvmdir}/java-1.8.0
|
|||
%license LICENSE.txt
|
||||
|
||||
%changelog
|
||||
* Tue Aug 17 2021 Red Hat PKI Team <rhcs-maint@redhat.com> 2.0.3-9
|
||||
- Bug 1981014 - jdeparser: FTBFS due to access to internal class sun.reflect.Reflection
|
||||
|
||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.0.3-8
|
||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||
Related: rhbz#1991688
|
||||
|
|
Loading…
Reference in New Issue