Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package logback for openSUSE:Factory checked in at 2021-05-15 01:24:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/logback (Old) and /work/SRC/openSUSE:Factory/.logback.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "logback" Sat May 15 01:24:39 2021 rev:2 rq:893211 version:1.2.3 Changes: -------- --- /work/SRC/openSUSE:Factory/logback/logback.changes 2019-11-19 13:45:04.916393484 +0100 +++ /work/SRC/openSUSE:Factory/.logback.new.2988/logback.changes 2021-05-15 01:24:58.162860153 +0200 @@ -1,0 +2,11 @@ +Fri Nov 29 12:15:18 UTC 2019 - Fridrich Strba <[email protected]> + +- Do not force building with java < 9 +- Specifiy maven.compiler.release=8 to access the + java.util.function.Supplier API, introduced in java 8 +- Added patch: + * logback-1.2.3-getCallerClass.patch + + Access the sun.reflect.Reflection.getCallerClass by + by reflection, in order to be able to build with jdk >= 9 + +------------------------------------------------------------------- New: ---- logback-1.2.3-getCallerClass.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ logback.spec ++++++ --- /var/tmp/diff_new_pack.VYwbr4/_old 2021-05-15 01:24:58.682858326 +0200 +++ /var/tmp/diff_new_pack.VYwbr4/_new 2021-05-15 01:24:58.682858326 +0200 @@ -1,7 +1,7 @@ # # spec file for package logback # -# Copyright (c) 2019 SUSE LLC. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,9 +25,9 @@ Source0: %{name}-%{version}.tar.xz # Remove deprecated methods Patch0: %{name}-1.1.11-jetty.patch +Patch1: logback-1.2.3-getCallerClass.patch BuildRequires: fdupes BuildRequires: maven-local -BuildRequires: maven-local BuildRequires: mvn(javax.mail:mail) BuildRequires: mvn(javax.servlet:javax.servlet-api) BuildRequires: mvn(junit:junit) @@ -45,7 +45,6 @@ BuildRequires: mvn(org.fusesource.jansi:jansi) BuildRequires: mvn(org.slf4j:slf4j-api) BuildRequires: mvn(org.slf4j:slf4j-ext) -BuildConflicts: java-devel >= 9 #!BuildRequires: groovy-lib BuildArch: noarch @@ -91,6 +90,7 @@ chmod +x %{name}-examples/src/main/resources/setClasspath.sh %patch0 -p1 +%patch1 -p1 %pom_remove_plugin :maven-source-plugin %pom_remove_plugin :findbugs-maven-plugin @@ -125,6 +125,9 @@ # unavailable test dep maven-scala-plugin # slf4jJAR and org.apache.felix.main are required by logback-examples modules for maven-antrun-plugin %{mvn_build} -f -- \ +%if %{?pkg_vcmp:%pkg_vcmp java-devel >= 9}%{!?pkg_vcmp:0} + -Dmaven.compiler.release=8 \ +%endif -Dorg.slf4j:slf4j-api:jar=$(build-classpath slf4j/api) \ -Dorg.apache.felix:org.apache.felix.main:jar=$(build-classpath felix/org.apache.felix.main) ++++++ logback-1.2.3-getCallerClass.patch ++++++ --- logback-1.2.3/logback-classic/src/main/java/ch/qos/logback/classic/spi/PackagingDataCalculator.java 2019-11-29 12:40:38.797022563 +0100 +++ logback-1.2.3/logback-classic/src/main/java/ch/qos/logback/classic/spi/PackagingDataCalculator.java 2019-11-29 13:11:30.783272712 +0100 @@ -17,7 +17,8 @@ import java.security.CodeSource; import java.util.HashMap; -import sun.reflect.Reflection; +import java.lang.reflect.Method; +import java.lang.reflect.InvocationTargetException; // import java.security.AccessControlException; import java.security.AccessController;import java.security.PrivilegedAction; /** @@ -32,27 +33,6 @@ HashMap<String, ClassPackagingData> cache = new HashMap<String, ClassPackagingData>(); - private static boolean GET_CALLER_CLASS_METHOD_AVAILABLE = false; // private static boolean - // HAS_GET_CLASS_LOADER_PERMISSION = false; - - static { - // if either the Reflection class or the getCallerClass method - // are unavailable, then we won't invoke Reflection.getCallerClass() - // This approach ensures that this class will *run* on JDK's lacking - // sun.reflect.Reflection class. However, this class will *not compile* - // on JDKs lacking sun.reflect.Reflection. - try { - Reflection.getCallerClass(2); - GET_CALLER_CLASS_METHOD_AVAILABLE = true; - } catch (NoClassDefFoundError e) { - } catch (NoSuchMethodError e) { - } catch (UnsupportedOperationException e) { - } catch (Throwable e) { - System.err.println("Unexpected exception"); - e.printStackTrace(); - } - } - public void calculate(IThrowableProxy tp) { while (tp != null) { populateFrames(tp.getStackTraceElementProxyArray()); @@ -81,8 +61,16 @@ int missfireCount = 0; for (int i = 0; i < commonFrames; i++) { Class callerClass = null; - if (GET_CALLER_CLASS_METHOD_AVAILABLE) { - callerClass = Reflection.getCallerClass(localFirstCommon + i - missfireCount + 1); + try { + Class<?> reflect = Class.forName("sun.reflect.Reflection"); + Method getCallerClass = reflect.getMethod("getCallerClass",Integer.TYPE); + callerClass = (Class<?>)(getCallerClass.invoke(null, localFirstCommon + i - missfireCount + 1)); + } catch (ClassNotFoundException e) { + } catch (NoSuchMethodException e) { + } catch (IllegalAccessException e) { + } catch (InvocationTargetException e) { + System.err.println("Unexpected exception"); + e.printStackTrace(); } StackTraceElementProxy step = stepArray[stepFirstCommon + i]; String stepClassname = step.ste.getClassName();
