commit apache-commons-logging for openSUSE:Factory

Hello community, here is the log from the commit of package apache-commons-logging for openSUSE:Factory checked in at 2016-01-30 11:30:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/apache-commons-logging (Old) and /work/SRC/openSUSE:Factory/.apache-commons-logging.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "apache-commons-logging" Changes: -------- --- /work/SRC/openSUSE:Factory/apache-commons-logging/apache-commons-logging.changes 2015-04-02 16:00:21.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.apache-commons-logging.new/apache-commons-logging.changes 2016-01-30 11:30:48.000000000 +0100 @@ -1,0 +2,7 @@ +Sun Jan 24 13:55:36 UTC 2016 - p.drouand@gmail.com + +- Update to version 1.2 + see http://commons.apache.org/proper/commons-logging/changes-report.html + or RELEASE-NOTES.txt for details + +------------------------------------------------------------------- Old: ---- commons-logging-1.1.3-src.tar.gz commons-logging-1.1.3-src.tar.gz.asc commons-logging-api-1.1.pom New: ---- commons-logging-1.2-src.tar.gz commons-logging-1.2-src.tar.gz.asc commons-logging-1.2.pom ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ apache-commons-logging.spec ++++++ --- /var/tmp/diff_new_pack.qDxKgr/_old 2016-01-30 11:30:49.000000000 +0100 +++ /var/tmp/diff_new_pack.qDxKgr/_new 2016-01-30 11:30:49.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package apache-commons-logging # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2000-2007, JPackage Project # # All modifications and additions to the file contributed by third parties @@ -21,7 +21,7 @@ %define short_name commons-%{base_name} %bcond_with java_bootstrap Name: apache-%{short_name} -Version: 1.1.3 +Version: 1.2 Release: 0 Summary: Apache Commons Logging License: Apache-2.0 @@ -30,7 +30,7 @@ Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz Source1: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz.asc Source2: apache-commons-logging.keyring -Source3: http://mirrors.ibiblio.org/pub/mirrors/maven2/%{short_name}/%{short_name}-api/1.1/%{short_name}-api-1.1.pom +Source3: http://central.maven.org/maven2/commons-logging/commons-logging/%{version}/%{short_name}-%{version}.pom Patch0: commons-logging-1.1.3-src-junit.diff BuildRequires: ant BuildRequires: apache-commons-parent ++++++ commons-logging-1.1.3-src.tar.gz -> commons-logging-1.2-src.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/NOTICE.txt new/commons-logging-1.2-src/NOTICE.txt --- old/commons-logging-1.1.3-src/NOTICE.txt 2013-05-16 22:04:22.000000000 +0200 +++ new/commons-logging-1.2-src/NOTICE.txt 2014-07-05 20:11:36.000000000 +0200 @@ -1,5 +1,5 @@ Apache Commons Logging -Copyright 2003-2013 The Apache Software Foundation +Copyright 2003-2014 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/README.txt new/commons-logging-1.2-src/README.txt --- old/commons-logging-1.1.3-src/README.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/commons-logging-1.2-src/README.txt 2014-07-05 20:11:36.000000000 +0200 @@ -0,0 +1,50 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +Logging +------- + +Getting started: + +1) Build the jar file + + If you have the source distribution you will need to build the jar file + using Maven 2/3. For instructions on downloading and installing Maven see + http://maven.apache.org/. + + To build execute the command 'mvn package verify'. + The jar file will be built in the target directory. + + Note: the unit tests are executed during the verify phase and require that + the respective jar files have been created successfully. + +2) Generate the documentation + + Run the 'mvn verify site' command. The documentation will be written + to the target/site directory. The documentation has some examples of + how to use this package as well as a troubleshooting guide. + +3) Create source and binary distributions + + Run the 'mvn verify site assembly:assembly' command. The source and binary + distributions are created in the 'target' directory. + +4) Use + + Simply include the jar file built in step #1 in your classpath. Import the + classes that you want to use and you are ready to go! + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/RELEASE-NOTES.txt new/commons-logging-1.2-src/RELEASE-NOTES.txt --- old/commons-logging-1.1.3-src/RELEASE-NOTES.txt 2013-05-16 22:04:22.000000000 +0200 +++ new/commons-logging-1.2-src/RELEASE-NOTES.txt 2014-07-05 20:11:36.000000000 +0200 @@ -1,22 +1,31 @@ Apache Commons Logging - Version 1.1.3 + Version 1.2 RELEASE NOTES -The Commons Logging team is pleased to announce the release of Apache Commons Logging 1.1.3 +The Apache Commons Logging team is pleased to announce +the release of Apache Commons Logging 1.2 -Commons Logging is a thin adapter allowing configurable bridging to other, -well known logging systems. +Apache Commons Logging is a thin adapter allowing configurable +bridging to other, well known logging systems. This is a maintenance release containing bug fixes. +Java 1.2 or later is required. Changes in this version include: Fixed Bugs: -o LOGGING-151: Use "org.apache.commons.logging" as bundle symbolic name. Thanks to Krzysztof Daniel. +o LOGGING-37: Improve performance of LogFactory#getFactory() by calling + Thread#currentThread()#getContextClassLoader() directly instead + of using reflection. As a consequence support for JDK 1.1 has + been dropped. Thanks to Matthias Ernst, Archie Cobbs. +o LOGGING-156: Fix SecurityAllowedTestCase when executed with OpenJDK 1.7 due + to an additional required RuntimePermission. Thanks to Mikolaj Izdebski. +o LOGGING-157: Fix javadoc to comply with javadoc tool from jdk 1.8. Thanks to Ville Skyttä. + Historical list of changes: http://commons.apache.org/proper/commons-logging/changes-report.html -For complete information on Commons Logging, including instructions on how to submit bug reports, +For complete information on Apache Commons Logging, including instructions on how to submit bug reports, patches, or suggestions for improvement, see the Apache Commons Logging website: http://commons.apache.org/proper/commons-logging/ \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/build.xml new/commons-logging-1.2-src/build.xml --- old/commons-logging-1.1.3-src/build.xml 2013-05-16 22:04:22.000000000 +0200 +++ new/commons-logging-1.2-src/build.xml 2014-07-05 20:11:36.000000000 +0200 @@ -39,7 +39,7 @@ - the path to a 1.4 J2SDK. This will be used to compile those classes - which require the 1.4 API. - - - $Id: build.xml 1483540 2013-05-16 20:03:52Z tn $ + - $Id: build.xml 1608092 2014-07-05 18:11:22Z tn $ --> <project name="Logging" default="all" basedir="."> @@ -94,7 +94,7 @@ <property name="component.title" value="Logging Wrapper Library"/> <!-- The current version number of this component --> - <property name="component.version" value="1.1.3"/> + <property name="component.version" value="1.2"/> <!-- The base directory for compilation targets --> <property name="build.home" value="${basedir}/target"/> @@ -106,7 +106,7 @@ <property name="dist.home" value="dist"/> <!-- The base directory for releases --> - <property name="artifacts.home" value="artifacts"/> + <property name="artifacts.home" value="artifacts"/> <!-- The base directory for component sources --> <property name="source.home" value="src/main/java"/> @@ -130,7 +130,7 @@ <!-- ========== Compiler Defaults ========================================= --> <!-- Version of java class files to generate. --> - <property name="target.version" value="1.1"/> + <property name="target.version" value="1.2"/> <!-- Version of java source to accept --> <property name="source.version" value="1.2"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/pmd.xml new/commons-logging-1.2-src/pmd.xml --- old/commons-logging-1.1.3-src/pmd.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/commons-logging-1.2-src/pmd.xml 2014-07-05 20:11:36.000000000 +0200 @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<!-- +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> +<ruleset name="mybraces" + xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> + <description>Excludes from default PMD rules.</description> + <rule ref="rulesets/java/unusedcode.xml"> + <exclude name="UnnecessaryParentheses"/> + </rule> +</ruleset> \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/pom.xml new/commons-logging-1.2-src/pom.xml --- old/commons-logging-1.1.3-src/pom.xml 2013-05-16 22:04:22.000000000 +0200 +++ new/commons-logging-1.2-src/pom.xml 2014-07-05 20:11:36.000000000 +0200 @@ -26,14 +26,14 @@ <parent> <groupId>org.apache.commons</groupId> <artifactId>commons-parent</artifactId> - <version>28</version> + <version>34</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> - <name>Commons Logging</name> - <version>1.1.3</version> - <description>Commons Logging is a thin adapter allowing configurable bridging to other, + <name>Apache Commons Logging</name> + <version>1.2</version> + <description>Apache Commons Logging is a thin adapter allowing configurable bridging to other, well known logging systems.</description> <url>http://commons.apache.org/proper/commons-logging/</url> @@ -375,6 +375,7 @@ <goal>verify</goal> </goals> <configuration> + <runOrder>${failsafe.runorder}</runOrder> <includes> <include>**/*TestCase.java</include> </includes> @@ -491,6 +492,27 @@ <artifactId>jdepend-maven-plugin</artifactId> <version>2.0-beta-1</version> </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>findbugs-maven-plugin</artifactId> + <version>2.5.2</version> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-pmd-plugin</artifactId> + <version>3.0.1</version> + <configuration> + <!-- targetJdk 1.1, 1.2 is not supported --> + <targetJdk>1.3</targetJdk> + <linkXref>true</linkXref> + <rulesets> + <ruleset>${basedir}/pmd.xml</ruleset> + </rulesets> + </configuration> + </plugin> </plugins> </reporting> @@ -502,16 +524,18 @@ </distributionManagement> <properties> - <maven.compile.source>1.2</maven.compile.source> - <maven.compile.target>1.1</maven.compile.target> + <maven.compiler.source>1.2</maven.compiler.source> + <maven.compiler.target>1.2</maven.compiler.target> <commons.componentid>logging</commons.componentid> - <commons.release.version>1.1.3</commons.release.version> + <commons.release.version>1.2</commons.release.version> <commons.jira.id>LOGGING</commons.jira.id> <commons.jira.pid>12310484</commons.jira.pid> <!-- The RC version used in the staging repository URL. --> <commons.rc.version>RC2</commons.rc.version> <commons.surefire.version>2.12</commons.surefire.version> - <skipSurefireReport>true</skipSurefireReport> + <skipSurefireReport>true</skipSurefireReport> + <!-- Allow default test run order to be changed --> + <failsafe.runorder>filesystem</failsafe.runorder> <commons.osgi.import> javax.servlet;version="[2.1.0, 3.0.0)";resolution:=optional, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/src/changes/changes.xml new/commons-logging-1.2-src/src/changes/changes.xml --- old/commons-logging-1.1.3-src/src/changes/changes.xml 2013-05-16 22:04:22.000000000 +0200 +++ new/commons-logging-1.2-src/src/changes/changes.xml 2014-07-05 20:11:36.000000000 +0200 @@ -43,6 +43,18 @@ <title>Release Notes</title> </properties> <body> + <release version="1.2" date="2014-07-11" description="This is a maintenance release containing bug fixes. Java 1.2 or later is required."> + <action issue="LOGGING-37" dev="tn" type="fix" due-to="Matthias Ernst,Archie Cobbs"> + Improve performance of LogFactory#getFactory() by calling Thread#currentThread()#getContextClassLoader() + directly instead of using reflection. As a consequence support for JDK 1.1 has been dropped. + </action> + <action issue="LOGGING-156" dev="tn" type="fix" due-to="Mikolaj Izdebski"> + Fix SecurityAllowedTestCase when executed with OpenJDK 1.7 due to an additional required RuntimePermission. + </action> + <action issue="LOGGING-157" dev="tn" type="fix" due-to="Ville Skyttä"> + Fix javadoc to comply with javadoc tool from jdk 1.8. + </action> + </release> <release version="1.1.3" date="2013-05-23" description="This is a maintenance release containing bug fixes."> <action issue="LOGGING-151" dev="tn" type="fix" due-to="Krzysztof Daniel"> Use "org.apache.commons.logging" as bundle symbolic name. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/src/conf/MANIFEST.MF new/commons-logging-1.2-src/src/conf/MANIFEST.MF --- old/commons-logging-1.1.3-src/src/conf/MANIFEST.MF 2013-05-16 22:04:22.000000000 +0200 +++ new/commons-logging-1.2-src/src/conf/MANIFEST.MF 2014-07-05 20:11:36.000000000 +0200 @@ -1,20 +1,20 @@ Manifest-Version: 1.0 -Export-Package: org.apache.commons.logging;version="1.1.3",org.apache. - commons.logging.impl;version="1.1.3" +Export-Package: org.apache.commons.logging;version="1.2.0",org.apache. + commons.logging.impl;version="1.2.0" Implementation-Title: Commons Logging Implementation-Vendor: The Apache Software Foundation Implementation-Vendor-Id: org.apache Specification-Title: Commons Logging Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt Bundle-SymbolicName: org.apache.commons.logging -X-Compile-Target-JDK: 1.1 -Implementation-Version: 1.1.3 +X-Compile-Target-JDK: 1.2 +Implementation-Version: 1.2 Specification-Vendor: The Apache Software Foundation Bundle-Name: Commons Logging Created-By: Apache Maven Bundle Plugin X-Compile-Source-JDK: 1.2 Bundle-Vendor: The Apache Software Foundation -Bundle-Version: 1.1.3 +Bundle-Version: 1.2.0 Bundle-ManifestVersion: 2 Bundle-Description: Commons Logging is a thin adapter allowing configu rable bridging to other, well known logging systems. @@ -25,4 +25,4 @@ .0.1]",org.apache.log4j;resolution:=optional;version="[1.2.15,2.0.0)" Include-Resource: META-INF/NOTICE.txt=NOTICE.txt,META-INF/LICENSE.txt= LICENSE.txt -Specification-Version: 1.1.3 +Specification-Version: 1.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/src/main/assembly/src.xml new/commons-logging-1.2-src/src/main/assembly/src.xml --- old/commons-logging-1.1.3-src/src/main/assembly/src.xml 2013-05-16 22:04:21.000000000 +0200 +++ new/commons-logging-1.2-src/src/main/assembly/src.xml 2014-07-05 20:11:36.000000000 +0200 @@ -28,8 +28,10 @@ <fileSet> <includes> <include>checkstyle.xml</include> + <include>README.txt</include> <include>LICENSE.txt</include> <include>NOTICE.txt</include> + <include>pmd.xml</include> <include>pom.xml</include> <include>PROPOSAL.html</include> <include>RELEASE-NOTES.txt</include> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/src/main/java/org/apache/commons/logging/Log.java new/commons-logging-1.2-src/src/main/java/org/apache/commons/logging/Log.java --- old/commons-logging-1.1.3-src/src/main/java/org/apache/commons/logging/Log.java 2013-05-16 22:04:22.000000000 +0200 +++ new/commons-logging-1.2-src/src/main/java/org/apache/commons/logging/Log.java 2014-07-05 20:11:36.000000000 +0200 @@ -43,22 +43,80 @@ * to be logged). * <p> * For example, - * <code><pre> + * <pre> * if (log.isDebugEnabled()) { * ... do something expensive ... * log.debug(theResult); * } - * </pre></code> + * </pre> * <p> * Configuration of the underlying logging system will generally be done * external to the Logging APIs, through whatever mechanism is supported by * that system. * - * @version $Id: Log.java 1432663 2013-01-13 17:24:18Z tn $ + * @version $Id: Log.java 1606045 2014-06-27 12:11:56Z tn $ */ public interface Log { - // ----------------------------------------------------- Logging Properties + /** + * Logs a message with debug log level. + * + * @param message log this message + */ + void debug(Object message); + + /** + * Logs an error with debug log level. + * + * @param message log this message + * @param t log this cause + */ + void debug(Object message, Throwable t); + + /** + * Logs a message with error log level. + * + * @param message log this message + */ + void error(Object message); + + /** + * Logs an error with error log level. + * + * @param message log this message + * @param t log this cause + */ + void error(Object message, Throwable t); + + /** + * Logs a message with fatal log level. + * + * @param message log this message + */ + void fatal(Object message); + + /** + * Logs an error with fatal log level. + * + * @param message log this message + * @param t log this cause + */ + void fatal(Object message, Throwable t); + + /** + * Logs a message with info log level. + * + * @param message log this message + */ + void info(Object message); + + /** + * Logs an error with info log level. + * + * @param message log this message + * @param t log this cause + */ + void info(Object message, Throwable t); /** * Is debug logging currently enabled? @@ -69,7 +127,7 @@ * * @return true if debug is enabled in the underlying logger. */ - public boolean isDebugEnabled(); + boolean isDebugEnabled(); /** * Is error logging currently enabled? @@ -80,7 +138,7 @@ * * @return true if error is enabled in the underlying logger. */ - public boolean isErrorEnabled(); + boolean isErrorEnabled(); /** * Is fatal logging currently enabled? @@ -91,7 +149,7 @@ * * @return true if fatal is enabled in the underlying logger. */ - public boolean isFatalEnabled(); + boolean isFatalEnabled(); /** * Is info logging currently enabled? @@ -102,7 +160,7 @@ * * @return true if info is enabled in the underlying logger. */ - public boolean isInfoEnabled(); + boolean isInfoEnabled(); /** * Is trace logging currently enabled? @@ -113,7 +171,7 @@ * * @return true if trace is enabled in the underlying logger. */ - public boolean isTraceEnabled(); + boolean isTraceEnabled(); /** * Is warn logging currently enabled? @@ -124,97 +182,35 @@ * * @return true if warn is enabled in the underlying logger. */ - public boolean isWarnEnabled(); - - // -------------------------------------------------------- Logging Methods - - /** - * Log a message with trace log level. - * - * @param message log this message - */ - public void trace(Object message); - - /** - * Log an error with trace log level. - * - * @param message log this message - * @param t log this cause - */ - public void trace(Object message, Throwable t); - - /** - * Log a message with debug log level. - * - * @param message log this message - */ - public void debug(Object message); - - /** - * Log an error with debug log level. - * - * @param message log this message - * @param t log this cause - */ - public void debug(Object message, Throwable t); - - /** - * Log a message with info log level. - * - * @param message log this message - */ - public void info(Object message); - - /** - * Log an error with info log level. - * - * @param message log this message - * @param t log this cause - */ - public void info(Object message, Throwable t); - - /** - * Log a message with warn log level. - * - * @param message log this message - */ - public void warn(Object message); - - /** - * Log an error with warn log level. - * - * @param message log this message - * @param t log this cause - */ - public void warn(Object message, Throwable t); + boolean isWarnEnabled(); /** - * Log a message with error log level. + * Logs a message with trace log level. * * @param message log this message */ - public void error(Object message); + void trace(Object message); /** - * Log an error with error log level. + * Logs an error with trace log level. * * @param message log this message * @param t log this cause */ - public void error(Object message, Throwable t); + void trace(Object message, Throwable t); /** - * Log a message with fatal log level. + * Logs a message with warn log level. * * @param message log this message */ - public void fatal(Object message); + void warn(Object message); /** - * Log an error with fatal log level. + * Logs an error with warn log level. * * @param message log this message * @param t log this cause */ - public void fatal(Object message, Throwable t); + void warn(Object message, Throwable t); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/src/main/java/org/apache/commons/logging/LogFactory.java new/commons-logging-1.2-src/src/main/java/org/apache/commons/logging/LogFactory.java --- old/commons-logging-1.1.3-src/src/main/java/org/apache/commons/logging/LogFactory.java 2013-05-16 22:04:22.000000000 +0200 +++ new/commons-logging-1.2-src/src/main/java/org/apache/commons/logging/LogFactory.java 2014-07-05 20:11:35.000000000 +0200 @@ -23,8 +23,6 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintStream; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.net.URL; import java.net.URLConnection; import java.security.AccessController; @@ -42,7 +40,7 @@ * based on the SAXParserFactory and DocumentBuilderFactory implementations * (corresponding to the JAXP pluggability APIs) found in Apache Xerces. * - * @version $Id: LogFactory.java 1449064 2013-02-22 14:49:22Z tn $ + * @version $Id: LogFactory.java 1606041 2014-06-27 11:56:59Z tn $ */ public abstract class LogFactory { // Implementation note re AccessController usage @@ -151,23 +149,23 @@ * classloaders to be substituted by an alternative implementation. * <p> * <strong>Note:</strong> <code>LogFactory</code> will print: - * <code><pre> - * [ERROR] LogFactory: Load of custom hashtable failed</em> - * </pre></code> + * <pre> + * [ERROR] LogFactory: Load of custom hashtable failed + * </pre> * to system error and then continue using a standard Hashtable. * <p> * <strong>Usage:</strong> Set this property when Java is invoked * and <code>LogFactory</code> will attempt to load a new instance * of the given implementation class. * For example, running the following ant scriplet: - * <code><pre> + * <pre> * <java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}"> * ... * <sysproperty * key="org.apache.commons.logging.LogFactory.HashtableImpl" * value="org.apache.commons.logging.AltHashtable"/> * </java> - * </pre></code> + * </pre> * will mean that <code>LogFactory</code> will load an instance of * <code>org.apache.commons.logging.AltHashtable</code>. * <p> @@ -787,8 +785,6 @@ * or null if security doesn't allow it. * @throws LogConfigurationException if there was some weird error while * attempting to get the context classloader. - * @throws SecurityException if the current java security policy doesn't - * allow this class to access the context classloader. */ protected static ClassLoader getContextClassLoader() throws LogConfigurationException { return directGetContextClassLoader(); @@ -807,8 +803,6 @@ * or null if security doesn't allow it. * @throws LogConfigurationException if there was some weird error while * attempting to get the context classloader. - * @throws SecurityException if the current java security policy doesn't - * allow this class to access the context classloader. */ private static ClassLoader getContextClassLoaderInternal() throws LogConfigurationException { return (ClassLoader)AccessController.doPrivileged( @@ -834,64 +828,27 @@ * * @throws LogConfigurationException if a suitable class loader * cannot be identified. - * @throws SecurityException if the java security policy forbids - * access to the context classloader from one of the classes in the - * current call stack. + * @return the thread's context classloader or {@code null} if the java security + * policy forbids access to the context classloader from one of the classes + * in the current call stack. * @since 1.1 */ protected static ClassLoader directGetContextClassLoader() throws LogConfigurationException { ClassLoader classLoader = null; try { - // Are we running on a JDK 1.2 or later system? - final Method method = Thread.class.getMethod("getContextClassLoader", (Class[]) null); - - // Get the thread context class loader (if there is one) - try { - classLoader = (ClassLoader)method.invoke(Thread.currentThread(), (Object[]) null); - } catch (IllegalAccessException e) { - throw new LogConfigurationException - ("Unexpected IllegalAccessException", e); - } catch (InvocationTargetException e) { - /** - * InvocationTargetException is thrown by 'invoke' when - * the method being invoked (getContextClassLoader) throws - * an exception. - * - * getContextClassLoader() throws SecurityException when - * the context class loader isn't an ancestor of the - * calling class's class loader, or if security - * permissions are restricted. - * - * In the first case (not related), we want to ignore and - * keep going. We cannot help but also ignore the second - * with the logic below, but other calls elsewhere (to - * obtain a class loader) will trigger this exception where - * we can make a distinction. - */ - if (e.getTargetException() instanceof SecurityException) { - // ignore - } else { - // Capture 'e.getTargetException()' exception for details - // alternate: log 'e.getTargetException()', and pass back 'e'. - throw new LogConfigurationException("Unexpected InvocationTargetException", e.getTargetException()); - } - } - } catch (NoSuchMethodException e) { - // Assume we are running on JDK 1.1 - classLoader = getClassLoader(LogFactory.class); - - // We deliberately don't log a message here to outputStream; - // this message would be output for every call to LogFactory.getLog() - // when running on JDK1.1 - // - // if (outputStream != null) { - // outputStream.println( - // "Method Thread.getContextClassLoader does not exist;" - // + " assuming this is JDK 1.1, and that the context" - // + " classloader is the same as the class that loaded" - // + " the concrete LogFactory class."); - // } + classLoader = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + /** + * getContextClassLoader() throws SecurityException when + * the context class loader isn't an ancestor of the + * calling class's class loader, or if security + * permissions are restricted. + * + * We ignore this exception to be consistent with the previous + * behavior (e.g. 1.1.3 and earlier). + */ + // ignore } // Return the selected class loader @@ -951,8 +908,8 @@ * implementation class, loaded by the specified class loader. * If that fails, try the class loader used to load this * (abstract) LogFactory. - * <p> * <h2>ClassLoader conflicts</h2> + * <p> * Note that there can be problems if the specified ClassLoader is not the * same as the classloader that loaded this class, ie when loading a * concrete LogFactory subclass via a context classloader. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/src/site/site.xml new/commons-logging-1.2-src/src/site/site.xml --- old/commons-logging-1.1.3-src/src/site/site.xml 2013-05-16 22:04:22.000000000 +0200 +++ new/commons-logging-1.2-src/src/site/site.xml 2014-07-05 20:11:35.000000000 +0200 @@ -39,8 +39,8 @@ href="/RELEASE-NOTES.txt"/> <item name='JavaDoc (Latest release)' href='/javadocs/api-release/index.html'/> - <item name='JavaDoc (v1.1)' - href='/javadocs/api-1.1/index.html'/> + <item name='JavaDoc (v1.1.3)' + href='/javadocs/api-1.1.3/index.html'/> <item name='JavaDoc (v1.0.4)' href='/javadocs/api-1.0.4/index.html'/> </menu> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/src/site/xdoc/download_logging.xml new/commons-logging-1.2-src/src/site/xdoc/download_logging.xml --- old/commons-logging-1.1.3-src/src/site/xdoc/download_logging.xml 2013-05-16 22:04:22.000000000 +0200 +++ new/commons-logging-1.2-src/src/site/xdoc/download_logging.xml 2014-07-05 20:11:36.000000000 +0200 @@ -45,11 +45,11 @@ --> <document> <properties> - <title>Download Commons Logging</title> + <title>Download Apache Commons Logging</title> <author email="dev@commons.apache.org">Commons Documentation Team</author> </properties> <body> - <section name="Download Commons Logging"> + <section name="Download Apache Commons Logging"> <subsection name="Using a Mirror"> <p> We recommend you use a mirror to download our release @@ -95,32 +95,32 @@ </p> </subsection> </section> - <section name="Commons Logging 1.1.3 "> + <section name="Apache Commons Logging 1.2 "> <subsection name="Binaries"> <table> <tr> - <td><a href="[preferred]/commons/logging/binaries/commons-logging-1.1.3-bin.tar.gz">commons-logging-1.1.3-bin.tar.gz</a></td> - <td><a href="http://www.apache.org/dist/commons/logging/binaries/commons-logging-1.1.3-bin.tar.gz.md5">md5</a></td> - <td><a href="http://www.apache.org/dist/commons/logging/binaries/commons-logging-1.1.3-bin.tar.gz.asc">pgp</a></td> + <td><a href="[preferred]/commons/logging/binaries/commons-logging-1.2-bin.tar.gz">commons-logging-1.2-bin.tar.gz</a></td> + <td><a href="http://www.apache.org/dist/commons/logging/binaries/commons-logging-1.2-bin.tar.gz.md5">md5</a></td> + <td><a href="http://www.apache.org/dist/commons/logging/binaries/commons-logging-1.2-bin.tar.gz.asc">pgp</a></td> </tr> <tr> - <td><a href="[preferred]/commons/logging/binaries/commons-logging-1.1.3-bin.zip">commons-logging-1.1.3-bin.zip</a></td> - <td><a href="http://www.apache.org/dist/commons/logging/binaries/commons-logging-1.1.3-bin.zip.md5">md5</a></td> - <td><a href="http://www.apache.org/dist/commons/logging/binaries/commons-logging-1.1.3-bin.zip.asc">pgp</a></td> + <td><a href="[preferred]/commons/logging/binaries/commons-logging-1.2-bin.zip">commons-logging-1.2-bin.zip</a></td> + <td><a href="http://www.apache.org/dist/commons/logging/binaries/commons-logging-1.2-bin.zip.md5">md5</a></td> + <td><a href="http://www.apache.org/dist/commons/logging/binaries/commons-logging-1.2-bin.zip.asc">pgp</a></td> </tr> </table> </subsection> <subsection name="Source"> <table> <tr> - <td><a href="[preferred]/commons/logging/source/commons-logging-1.1.3-src.tar.gz">commons-logging-1.1.3-src.tar.gz</a></td> - <td><a href="http://www.apache.org/dist/commons/logging/source/commons-logging-1.1.3-src.tar.gz.md5">md5</a></td> - <td><a href="http://www.apache.org/dist/commons/logging/source/commons-logging-1.1.3-src.tar.gz.asc">pgp</a></td> + <td><a href="[preferred]/commons/logging/source/commons-logging-1.2-src.tar.gz">commons-logging-1.2-src.tar.gz</a></td> + <td><a href="http://www.apache.org/dist/commons/logging/source/commons-logging-1.2-src.tar.gz.md5">md5</a></td> + <td><a href="http://www.apache.org/dist/commons/logging/source/commons-logging-1.2-src.tar.gz.asc">pgp</a></td> </tr> <tr> - <td><a href="[preferred]/commons/logging/source/commons-logging-1.1.3-src.zip">commons-logging-1.1.3-src.zip</a></td> - <td><a href="http://www.apache.org/dist/commons/logging/source/commons-logging-1.1.3-src.zip.md5">md5</a></td> - <td><a href="http://www.apache.org/dist/commons/logging/source/commons-logging-1.1.3-src.zip.asc">pgp</a></td> + <td><a href="[preferred]/commons/logging/source/commons-logging-1.2-src.zip">commons-logging-1.2-src.zip</a></td> + <td><a href="http://www.apache.org/dist/commons/logging/source/commons-logging-1.2-src.zip.md5">md5</a></td> + <td><a href="http://www.apache.org/dist/commons/logging/source/commons-logging-1.2-src.zip.asc">pgp</a></td> </tr> </table> </subsection> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/src/site/xdoc/index.xml new/commons-logging-1.2-src/src/site/xdoc/index.xml --- old/commons-logging-1.1.3-src/src/site/xdoc/index.xml 2013-05-16 22:04:22.000000000 +0200 +++ new/commons-logging-1.2-src/src/site/xdoc/index.xml 2014-07-05 20:11:36.000000000 +0200 @@ -81,6 +81,11 @@ Binary and source distributions are available <a href="http://commons.apache.org/logging/download_logging.cgi">here</a>. </p> + <subsection name='1.2 Release - July 2014'> + <p>The main purpose of the 1.2 release is to drop support for Java 1.1.</p> + <p>For a full list of changes since the 1.1.3 release, please refer to the + <a href="changes-report.html">change-report</a>.</p> + </subsection> <subsection name='1.1.3 Release - May 2013'> <p>The 1.1.3 release only updates the Bundle-SymbolicName in the manifest to "org.apache.commons.logging".</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/src/test/java/org/apache/commons/logging/AltHashtableTestCase.java new/commons-logging-1.2-src/src/test/java/org/apache/commons/logging/AltHashtableTestCase.java --- old/commons-logging-1.1.3-src/src/test/java/org/apache/commons/logging/AltHashtableTestCase.java 2013-05-16 22:04:21.000000000 +0200 +++ new/commons-logging-1.2-src/src/test/java/org/apache/commons/logging/AltHashtableTestCase.java 2014-07-05 20:11:35.000000000 +0200 @@ -23,7 +23,7 @@ /** * Test the ability to force the LogFactory class to use some * arbitrary Hashtable implementation to store its mapping from - * context-classloader -> LogFactory object. + * context-classloader -> LogFactory object. */ public class AltHashtableTestCase extends TestCase { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/src/test/java/org/apache/commons/logging/security/DummyClass.java new/commons-logging-1.2-src/src/test/java/org/apache/commons/logging/security/DummyClass.java --- old/commons-logging-1.1.3-src/src/test/java/org/apache/commons/logging/security/DummyClass.java 1970-01-01 01:00:00.000000000 +0100 +++ new/commons-logging-1.2-src/src/test/java/org/apache/commons/logging/security/DummyClass.java 2014-07-05 20:11:35.000000000 +0200 @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE + * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file + * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by + * applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +package org.apache.commons.logging.security; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +public class DummyClass { + + public DummyClass() { + Log log = LogFactory.getLog(DummyClass.class); + log.info("Some log message"); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/src/test/java/org/apache/commons/logging/security/MockSecurityManager.java new/commons-logging-1.2-src/src/test/java/org/apache/commons/logging/security/MockSecurityManager.java --- old/commons-logging-1.1.3-src/src/test/java/org/apache/commons/logging/security/MockSecurityManager.java 2013-05-16 22:04:21.000000000 +0200 +++ new/commons-logging-1.2-src/src/test/java/org/apache/commons/logging/security/MockSecurityManager.java 2014-07-05 20:11:35.000000000 +0200 @@ -95,6 +95,13 @@ return; } + if (cname.equals("java.util.logging.Level") && stack[i].getMethodName().equals("getLocalizedLevelName")) { + // LOGGING-156: OpenJDK 1.7 JULI code (java.util.logging.Level#getLocalizedLevelName) + // calls ResourceBundle#getBundle() without using AccessController#doPrivileged() + // requiring RuntimePermission: "accessClassInPackage.sun.util.logging.resources" + return; + } + if (cname.equals("java.security.AccessController")) { // Presumably method name equals "doPrivileged" // diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java new/commons-logging-1.2-src/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java --- old/commons-logging-1.1.3-src/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java 2013-05-16 22:04:21.000000000 +0200 +++ new/commons-logging-1.2-src/src/test/java/org/apache/commons/logging/security/SecurityAllowedTestCase.java 2014-07-05 20:11:35.000000000 +0200 @@ -125,7 +125,7 @@ // we better compare that we have no security exception during the call to log // IBM JVM tries to load bundles during the invoke call, which increase the count - assertEquals(untrustedCodeCount, mySecurityManager.getUntrustedCodeCount()); + assertEquals("Untrusted code count", untrustedCodeCount, mySecurityManager.getUntrustedCodeCount()); } catch(Throwable t) { // Restore original security manager so output can be generated; the // PrintWriter constructor tries to read the line.separator diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/commons-logging-1.1.3-src/src/test/java/org/apache/commons/logging/security/SecurityForbiddenTestCase.java new/commons-logging-1.2-src/src/test/java/org/apache/commons/logging/security/SecurityForbiddenTestCase.java --- old/commons-logging-1.1.3-src/src/test/java/org/apache/commons/logging/security/SecurityForbiddenTestCase.java 2013-05-16 22:04:21.000000000 +0200 +++ new/commons-logging-1.2-src/src/test/java/org/apache/commons/logging/security/SecurityForbiddenTestCase.java 2014-07-05 20:11:35.000000000 +0200 @@ -47,6 +47,7 @@ public class SecurityForbiddenTestCase extends TestCase { private SecurityManager oldSecMgr; + private ClassLoader otherClassLoader; // Dummy special hashtable, so we can tell JCL to use this instead of // the standard one. @@ -75,6 +76,12 @@ public void setUp() { // save security manager so it can be restored in tearDown oldSecMgr = System.getSecurityManager(); + + PathableClassLoader classLoader = new PathableClassLoader(null); + classLoader.addLogicalLib("commons-logging"); + classLoader.addLogicalLib("testclasses"); + + otherClassLoader = classLoader; } public void tearDown() { @@ -131,4 +138,54 @@ fail("Unexpected exception:" + t.getMessage() + ":" + sw.toString()); } } + + /** + * Test what happens when JCL is run with absolutely no security + * privileges at all and a class loaded with a different classloader + * than the context classloader of the current thread tries to log something. + */ + public void testContextClassLoader() { + System.setProperty( + LogFactory.HASHTABLE_IMPLEMENTATION_PROPERTY, + CustomHashtable.class.getName()); + MockSecurityManager mySecurityManager = new MockSecurityManager(); + + System.setSecurityManager(mySecurityManager); + + try { + // load a dummy class with another classloader + // to force a SecurityException when the LogFactory calls + // Thread.getCurrentThread().getContextClassLoader() + loadClass("org.apache.commons.logging.security.DummyClass", otherClassLoader); + + System.setSecurityManager(oldSecMgr); + assertEquals(0, mySecurityManager.getUntrustedCodeCount()); + } catch(Throwable t) { + // Restore original security manager so output can be generated; the + // PrintWriter constructor tries to read the line.separator + // system property. + System.setSecurityManager(oldSecMgr); + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + t.printStackTrace(pw); + fail("Unexpected exception:" + t.getMessage() + ":" + sw.toString()); + } + } + + /** + * Loads a class with the given classloader. + */ + private Object loadClass(String name, ClassLoader classLoader) { + try { + Class clazz = classLoader.loadClass(name); + Object obj = clazz.newInstance(); + return obj; + } catch ( Exception e ) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + e.printStackTrace(pw); + fail("Unexpected exception:" + e.getMessage() + ":" + sw.toString()); + } + return null; + } } ++++++ commons-logging-api-1.1.pom -> commons-logging-1.2.pom ++++++ ++++ 652 lines (skipped) ++++ between /work/SRC/openSUSE:Factory/apache-commons-logging/commons-logging-api-1.1.pom ++++ and /work/SRC/openSUSE:Factory/.apache-commons-logging.new/commons-logging-1.2.pom
participants (1)
-
root@hilbert.suse.de