diff -Nru libcommons-collections4-java-4.1/build.properties.sample libcommons-collections4-java-4.2/build.properties.sample --- libcommons-collections4-java-4.1/build.properties.sample 2013-11-13 21:15:50.000000000 +0000 +++ libcommons-collections4-java-4.2/build.properties.sample 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,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. -########################################################################## -# Sample Ant build.properties file -# -# This setup assumes dependent jars are in a local maven 2 repository. -# However the jars are located, the properties ending in ".jar" need -# expand to full paths to the jars. -########################################################################## - -# Repository base path - unnecessary if full jar paths are provided below -repository=${user.home}/.m2/repository -junit.home=${repository}/junit/junit/4.11/ -hamcrest.home=${repository}/org/hamcrest/hamcrest-core/1.3/ -easymock.home=${repository}/org/easymock/easymock/3.2/ diff -Nru libcommons-collections4-java-4.1/build.xml libcommons-collections4-java-4.2/build.xml --- libcommons-collections4-java-4.1/build.xml 2013-06-23 18:27:46.000000000 +0000 +++ libcommons-collections4-java-4.2/build.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,257 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru libcommons-collections4-java-4.1/CONTRIBUTING.md libcommons-collections4-java-4.2/CONTRIBUTING.md --- libcommons-collections4-java-4.1/CONTRIBUTING.md 2015-04-08 18:44:36.000000000 +0000 +++ libcommons-collections4-java-4.2/CONTRIBUTING.md 2018-07-08 00:18:18.000000000 +0000 @@ -50,48 +50,66 @@ + Make sure you have a [JIRA account](https://issues.apache.org/jira/). + Make sure you have a [GitHub account](https://github.com/signup/free). -+ If you're planning to implement a new feature it makes sense to discuss you're changes on the [dev list](https://commons.apache.org/mail-lists.html) first. This way you can make sure you're not wasting your time on something that isn't considered to be in Apache Commons Collections's scope. -+ Submit a ticket for your issue, assuming one does not already exist. ++ If you're planning to implement a new feature it makes sense to discuss your changes on the [dev list](https://commons.apache.org/mail-lists.html) first. This way you can make sure you're not wasting your time on something that isn't considered to be in Apache Commons Collections's scope. ++ Submit a [Jira Ticket][jira] for your issue, assuming one does not already exist. + Clearly describe the issue including steps to reproduce when it is a bug. + Make sure you fill in the earliest version that you know has the issue. -+ Fork the repository on GitHub. ++ Find the corresponding [repository on GitHub](https://github.com/apache/?query=commons-), +[fork](https://help.github.com/articles/fork-a-repo/) and check out your forked repository. Making Changes -------------- -+ Create a topic branch from where you want to base your work (this is usually the master/trunk branch). ++ Create a _topic branch_ for your isolated work. + * Usually you should base your branch on the `master` or `trunk` branch. + * A good topic branch name can be the JIRA bug id plus a keyword, e.g. `COLLECTIONS-123-InputStream`. + * If you have submitted multiple JIRA issues, try to maintain separate branches and pull requests. + Make commits of logical units. + * Make sure your commit messages are meaningful and in the proper format. Your commit message should contain the key of the JIRA issue. + * e.g. `COLLECTIONS-123: Close input stream earlier` + Respect the original code style: + Only use spaces for indentation. - + Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change. - + Check for unnecessary whitespace with git diff --check before committing. -+ Make sure your commit messages are in the proper format. Your commit message should contain the key of the JIRA issue. -+ Make sure you have added the necessary tests for your changes. + + Create minimal diffs - disable _On Save_ actions like _Reformat Source Code_ or _Organize Imports_. If you feel the source code should be reformatted create a separate PR for this change first. + + Check for unnecessary whitespace with `git diff` -- check before committing. ++ Make sure you have added the necessary tests for your changes, typically in `src/test/java`. + Run all the tests with `mvn clean verify` to assure nothing else was accidentally broken. Making Trivial Changes ---------------------- +The JIRA tickets are used to generate the changelog for the next release. + For changes of a trivial nature to comments and documentation, it is not always necessary to create a new ticket in JIRA. In this case, it is appropriate to start the first line of a commit with '(doc)' instead of a ticket number. + Submitting Changes ------------------ -+ Sign the [Contributor License Agreement][cla] if you haven't already. ++ Sign and submit the Apache [Contributor License Agreement][cla] if you haven't already. + * Note that small patches & typical bug fixes do not require a CLA as + clause 5 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0.html#contributions) + covers them. + Push your changes to a topic branch in your fork of the repository. -+ Submit a pull request to the repository in the apache organization. ++ Submit a _Pull Request_ to the corresponding repository in the `apache` organization. + * Verify _Files Changed_ shows only your intended changes and does not + include additional files like `target/*.class` + Update your JIRA ticket and include a link to the pull request in the ticket. +If you prefer to not use GitHub, then you can instead use +`git format-patch` (or `svn diff`) and attach the patch file to the JIRA issue. + + Additional Resources -------------------- + [Contributing patches](https://commons.apache.org/patches.html) -+ [Apache Commons Collections JIRA project page](https://issues.apache.org/jira/browse/COLLECTIONS) ++ [Apache Commons Collections JIRA project page][jira] + [Contributor License Agreement][cla] + [General GitHub documentation](https://help.github.com/) -+ [GitHub pull request documentation](https://help.github.com/send-pull-requests/) ++ [GitHub pull request documentation](https://help.github.com/articles/creating-a-pull-request/) + [Apache Commons Twitter Account](https://twitter.com/ApacheCommons) -+ #apachecommons IRC channel on freenode.org ++ `#apache-commons` IRC channel on `irc.freenode.net` [cla]:https://www.apache.org/licenses/#clas +[jira]:https://issues.apache.org/jira/browse/COLLECTIONS diff -Nru libcommons-collections4-java-4.1/debian/changelog libcommons-collections4-java-4.2/debian/changelog --- libcommons-collections4-java-4.1/debian/changelog 2015-12-06 21:47:29.000000000 +0000 +++ libcommons-collections4-java-4.2/debian/changelog 2019-02-26 14:40:13.000000000 +0000 @@ -1,3 +1,21 @@ +libcommons-collections4-java (4.2-1~18.04) bionic; urgency=medium + + * Backport for OpenJDK 11. LP: #1814133. + + -- Matthias Klose Tue, 26 Feb 2019 15:40:13 +0100 + +libcommons-collections4-java (4.2-1) unstable; urgency=medium + + * New upstream release + * Fixed the build failure with Java 11 (Closes: #912477) + * Added the OSGi metadata + * Standards-Version updated to 4.2.1 + * Switch to debhelper level 11 + * Use salsa.debian.org Vcs-* URLs + * Track and download the new releases from the GitHub mirror + + -- Emmanuel Bourg Tue, 06 Nov 2018 16:47:50 +0100 + libcommons-collections4-java (4.1-1) unstable; urgency=medium * New upstream release diff -Nru libcommons-collections4-java-4.1/debian/compat libcommons-collections4-java-4.2/debian/compat --- libcommons-collections4-java-4.1/debian/compat 2015-12-06 21:32:22.000000000 +0000 +++ libcommons-collections4-java-4.2/debian/compat 2018-11-06 15:38:42.000000000 +0000 @@ -1 +1 @@ -9 +11 diff -Nru libcommons-collections4-java-4.1/debian/control libcommons-collections4-java-4.2/debian/control --- libcommons-collections4-java-4.1/debian/control 2015-12-06 21:47:29.000000000 +0000 +++ libcommons-collections4-java-4.2/debian/control 2018-11-06 15:38:42.000000000 +0000 @@ -3,14 +3,19 @@ Priority: optional Maintainer: Debian Java Maintainers Uploaders: Emmanuel Bourg -Build-Depends: debhelper (>= 9), default-jdk, maven-debian-helper (>= 1.5) -Build-Depends-Indep: default-jdk-doc, - junit4, - libeasymock-java, - libmaven-javadoc-plugin-java -Standards-Version: 3.9.6 -Vcs-Git: git://anonscm.debian.org/pkg-java/libcommons-collections4-java.git -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/libcommons-collections4-java.git +Build-Depends: + debhelper (>= 11), + default-jdk, + default-jdk-doc, + junit4, + libcommons-parent-java (>= 39-3~), + libeasymock-java, + libmaven-bundle-plugin-java, + libmaven-javadoc-plugin-java, + maven-debian-helper (>= 2.0.2~) +Standards-Version: 4.2.1 +Vcs-Git: https://salsa.debian.org/java-team/libcommons-collections4-java.git +Vcs-Browser: https://salsa.debian.org/java-team/libcommons-collections4-java Homepage: http://commons.apache.org/collections/ Package: libcommons-collections4-java diff -Nru libcommons-collections4-java-4.1/debian/libcommons-collections4-java.poms libcommons-collections4-java-4.2/debian/libcommons-collections4-java.poms --- libcommons-collections4-java-4.1/debian/libcommons-collections4-java.poms 2015-12-06 21:49:04.000000000 +0000 +++ libcommons-collections4-java-4.2/debian/libcommons-collections4-java.poms 2018-11-06 15:38:42.000000000 +0000 @@ -25,4 +25,4 @@ # --site-xml=: Optional, the location for site.xml if it needs to be installed. # Empty by default. [mh_install] # -pom.xml --no-parent --has-package-version +pom.xml --has-package-version diff -Nru libcommons-collections4-java-4.1/debian/maven.properties libcommons-collections4-java-4.2/debian/maven.properties --- libcommons-collections4-java-4.1/debian/maven.properties 2015-12-06 21:32:22.000000000 +0000 +++ libcommons-collections4-java-4.2/debian/maven.properties 2018-11-06 15:47:50.000000000 +0000 @@ -2,5 +2,4 @@ # For example: # maven.test.skip=true -maven.compiler.source=1.6 -maven.compiler.target=1.6 +maven.compiler.release=7 diff -Nru libcommons-collections4-java-4.1/debian/orig-tar.sh libcommons-collections4-java-4.2/debian/orig-tar.sh --- libcommons-collections4-java-4.1/debian/orig-tar.sh 2015-12-06 21:32:22.000000000 +0000 +++ libcommons-collections4-java-4.2/debian/orig-tar.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#!/bin/sh - -set -e - -PACKAGE=$(dpkg-parsechangelog -S Source) -VERSION=$2 -TAR=../${PACKAGE}_${VERSION}.orig.tar.xz -DIR=${PACKAGE}_${VERSION} -TAG=$(echo "COLLECTIONS_$VERSION" | sed -re's,\.,_,') - -svn export http://svn.apache.org/repos/asf/commons/proper/collections/tags/${TAG} $DIR -XZ_OPT=--best tar -c -J -f $TAR $DIR -rm -rf $DIR ../$TAG diff -Nru libcommons-collections4-java-4.1/debian/rules libcommons-collections4-java-4.2/debian/rules --- libcommons-collections4-java-4.1/debian/rules 2015-12-06 21:47:20.000000000 +0000 +++ libcommons-collections4-java-4.2/debian/rules 2018-11-06 15:38:42.000000000 +0000 @@ -8,5 +8,3 @@ override_dh_installchangelogs: dh_installchangelogs RELEASE-NOTES.txt -get-orig-source: - uscan --download-current-version --force-download --no-symlink diff -Nru libcommons-collections4-java-4.1/debian/watch libcommons-collections4-java-4.2/debian/watch --- libcommons-collections4-java-4.1/debian/watch 2015-12-06 21:32:22.000000000 +0000 +++ libcommons-collections4-java-4.2/debian/watch 2018-11-06 15:47:50.000000000 +0000 @@ -1,4 +1,3 @@ -version=3 -opts="uversionmangle=s/_/./" \ - http://svn.apache.org/viewvc/commons/proper/collections/tags/ COLLECTIONS_([\d_]*)/ \ - debian debian/orig-tar.sh +version=4 +opts="repack,compression=xz" \ +https://github.com/apache/commons-collections/tags .*/commons-collections-([\d.]+).tar.gz diff -Nru libcommons-collections4-java-4.1/default.properties libcommons-collections4-java-4.2/default.properties --- libcommons-collections4-java-4.1/default.properties 2015-11-25 21:52:13.000000000 +0000 +++ libcommons-collections4-java-4.2/default.properties 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,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. -# - -# $Id: default.properties 1716550 2015-11-25 21:52:13Z tn $ - -# The location of the "junit.jar" JAR file -junit.jar = ${junit.home}/junit-4.11.jar - -# The location of the "junit.jar" JAR file -hamcrest.jar = ${hamcrest.home}/hamcrest-core-1.3.jar - -# The location of the Easymock jar -easymock.jar = ${easymock.home}/easymock-3.2.jar - -# Whether or not to fork tests -junit.fork = true - -# The name of this component -component.name = commons-collections4 - -# The primary package name of this component -component.package = org.apache.commons.collections4 - -# The title of this component -component.title = Commons Collections - -# The current version number of this component -component.version = 4.1 - -# The name that is used to create the jar file -final.name = ${component.name}-${component.version} - -# The base directory for compilation targets -build.home = target - -# The base directory for component configuration files -conf.home = src/conf - -# The base directory for component sources -source.home = src/main/java - -# The base directory for unit test sources -test.home = src/test/java - -# Should Java compilations set the 'debug' compiler option? -compile.debug = true - -# Should Java compilations set the 'deprecation' compiler option? -compile.deprecation = true - -# Should Java compilations set the 'optimize' compiler option? -compile.optimize = true - -# Generate class files for specific VM version (e.g., 1.1 or 1.2). -# Note that the default value depends on the JVM that is running Ant. -# In particular, if you use JDK 1.4+ the generated classes will not be usable -# for a 1.1 Java VM unless you explicitly set this attribute to the value 1.1 -# (which is the default value for JDK 1.1 to 1.3). -compile.target = 1.6 - -# Specifies the source version for the Java compiler. -# Corresponds to the source attribute for the ant javac task. -# Valid values are 1.3, 1.4, 1.5. -compile.source = 1.6 - -# Specifies the source encoding. -compile.encoding = ISO-8859-1 - -# Should all tests fail if one does? -test.failonerror = true - -# The test runner to execute -test.runner = junit.textui.TestRunner diff -Nru libcommons-collections4-java-4.1/DEVELOPERS-GUIDE.html libcommons-collections4-java-4.2/DEVELOPERS-GUIDE.html --- libcommons-collections4-java-4.1/DEVELOPERS-GUIDE.html 2012-06-23 15:49:16.000000000 +0000 +++ libcommons-collections4-java-4.2/DEVELOPERS-GUIDE.html 2018-07-08 00:18:18.000000000 +0000 @@ -24,7 +24,7 @@

The Apache Commons Collections Package

Developers Guide

-$Id: DEVELOPERS-GUIDE.html 1353152 2012-06-23 15:49:16Z tn $
+$Id$
[Introduction] [Collection Interfaces] [Collection Implementations] diff -Nru libcommons-collections4-java-4.1/doap_collections.rdf libcommons-collections4-java-4.2/doap_collections.rdf --- libcommons-collections4-java-4.1/doap_collections.rdf 2015-11-14 13:37:20.000000000 +0000 +++ libcommons-collections4-java-4.2/doap_collections.rdf 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ - - - - - Apache Commons Collections - - Java - - - - - - Commons Collections - Types that extend and augment the Java Collections Framework. - - - - - - - - - commons-collections - 2013-11-24 - 4.0 - - - - - commons-collections - 2015-11-14 - 3.2.2 - - - - - commons-collections - 2008-04-15 - 3.2.1 - - - - - commons-collections - 2006-05-14 - 3.2 - - - - - commons-collections - 2004-06-23 - 3.1 - - - - - commons-collections - 2004-06-23 - 2.1.1 - - - - - diff -Nru libcommons-collections4-java-4.1/NOTICE.txt libcommons-collections4-java-4.2/NOTICE.txt --- libcommons-collections4-java-4.1/NOTICE.txt 2015-01-07 21:02:51.000000000 +0000 +++ libcommons-collections4-java-4.2/NOTICE.txt 2018-07-08 00:18:18.000000000 +0000 @@ -1,5 +1,5 @@ Apache Commons Collections -Copyright 2001-2015 The Apache Software Foundation +Copyright 2001-2018 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff -Nru libcommons-collections4-java-4.1/pom.xml libcommons-collections4-java-4.2/pom.xml --- libcommons-collections4-java-4.1/pom.xml 2015-11-25 21:52:13.000000000 +0000 +++ libcommons-collections4-java-4.2/pom.xml 2018-07-08 00:18:18.000000000 +0000 @@ -19,12 +19,11 @@ org.apache.commons commons-parent - 38 + 47 4.0.0 - org.apache.commons commons-collections4 - 4.1 + 4.2 Apache Commons Collections 2001 @@ -38,9 +37,9 @@ - scm:svn:http://svn.apache.org/repos/asf/commons/proper/collections/trunk - scm:svn:https://svn.apache.org/repos/asf/commons/proper/collections/trunk - http://svn.apache.org/viewvc/commons/proper/collections/trunk + scm:git:http://git-wip-us.apache.org/repos/asf/commons-collections.git + scm:git:https://git-wip-us.apache.org/repos/asf/commons-collections.git + https://git-wip-us.apache.org/repos/asf?p=commons-collections.git @@ -65,7 +64,7 @@ morgand - Gary D. Gregory + Gary Gregory ggregory @@ -97,10 +96,6 @@ adriannistor - Phil Steitz - psteitz - - Arun M. Thomas amamment @@ -112,6 +107,10 @@ Henri Yandell bayard + + Rob Tompkins + chtompki + @@ -436,19 +435,28 @@ Goncalo Marques + + Vamsi Kavuri + junit junit - 4.11 + 4.12 test org.easymock easymock - 3.2 + 3.6 + test + + + org.apache.commons + commons-lang3 + 3.7 test @@ -464,11 +472,11 @@ UTF-8 UTF-8 - 1.6 - 1.6 + 1.7 + 1.7 - collections4 + collections + org.apache.commons.collections4 - 4.1 - (Java 6.0+) + 4.2 + (Requires Java 7 or later) - 3.2.2 - (Requires Java 1.3 or later) + 4.1 + (Requires Java 6 or later) commons-collections-${commons.release.2.version} + + 3.2.2 + (Requires Java 1.3 or later) + + commons-collections-${commons.release.3.version} + COLLECTIONS 12310465 - RC2 - 2.9.1 + RC1 + 3.0.0 collections https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-collections site-content - - 2.9.1 + + 2.8 + + + 4.1 + true + Gary Gregory + 86FDC7E2A11262CB + + clean verify apache-rat:check clirr:check javadoc:javadoc org.apache.maven.plugins @@ -532,11 +554,22 @@ + org.apache.rat + apache-rat-plugin + + + site-content/**/* + src/test/resources/data/test/* + + + + maven-checkstyle-plugin ${checkstyle.version} ${basedir}/src/conf/checkstyle.xml false + ${basedir}/src/conf/checkstyle-suppressions.xml @@ -548,6 +581,25 @@ + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + + + org.apache.commons.collections4 + + + + @@ -609,7 +661,7 @@ org.codehaus.mojo findbugs-maven-plugin - 2.5.5 + ${commons.findbugs.version} Normal Default @@ -618,7 +670,7 @@ maven-pmd-plugin - 2.7.1 + 3.10.0 ${maven.compiler.target} @@ -631,18 +683,6 @@ - - org.apache.rat - apache-rat-plugin - - - site-content/**/* - src/test/resources/data/test/* - maven-eclipse.xml - .travis.yml - - - @@ -659,7 +699,7 @@ org.apache.maven.plugins maven-antrun-plugin - 1.7 + 1.8 prepare-checkout @@ -691,40 +731,17 @@ - - travis + java9 - - env.TRAVIS - true - + 9 - true + + 3.0.1 + + true - - - - org.jacoco - jacoco-maven-plugin - ${commons.jacoco.version} - - - prepare-agent - - prepare-agent - - - - - - org.eluder.coveralls - coveralls-maven-plugin - 3.1.0 - - - diff -Nru libcommons-collections4-java-4.1/README.md libcommons-collections4-java-4.2/README.md --- libcommons-collections4-java-4.1/README.md 2015-11-25 19:39:02.000000000 +0000 +++ libcommons-collections4-java-4.2/README.md 2018-07-08 00:18:18.000000000 +0000 @@ -43,18 +43,18 @@ Apache Commons Collections =================== -[![Build Status](https://travis-ci.org/apache/commons-collections.svg?branch=trunk)](https://travis-ci.org/apache/commons-collections) -[![Coverage Status](https://coveralls.io/repos/apache/commons-collections/badge.svg?branch=trunk&service=github)](https://coveralls.io/github/apache/commons-collections?branch=trunk) +[![Build Status](https://travis-ci.org/apache/commons-collections.svg)](https://travis-ci.org/apache/commons-collections) +[![Coverage Status](https://coveralls.io/repos/apache/commons-collections/badge.svg)](https://coveralls.io/r/apache/commons-collections) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-collections4/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-collections4/) -[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) +[![Javadocs](https://javadoc.io/badge/org.apache.commons/commons-collections4/4.2.svg)](https://javadoc.io/doc/org.apache.commons/commons-collections4/4.2) The Apache Commons Collections package contains types that extend and augment the Java Collections Framework. Documentation ------------- -More information can be found on the [homepage](https://commons.apache.org/proper/commons-collections). -The [JavaDoc](https://commons.apache.org/proper/commons-collections/javadocs/api-release) can be browsed. +More information can be found on the [Apache Commons Collections homepage](https://commons.apache.org/proper/commons-collections). +The [Javadoc](https://commons.apache.org/proper/commons-collections/javadocs/api-release) can be browsed. Questions related to the usage of Apache Commons Collections should be posted to the [user mailing list][ml]. Where can I get the latest release? @@ -67,14 +67,14 @@ org.apache.commons commons-collections4 - 4.0 + 4.2 ``` Contributing ------------ -We accept PRs via github. The [developer mailing list][ml] is the main channel of communication for contributors. +We accept Pull Requests via GitHub. The [developer mailing list][ml] is the main channel of communication for contributors. There are some guidelines which will make applying PRs easier for us: + No tabs! Please use spaces for indentation. + Respect the code style. @@ -86,7 +86,9 @@ License ------- -Code is under the [Apache Licence v2](https://www.apache.org/licenses/LICENSE-2.0.txt). +This code is under the [Apache Licence v2](https://www.apache.org/licenses/LICENSE-2.0). + +See the `NOTICE.txt` file for required notices and attributions. Donations --------- @@ -96,8 +98,8 @@ -------------------- + [Apache Commons Homepage](https://commons.apache.org/) -+ [Apache Bugtracker (JIRA)](https://issues.apache.org/jira/) ++ [Apache Issue Tracker (JIRA)](https://issues.apache.org/jira/browse/COLLECTIONS) + [Apache Commons Twitter Account](https://twitter.com/ApacheCommons) -+ #apachecommons IRC channel on freenode.org ++ `#apache-commons` IRC channel on `irc.freenode.org` [ml]:https://commons.apache.org/mail-lists.html diff -Nru libcommons-collections4-java-4.1/RELEASE-NOTES.txt libcommons-collections4-java-4.2/RELEASE-NOTES.txt --- libcommons-collections4-java-4.1/RELEASE-NOTES.txt 2015-11-22 00:37:47.000000000 +0000 +++ libcommons-collections4-java-4.2/RELEASE-NOTES.txt 2018-07-08 00:18:18.000000000 +0000 @@ -1,3 +1,51 @@ + Apache Apache Commons Collections 4.2 RELEASE NOTES + +The Apache Commons Collections package contains types that extend and augment the Java Collections Framework. + +Update from Java 6 to Java 7, bug fixes, and small changes. + +Changes in this version include: + +New features: +o COLLECTIONS-681: Add test for MultiSetUtils Thanks to Stephan Fuhrmann. +o COLLECTIONS-658: Add Automatic-Module-Name MANIFEST entry for Java 9 compatibility. +o COLLECTIONS-589: Add null-safe MapUtils.size(Map) method. Thanks to Gary Gregory. +o COLLECTIONS-586: PatriciaTrie prefixMap clear throws NullPointerException. Thanks to Shailender Bathula, Gary Gregory. +o COLLECTIONS-654: Add class SortedProperties to sort keys. +o COLLECTIONS-668: Add CollectionUtils containsAny method for primitive array: org.apache.commons.collections4.CollectionUtils.containsAny(Collection, T...). Thanks to Gary Gregory. +o COLLECTIONS-575: Synchronized queue wrapper in QueueUtils. Thanks to Guram Savinov, Grzegorz Rożniecki, Bruno P. Kinoshita, Gary Gregory. +o COLLECTIONS-670: Add org.apache.commons.collections4.IteratorUtils.first(Iterator). Thanks to Gary Gregory. +o COLLECTIONS-671: Add org.apache.commons.collections4.IterableUtils.first(Iterable). Thanks to Gary Gregory. + +Fixed Bugs: +o COLLECTIONS-599: HashEntry array object naming data initialized with double the size during deserialization. Thanks to Tejas Patel, Saleem Akbar, Gary Gregory. +o COLLECTIONS-662: Unit tests MapUtilsTest and ListIteratorWrapperTest no longer fail on Java 9. Thanks to Vamsi Kavuri. +o COLLECTIONS-661: Intermittent test failures in Windows for HashSetValuedHashMap. +o COLLECTIONS-660: Uncomment test in AbstractMapTest regarding LRUMap equals. +o COLLECTIONS-656: Fix site build on Java 8. +o COLLECTIONS-653: Update Javadoc to Build on Java 1.8. +o COLLECTIONS-606: Build status, Coverage status and Maven central weren't in README.md Thanks to Vamsi Kavuri. +o COLLECTIONS-594: Web site spelling error: MultiValuedMapeList. Thanks to Javen O'Neal. +o COLLECTIONS-597: Correction of Javadoc for org.apache.commons.collections4.functors.CatchAndRethrowClosure. Thanks to Enrique. +o COLLECTIONS-678: The verification of unsupported iterator methods is not complete. Thanks to Oscar Luis Vera Pérez. +o COLLECTIONS-673: ListUtils.partition potential integer overflow. Thanks to John Mark, Stephan Fuhrmann. + +Changes: +o COLLECTIONS-602: Improve efficiency of DefaultedMap.get. Thanks to John Mark. +o COLLECTIONS-603: Small improvements for generics, conditional statements, and warnings suppressions. Thanks to Artem Konovalov. +o COLLECTIONS-655: Update platform from Java 6 to Java 7. +o COLLECTIONS-666: org.apache.commons.collections4.ListUtils.union(List, List) should pre-allocate result list. Thanks to BELUGA BEHR. +o COLLECTIONS-669: Update org.apache.commons.collections4.CollectionUtils.addAll(Collection, C[]) to addAll(Collection, C...). Thanks to BELUGA BEHR, Gary Gregory. + + +For complete information on Apache Commons Collections, including instructions on how to submit bug reports, +patches, or suggestions for improvement, see the Apache Apache Commons Collections website: + +http://commons.apache.org/proper/commons-collections/ + +Download page: http://commons.apache.org/proper/commons-collections/download_pool.cgi + +=============================================================================== Apache Commons Collections Version 4.1 diff -Nru libcommons-collections4-java-4.1/src/assembly/src.xml libcommons-collections4-java-4.2/src/assembly/src.xml --- libcommons-collections4-java-4.1/src/assembly/src.xml 2013-06-23 18:27:46.000000000 +0000 +++ libcommons-collections4-java-4.2/src/assembly/src.xml 2018-07-08 00:18:18.000000000 +0000 @@ -24,15 +24,14 @@ - build.xml - default.properties - build.properties.sample + .travis.yml + CONTRIBUTING.md DEVELOPERS-GUIDE.html LICENSE.txt NOTICE.txt pom.xml PROPOSAL.html - README.txt + README.md RELEASE-NOTES.txt diff -Nru libcommons-collections4-java-4.1/src/changes/changes.xml libcommons-collections4-java-4.2/src/changes/changes.xml --- libcommons-collections4-java-4.1/src/changes/changes.xml 2015-11-22 21:20:23.000000000 +0000 +++ libcommons-collections4-java-4.2/src/changes/changes.xml 2018-07-08 00:18:18.000000000 +0000 @@ -20,7 +20,83 @@ Commons Collections Changes - + + + Add test for MultiSetUtils + + + HashEntry array object naming data initialized with double the size during deserialization. + + + Unit tests MapUtilsTest and ListIteratorWrapperTest no longer fail on Java 9. + + + Intermittent test failures in Windows for HashSetValuedHashMap. + + + Uncomment test in AbstractMapTest regarding LRUMap equals. + + + Add Automatic-Module-Name MANIFEST entry for Java 9 compatibility. + + + Fix site build on Java 8. + + + Update Javadoc to Build on Java 1.8. + + + Build status, Coverage status and Maven central weren't in README.md + + + Improve efficiency of DefaultedMap.get. + + + Small improvements for generics, conditional statements, and warnings suppressions. + + + Update platform from Java 6 to Java 7. + + + Web site spelling error: MultiValuedMapeList. + + + Correction of Javadoc for org.apache.commons.collections4.functors.CatchAndRethrowClosure. + + + Add null-safe MapUtils.size(Map<?, ?>) method. + + + PatriciaTrie prefixMap clear throws NullPointerException. + + + Add class SortedProperties to sort keys. + + + org.apache.commons.collections4.ListUtils.union(List, List) should pre-allocate result list. + + + Update org.apache.commons.collections4.CollectionUtils.addAll(Collection<C>, C[]) to addAll(Collection<C>, C...). + + + Add CollectionUtils containsAny method for primitive array: org.apache.commons.collections4.CollectionUtils.containsAny(Collection<?>, T...). + + + Synchronized queue wrapper in QueueUtils. + + + Add org.apache.commons.collections4.IteratorUtils.first(Iterator). + + + Add org.apache.commons.collections4.IterableUtils.first(Iterable). + + + The verification of unsupported iterator methods is not complete. + + + ListUtils.partition potential integer overflow. + + Added new interfaces "MultiValuedMap", "ListValuedMap" and "SetValuedMap" @@ -131,7 +207,7 @@ "AbstractHashedMap" still inherits from "AbstractMap", contrary to what - the class javadoc stated. The inheritance will now be removed in v5.0. + the class javadoc stated. The inheritance will now be removed in v5.0. Changed scope of "CircularFifoQueue#isAtFullCapacity()" to public. @@ -232,7 +308,7 @@ Resolved generic parameter inconsistency for various static fields, e.g. BagUtils.EMPTY_BAG, TruePredicate.INSTANCE and many others. All accessible static fields use raw types so that they can be used directly without explicit casting. To avoid compiler warnings about unchecked - conversion and/or rawtypes use the corresponding factory methods, e.g. BagUtils.emptyBag(). + conversion and/or rawtypes use the corresponding factory methods, e.g. BagUtils.emptyBag(). Renamed methods "V MultiKeyMap#remove(Object, Object, ...)" to @@ -246,7 +322,7 @@ Refactored the test framework for Bag implementations to extend from "AbstractCollectionTest" by decorating the concrete Bag instance with - a CollectionBag or CollectionSortedBag. + a CollectionBag or CollectionSortedBag. "CollectionBag" will now also respect the contract of the decorated bag in case @@ -306,19 +382,19 @@ Added bag decorator "CollectionBag" which decorates a bag to make it comply with the Collection contract. - + Replaced "Collection" with "Iterable" for method arguments where applicable. - + Added "PushbackIterator" decorator to support pushback of elements during iteration. - + Added "PeekingIterator" decorator to support one-element lookahead during iteration. Added additional clarification to javadoc of interface "Put" wrt return type of - "put(Object, Object)" method. + "put(Object, Object)" method. Changed "IteratorChain" to use internally a "Queue" instead of a "List". Iterators are @@ -347,7 +423,7 @@ Several closure and transformer implementations in the functors package will now copy an array as input to their constructor (e.g. ChainedClosure). - + Change base package to org.apache.commons.collections4. @@ -445,7 +521,7 @@ Improved performance of "SetUniqueList#removeAll". - Improved performance of "ListOrderedSet#remove(Object)" in case the object is + Improved performance of "ListOrderedSet#remove(Object)" in case the object is not contained in the Set. diff -Nru libcommons-collections4-java-4.1/src/changes/release-notes.vm libcommons-collections4-java-4.2/src/changes/release-notes.vm --- libcommons-collections4-java-4.1/src/changes/release-notes.vm 2012-07-15 11:54:30.000000000 +0000 +++ libcommons-collections4-java-4.2/src/changes/release-notes.vm 2018-07-08 00:18:18.000000000 +0000 @@ -136,3 +136,5 @@ patches, or suggestions for improvement, see the Apache ${project.name} website: ${project.url} + +Download page: ${project.url}download_pool.cgi diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/ArrayStack.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/ArrayStack.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/ArrayStack.java 2013-04-30 18:55:24.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/ArrayStack.java 2018-07-08 00:18:18.000000000 +0000 @@ -36,9 +36,9 @@ * Note: From version 4.0 onwards, this class does not implement the * removed {@code Buffer} interface anymore. * + * @param the type of elements in this list * @see java.util.Stack * @since 1.0 - * @version $Id: ArrayStack.java 1477779 2013-04-30 18:55:24Z tn $ * @deprecated use {@link java.util.ArrayDeque} instead (available from Java 1.6) */ @Deprecated @@ -88,9 +88,8 @@ final int n = size(); if (n <= 0) { throw new EmptyStackException(); - } else { - return get(n - 1); } + return get(n - 1); } /** @@ -106,9 +105,8 @@ final int m = (size() - n) - 1; if (m < 0) { throw new EmptyStackException(); - } else { - return get(m); } + return get(m); } /** @@ -121,9 +119,8 @@ final int n = size(); if (n <= 0) { throw new EmptyStackException(); - } else { - return remove(n - 1); } + return remove(n - 1); } /** diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/ArrayUtils.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/ArrayUtils.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/ArrayUtils.java 1970-01-01 00:00:00.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/ArrayUtils.java 2018-07-08 00:18:18.000000000 +0000 @@ -0,0 +1,133 @@ +/* + * 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.collections4; + +/** + *

+ * Operations on arrays, primitive arrays (like {@code int[]}) and primitive wrapper arrays (like {@code Integer[]}). + *

+ *

+ * This class tries to handle {@code null} input gracefully. An exception will not be thrown for a {@code null} array + * input. However, an Object array that contains a {@code null} element may throw an exception. Each method documents + * its behaviour. + *

+ *

+ * Package private, might move to an internal package if this needs to be public. + *

+ *

+ * #ThreadSafe# + *

+ * + * @since 4.2 (Copied from Apache Commons Lang.) + * + */ +class ArrayUtils { + + /** + * The index value when an element is not found in a list or array: {@code -1}. This value is returned by methods in + * this class and can also be used in comparisons with values returned by various method from + * {@link java.util.List}. + */ + static final int INDEX_NOT_FOUND = -1; + + /** + *

+ * Checks if the object is in the given array. + *

+ * + *

+ * The method returns {@code false} if a {@code null} array is passed in. + *

+ * + * @param array + * the array to search through + * @param objectToFind + * the object to find + * @return {@code true} if the array contains the object + */ + static boolean contains(final Object[] array, final Object objectToFind) { + return indexOf(array, objectToFind) != INDEX_NOT_FOUND; + } + + /** + *

+ * Finds the index of the given object in the array. + *

+ * + *

+ * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. + *

+ * + * @param array + * the array to search through for the object, may be {@code null} + * @param objectToFind + * the object to find, may be {@code null} + * @return the index of the object within the array, {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or + * {@code null} array input + */ + static int indexOf(final T[] array, final Object objectToFind) { + return indexOf(array, objectToFind, 0); + } + + /** + *

+ * Finds the index of the given object in the array starting at the given index. + *

+ * + *

+ * This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. + *

+ * + *

+ * A negative startIndex is treated as zero. A startIndex larger than the array length will return + * {@link #INDEX_NOT_FOUND} ({@code -1}). + *

+ * + * @param array + * the array to search through for the object, may be {@code null} + * @param objectToFind + * the object to find, may be {@code null} + * @param startIndex + * the index to start searching at + * @return the index of the object within the array starting at the index, {@link #INDEX_NOT_FOUND} ({@code -1}) if + * not found or {@code null} array input + */ + static int indexOf(final Object[] array, final Object objectToFind, int startIndex) { + if (array == null) { + return INDEX_NOT_FOUND; + } + if (startIndex < 0) { + startIndex = 0; + } + if (objectToFind == null) { + for (int i = startIndex; i < array.length; i++) { + if (array[i] == null) { + return i; + } + } + } else { + for (int i = startIndex; i < array.length; i++) { + if (objectToFind.equals(array[i])) { + return i; + } + } + } + return INDEX_NOT_FOUND; + } + +} diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/AbstractBagDecorator.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/AbstractBagDecorator.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/AbstractBagDecorator.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/AbstractBagDecorator.java 2018-07-08 00:18:18.000000000 +0000 @@ -26,8 +26,8 @@ *

* Methods are forwarded directly to the decorated bag. * + * @param the type of elements in this bag * @since 3.0 - * @version $Id: AbstractBagDecorator.java 1686855 2015-06-22 13:00:27Z tn $ */ public abstract class AbstractBagDecorator extends AbstractCollectionDecorator implements Bag { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java 2015-06-11 11:57:24.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/AbstractMapBag.java 2018-07-08 00:18:18.000000000 +0000 @@ -38,8 +38,8 @@ * map will be used to map bag elements to a number; the number represents the * number of occurrences of that element in the bag. * + * @param the type of elements in this bag * @since 3.0 (previously DefaultMapBag v2.0) - * @version $Id: AbstractMapBag.java 1684859 2015-06-11 11:57:24Z tn $ */ public abstract class AbstractMapBag implements Bag { @@ -141,7 +141,7 @@ if (coll instanceof Bag) { return containsAll((Bag) coll); } - return containsAll(new HashBag(coll)); + return containsAll(new HashBag<>(coll)); } /** @@ -171,7 +171,7 @@ */ @Override public Iterator iterator() { - return new BagIterator(this); + return new BagIterator<>(this); } /** @@ -379,7 +379,7 @@ if (coll instanceof Bag) { return retainAll((Bag) coll); } - return retainAll(new HashBag(coll)); + return retainAll(new HashBag<>(coll)); } /** @@ -392,7 +392,7 @@ */ boolean retainAll(final Bag other) { boolean result = false; - final Bag excess = new HashBag(); + final Bag excess = new HashBag<>(); final Iterator i = uniqueSet().iterator(); while (i.hasNext()) { final E current = i.next(); diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/AbstractSortedBagDecorator.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/AbstractSortedBagDecorator.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/AbstractSortedBagDecorator.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/AbstractSortedBagDecorator.java 2018-07-08 00:18:18.000000000 +0000 @@ -25,8 +25,8 @@ *

* Methods are forwarded directly to the decorated bag. * + * @param the type of elements in this bag * @since 3.0 - * @version $Id: AbstractSortedBagDecorator.java 1686855 2015-06-22 13:00:27Z tn $ */ public abstract class AbstractSortedBagDecorator extends AbstractBagDecorator implements SortedBag { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/CollectionBag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/CollectionBag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/CollectionBag.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/CollectionBag.java 2018-07-08 00:18:18.000000000 +0000 @@ -34,9 +34,8 @@ * The method javadoc highlights the differences compared to the original Bag interface. * * @see Bag - * @param the type held in the bag + * @param the type of elements in this bag * @since 4.0 - * @version $Id: CollectionBag.java 1686855 2015-06-22 13:00:27Z tn $ */ public final class CollectionBag extends AbstractBagDecorator { @@ -52,7 +51,7 @@ * @throws NullPointerException if bag is null */ public static Bag collectionBag(final Bag bag) { - return new CollectionBag(bag); + return new CollectionBag<>(bag); } //----------------------------------------------------------------------- @@ -71,7 +70,7 @@ * Write the collection out using a custom routine. * * @param out the output stream - * @throws IOException + * @throws IOException if an error occurs while writing to the stream */ private void writeObject(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); @@ -82,8 +81,8 @@ * Read the collection in using a custom routine. * * @param in the input stream - * @throws IOException - * @throws ClassNotFoundException + * @throws IOException if an error occurs while reading from the stream + * @throws ClassNotFoundException if an object read from the stream can not be loaded * @throws ClassCastException if deserialised object has wrong type */ @SuppressWarnings("unchecked") // will throw CCE, see Javadoc @@ -178,10 +177,9 @@ result = result || changed; } return result; - } else { - // let the decorated bag handle the case of null argument - return decorated().removeAll(null); } + // let the decorated bag handle the case of null argument + return decorated().removeAll(null); } /** @@ -213,10 +211,9 @@ } } return modified; - } else { - // let the decorated bag handle the case of null argument - return decorated().retainAll(null); } + // let the decorated bag handle the case of null argument + return decorated().retainAll(null); } //----------------------------------------------------------------------- diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/CollectionSortedBag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/CollectionSortedBag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/CollectionSortedBag.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/CollectionSortedBag.java 2018-07-08 00:18:18.000000000 +0000 @@ -27,8 +27,8 @@ /** * Decorates another {@link SortedBag} to comply with the Collection contract. * + * @param the type of elements in this bag * @since 4.0 - * @version $Id: CollectionSortedBag.java 1686855 2015-06-22 13:00:27Z tn $ */ public final class CollectionSortedBag extends AbstractSortedBagDecorator { @@ -44,7 +44,7 @@ * @throws NullPointerException if bag is null */ public static SortedBag collectionSortedBag(final SortedBag bag) { - return new CollectionSortedBag(bag); + return new CollectionSortedBag<>(bag); } //----------------------------------------------------------------------- @@ -63,7 +63,7 @@ * Write the collection out using a custom routine. * * @param out the output stream - * @throws IOException + * @throws IOException if an error occurs while writing to the stream */ private void writeObject(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); @@ -74,8 +74,8 @@ * Read the collection in using a custom routine. * * @param in the input stream - * @throws IOException - * @throws ClassNotFoundException + * @throws IOException if an error occurs while reading from the stream + * @throws ClassNotFoundException if an object read from the stream can not be loaded * @throws ClassCastException if deserialised object has wrong type */ @SuppressWarnings("unchecked") // will throw CCE, see Javadoc @@ -131,10 +131,9 @@ result = result || changed; } return result; - } else { - // let the decorated bag handle the case of null argument - return decorated().removeAll(null); } + // let the decorated bag handle the case of null argument + return decorated().removeAll(null); } @Override @@ -149,10 +148,9 @@ } } return modified; - } else { - // let the decorated bag handle the case of null argument - return decorated().retainAll(null); } + // let the decorated bag handle the case of null argument + return decorated().retainAll(null); } //----------------------------------------------------------------------- diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/HashBag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/HashBag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/HashBag.java 2015-06-16 20:13:13.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/HashBag.java 2018-07-08 00:18:18.000000000 +0000 @@ -33,8 +33,8 @@ * interface javadoc carefully as several methods violate the * {@link Collection} interface specification. * + * @param the type of elements in this bag * @since 3.0 (previously in main package v2.0) - * @version $Id: HashBag.java 1685902 2015-06-16 20:13:13Z tn $ */ public class HashBag extends AbstractMapBag implements Serializable { @@ -61,6 +61,9 @@ //----------------------------------------------------------------------- /** * Write the bag out using a custom routine. + * + * @param out the output stream + * @throws IOException if an error occurs while writing to the stream */ private void writeObject(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); @@ -69,6 +72,10 @@ /** * Read the bag in using a custom routine. + * + * @param in the input stream + * @throws IOException if an error occurs while reading from the stream + * @throws ClassNotFoundException if an object read from the stream can not be loaded */ private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/package-info.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/package-info.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/package-info.java 2013-11-11 18:58:31.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/package-info.java 2018-07-08 00:18:18.000000000 +0000 @@ -34,6 +34,5 @@ *

  • Collection - ensures compliance with the java.util.Collection contract * * - * @version $Id: package-info.java 1540804 2013-11-11 18:58:31Z tn $ */ package org.apache.commons.collections4.bag; diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/PredicatedBag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/PredicatedBag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/PredicatedBag.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/PredicatedBag.java 2018-07-08 00:18:18.000000000 +0000 @@ -37,8 +37,8 @@ *

    * This class is Serializable from Commons Collections 3.1. * + * @param the type of elements in this bag * @since 3.0 - * @version $Id: PredicatedBag.java 1686855 2015-06-22 13:00:27Z tn $ */ public class PredicatedBag extends PredicatedCollection implements Bag { @@ -60,7 +60,7 @@ * @since 4.0 */ public static PredicatedBag predicatedBag(final Bag bag, final Predicate predicate) { - return new PredicatedBag(bag, predicate); + return new PredicatedBag<>(bag, predicate); } //----------------------------------------------------------------------- diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/PredicatedSortedBag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/PredicatedSortedBag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/PredicatedSortedBag.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/PredicatedSortedBag.java 2018-07-08 00:18:18.000000000 +0000 @@ -36,8 +36,8 @@ *

    * This class is Serializable from Commons Collections 3.1. * + * @param the type of elements in this bag * @since 3.0 - * @version $Id: PredicatedSortedBag.java 1686855 2015-06-22 13:00:27Z tn $ */ public class PredicatedSortedBag extends PredicatedBag implements SortedBag { @@ -60,7 +60,7 @@ */ public static PredicatedSortedBag predicatedSortedBag(final SortedBag bag, final Predicate predicate) { - return new PredicatedSortedBag(bag, predicate); + return new PredicatedSortedBag<>(bag, predicate); } //----------------------------------------------------------------------- diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/SynchronizedBag.java 2018-07-08 00:18:18.000000000 +0000 @@ -30,8 +30,8 @@ *

    * This class is Serializable from Commons Collections 3.1. * + * @param the type of elements in this bag * @since 3.0 - * @version $Id: SynchronizedBag.java 1686855 2015-06-22 13:00:27Z tn $ */ public class SynchronizedBag extends SynchronizedCollection implements Bag { @@ -48,7 +48,7 @@ * @since 4.0 */ public static SynchronizedBag synchronizedBag(final Bag bag) { - return new SynchronizedBag(bag); + return new SynchronizedBag<>(bag); } //----------------------------------------------------------------------- diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/SynchronizedSortedBag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/SynchronizedSortedBag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/SynchronizedSortedBag.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/SynchronizedSortedBag.java 2018-07-08 00:18:18.000000000 +0000 @@ -30,8 +30,8 @@ *

    * This class is Serializable from Commons Collections 3.1. * + * @param the type of elements in this bag * @since 3.0 - * @version $Id: SynchronizedSortedBag.java 1686855 2015-06-22 13:00:27Z tn $ */ public class SynchronizedSortedBag extends SynchronizedBag implements SortedBag { @@ -48,7 +48,7 @@ * @since 4.0 */ public static SynchronizedSortedBag synchronizedSortedBag(final SortedBag bag) { - return new SynchronizedSortedBag(bag); + return new SynchronizedSortedBag<>(bag); } //----------------------------------------------------------------------- diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/TransformedBag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/TransformedBag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/TransformedBag.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/TransformedBag.java 2018-07-08 00:18:18.000000000 +0000 @@ -33,8 +33,8 @@ *

    * This class is Serializable from Commons Collections 3.1. * + * @param the type of elements in this bag * @since 3.0 - * @version $Id: TransformedBag.java 1686855 2015-06-22 13:00:27Z tn $ */ public class TransformedBag extends TransformedCollection implements Bag { @@ -55,7 +55,7 @@ * @since 4.0 */ public static Bag transformingBag(final Bag bag, final Transformer transformer) { - return new TransformedBag(bag, transformer); + return new TransformedBag<>(bag, transformer); } /** @@ -74,7 +74,7 @@ * @since 4.0 */ public static Bag transformedBag(final Bag bag, final Transformer transformer) { - final TransformedBag decorated = new TransformedBag(bag, transformer); + final TransformedBag decorated = new TransformedBag<>(bag, transformer); if (bag.size() > 0) { @SuppressWarnings("unchecked") // Bag is of type E final E[] values = (E[]) bag.toArray(); // NOPMD - false positive for generics diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/TransformedSortedBag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/TransformedSortedBag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/TransformedSortedBag.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/TransformedSortedBag.java 2018-07-08 00:18:18.000000000 +0000 @@ -31,8 +31,8 @@ *

    * This class is Serializable from Commons Collections 3.1. * + * @param the type of elements in this bag * @since 3.0 - * @version $Id: TransformedSortedBag.java 1686855 2015-06-22 13:00:27Z tn $ */ public class TransformedSortedBag extends TransformedBag implements SortedBag { @@ -54,7 +54,7 @@ */ public static TransformedSortedBag transformingSortedBag(final SortedBag bag, final Transformer transformer) { - return new TransformedSortedBag(bag, transformer); + return new TransformedSortedBag<>(bag, transformer); } /** @@ -75,7 +75,7 @@ public static TransformedSortedBag transformedSortedBag(final SortedBag bag, final Transformer transformer) { - final TransformedSortedBag decorated = new TransformedSortedBag(bag, transformer); + final TransformedSortedBag decorated = new TransformedSortedBag<>(bag, transformer); if (bag.size() > 0) { @SuppressWarnings("unchecked") // bag is type E final E[] values = (E[]) bag.toArray(); // NOPMD - false positive for generics diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/TreeBag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/TreeBag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/TreeBag.java 2015-06-06 20:19:03.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/TreeBag.java 2018-07-08 00:18:18.000000000 +0000 @@ -38,8 +38,8 @@ * copies of an object to be added or removed at once. It is important to read the interface * javadoc carefully as several methods violate the {@link Collection} interface specification. * + * @param the type of elements in this bag * @since 3.0 (previously in main package v2.0) - * @version $Id: TreeBag.java 1683951 2015-06-06 20:19:03Z tn $ */ public class TreeBag extends AbstractMapBag implements SortedBag, Serializable { @@ -120,6 +120,9 @@ //----------------------------------------------------------------------- /** * Write the bag out using a custom routine. + * + * @param out the output stream + * @throws IOException if an error occurs while writing to the stream */ private void writeObject(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); @@ -129,6 +132,10 @@ /** * Read the bag in using a custom routine. + * + * @param in the input stream + * @throws IOException if an error occurs while reading from the stream + * @throws ClassNotFoundException if an object read from the stream can not be loaded */ private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/UnmodifiableBag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/UnmodifiableBag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/UnmodifiableBag.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/UnmodifiableBag.java 2018-07-08 00:18:18.000000000 +0000 @@ -35,8 +35,8 @@ *

    * Attempts to modify it will result in an UnsupportedOperationException. * + * @param the type of elements in this bag * @since 3.0 - * @version $Id: UnmodifiableBag.java 1686855 2015-06-22 13:00:27Z tn $ */ public final class UnmodifiableBag extends AbstractBagDecorator implements Unmodifiable { @@ -61,7 +61,7 @@ final Bag tmpBag = (Bag) bag; return tmpBag; } - return new UnmodifiableBag(bag); + return new UnmodifiableBag<>(bag); } //----------------------------------------------------------------------- @@ -81,7 +81,7 @@ * Write the collection out using a custom routine. * * @param out the output stream - * @throws IOException + * @throws IOException if an error occurs while writing to the stream */ private void writeObject(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); @@ -92,8 +92,8 @@ * Read the collection in using a custom routine. * * @param in the input stream - * @throws IOException - * @throws ClassNotFoundException + * @throws IOException if an error occurs while reading from the stream + * @throws ClassNotFoundException if an object read from the stream can not be loaded * @throws ClassCastException if deserialised object has wrong type */ @SuppressWarnings("unchecked") // will throw CCE, see Javadoc diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/UnmodifiableSortedBag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/UnmodifiableSortedBag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bag/UnmodifiableSortedBag.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bag/UnmodifiableSortedBag.java 2018-07-08 00:18:18.000000000 +0000 @@ -35,8 +35,8 @@ *

    * Attempts to modify it will result in an UnsupportedOperationException. * + * @param the type of elements in this bag * @since 3.0 - * @version $Id: UnmodifiableSortedBag.java 1686855 2015-06-22 13:00:27Z tn $ */ public final class UnmodifiableSortedBag extends AbstractSortedBagDecorator implements Unmodifiable { @@ -59,7 +59,7 @@ if (bag instanceof Unmodifiable) { return bag; } - return new UnmodifiableSortedBag(bag); + return new UnmodifiableSortedBag<>(bag); } //----------------------------------------------------------------------- @@ -78,7 +78,7 @@ * Write the collection out using a custom routine. * * @param out the output stream - * @throws IOException + * @throws IOException if an error occurs while writing to the stream */ private void writeObject(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); @@ -89,8 +89,8 @@ * Read the collection in using a custom routine. * * @param in the input stream - * @throws IOException - * @throws ClassNotFoundException + * @throws IOException if an error occurs while reading from the stream + * @throws ClassNotFoundException if an object read from the stream can not be loaded * @throws ClassCastException if deserialised object has wrong type */ @SuppressWarnings("unchecked") // will throw CCE, see Javadoc diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/Bag.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/Bag.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/Bag.java 2013-04-30 18:55:24.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/Bag.java 2018-07-08 00:18:18.000000000 +0000 @@ -38,9 +38,8 @@ * In an ideal world, the interface would be changed to fix the problems, however * it has been decided to maintain backwards compatibility instead. * - * @param the type held in the bag + * @param the type of elements in this bag * @since 2.0 - * @version $Id: Bag.java 1477779 2013-04-30 18:55:24Z tn $ */ public interface Bag extends Collection { @@ -70,6 +69,7 @@ * @param object the object to add * @return true if the object was not already in the uniqueSet */ + @Override boolean add(E object); /** @@ -98,6 +98,7 @@ * @param object the object to remove * @return true if this call changed the collection */ + @Override boolean remove(Object object); /** @@ -126,6 +127,7 @@ * * @return the total size of the Bag */ + @Override int size(); /** @@ -144,6 +146,7 @@ * @param coll the collection to check against * @return true if the Bag contains all the collection */ + @Override boolean containsAll(Collection coll); /** @@ -162,6 +165,7 @@ * @param coll the collection to remove * @return true if this call changed the collection */ + @Override boolean removeAll(Collection coll); /** @@ -183,6 +187,7 @@ * @param coll the collection to retain * @return true if this call changed the collection */ + @Override boolean retainAll(Collection coll); /** @@ -192,6 +197,7 @@ * * @return iterator over all elements in the Bag */ + @Override Iterator iterator(); // The following is not part of the formal Bag interface, however where possible diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/BagUtils.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/BagUtils.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/BagUtils.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/BagUtils.java 2018-07-08 00:18:18.000000000 +0000 @@ -32,7 +32,6 @@ * Provides utility methods and decorators for {@link Bag} and {@link SortedBag} instances. * * @since 2.1 - * @version $Id: BagUtils.java 1686855 2015-06-22 13:00:27Z tn $ */ public class BagUtils { @@ -40,14 +39,14 @@ * An empty unmodifiable bag. */ @SuppressWarnings("rawtypes") // OK, empty bag is compatible with any type - public static final Bag EMPTY_BAG = UnmodifiableBag.unmodifiableBag(new HashBag()); + public static final Bag EMPTY_BAG = UnmodifiableBag.unmodifiableBag(new HashBag<>()); /** * An empty unmodifiable sorted bag. */ @SuppressWarnings("rawtypes") // OK, empty bag is compatible with any type public static final Bag EMPTY_SORTED_BAG = - UnmodifiableSortedBag.unmodifiableSortedBag(new TreeBag()); + UnmodifiableSortedBag.unmodifiableSortedBag(new TreeBag<>()); /** * Instantiation of BagUtils is not intended or required. @@ -246,7 +245,7 @@ */ @SuppressWarnings("unchecked") // OK, empty bag is compatible with any type public static Bag emptyBag() { - return (Bag) EMPTY_BAG; + return EMPTY_BAG; } /** diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/AbstractBidiMapDecorator.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/AbstractBidiMapDecorator.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/AbstractBidiMapDecorator.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/AbstractBidiMapDecorator.java 2018-07-08 00:18:18.000000000 +0000 @@ -34,8 +34,9 @@ * it would provide a loophole around the validation. * But, you might want that loophole, so this class is kept simple. * + * @param the type of the keys in this map + * @param the type of the values in this map * @since 3.0 - * @version $Id: AbstractBidiMapDecorator.java 1686855 2015-06-22 13:00:27Z tn $ */ public abstract class AbstractBidiMapDecorator extends AbstractMapDecorator implements BidiMap { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java 2015-06-06 20:19:03.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/AbstractDualBidiMap.java 2018-07-08 00:18:18.000000000 +0000 @@ -34,10 +34,12 @@ * An implementation can be written simply by implementing the * {@link #createBidiMap(Map, Map, BidiMap)} method. * + * @param the type of the keys in the map + * @param the type of the values in the map + * * @see DualHashBidiMap * @see DualTreeBidiMap * @since 3.0 - * @version $Id: AbstractDualBidiMap.java 1683951 2015-06-06 20:19:03Z tn $ */ public abstract class AbstractDualBidiMap implements BidiMap { @@ -225,7 +227,7 @@ */ @Override public MapIterator mapIterator() { - return new BidiMapIterator(this); + return new BidiMapIterator<>(this); } @Override @@ -263,7 +265,7 @@ @Override public Set keySet() { if (keySet == null) { - keySet = new KeySet(this); + keySet = new KeySet<>(this); } return keySet; } @@ -276,7 +278,7 @@ * @return the keySet iterator */ protected Iterator createKeySetIterator(final Iterator iterator) { - return new KeySetIterator(iterator, this); + return new KeySetIterator<>(iterator, this); } /** @@ -289,7 +291,7 @@ @Override public Set values() { if (values == null) { - values = new Values(this); + values = new Values<>(this); } return values; } @@ -302,7 +304,7 @@ * @return the values iterator */ protected Iterator createValuesIterator(final Iterator iterator) { - return new ValuesIterator(iterator, this); + return new ValuesIterator<>(iterator, this); } /** @@ -319,7 +321,7 @@ @Override public Set> entrySet() { if (entrySet == null) { - entrySet = new EntrySet(this); + entrySet = new EntrySet<>(this); } return entrySet; } @@ -332,7 +334,7 @@ * @return the entrySet iterator */ protected Iterator> createEntrySetIterator(final Iterator> iterator) { - return new EntrySetIterator(iterator, this); + return new EntrySetIterator<>(iterator, this); } //----------------------------------------------------------------------- @@ -652,7 +654,7 @@ @Override public Map.Entry next() { - last = new MapEntry(super.next(), parent); + last = new MapEntry<>(super.next(), parent); canRemove = true; return last; } diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/AbstractOrderedBidiMapDecorator.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/AbstractOrderedBidiMapDecorator.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/AbstractOrderedBidiMapDecorator.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/AbstractOrderedBidiMapDecorator.java 2018-07-08 00:18:18.000000000 +0000 @@ -31,8 +31,9 @@ * it would provide a loophole around the validation. * But, you might want that loophole, so this class is kept simple. * + * @param the type of the keys in this map + * @param the type of the values in this map * @since 3.0 - * @version $Id: AbstractOrderedBidiMapDecorator.java 1686855 2015-06-22 13:00:27Z tn $ */ public abstract class AbstractOrderedBidiMapDecorator extends AbstractBidiMapDecorator diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/AbstractSortedBidiMapDecorator.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/AbstractSortedBidiMapDecorator.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/AbstractSortedBidiMapDecorator.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/AbstractSortedBidiMapDecorator.java 2018-07-08 00:18:18.000000000 +0000 @@ -33,8 +33,9 @@ * it would provide a loophole around the validation. * But, you might want that loophole, so this class is kept simple. * + * @param the type of the keys in this map + * @param the type of the values in this map * @since 3.0 - * @version $Id: AbstractSortedBidiMapDecorator.java 1686855 2015-06-22 13:00:27Z tn $ */ public abstract class AbstractSortedBidiMapDecorator extends AbstractOrderedBidiMapDecorator implements SortedBidiMap { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/DualHashBidiMap.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/DualHashBidiMap.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/DualHashBidiMap.java 2013-10-20 21:12:51.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/DualHashBidiMap.java 2018-07-08 00:18:18.000000000 +0000 @@ -36,8 +36,10 @@ * NOTE: From Commons Collections 3.1, all subclasses will use {@link HashMap} * and the flawed createMap method is ignored. * + * @param the type of the keys in the map + * @param the type of the values in the map + * * @since 3.0 - * @version $Id: DualHashBidiMap.java 1533984 2013-10-20 21:12:51Z tn $ */ public class DualHashBidiMap extends AbstractDualBidiMap implements Serializable { @@ -85,7 +87,7 @@ @Override protected BidiMap createBidiMap(final Map normalMap, final Map reverseMap, final BidiMap inverseBidiMap) { - return new DualHashBidiMap(normalMap, reverseMap, inverseBidiMap); + return new DualHashBidiMap<>(normalMap, reverseMap, inverseBidiMap); } // Serialization @@ -97,8 +99,8 @@ private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); - normalMap = new HashMap(); - reverseMap = new HashMap(); + normalMap = new HashMap<>(); + reverseMap = new HashMap<>(); @SuppressWarnings("unchecked") // will fail at runtime if stream is incorrect final Map map = (Map) in.readObject(); putAll(map); diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/DualLinkedHashBidiMap.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/DualLinkedHashBidiMap.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/DualLinkedHashBidiMap.java 2013-10-20 21:12:51.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/DualLinkedHashBidiMap.java 2018-07-08 00:18:18.000000000 +0000 @@ -31,7 +31,9 @@ * Two LinkedHashMap instances are used in this class. * This provides fast lookups at the expense of storing two sets of map entries and two linked lists. * - * @version $Id: DualLinkedHashBidiMap.java 1533984 2013-10-20 21:12:51Z tn $ + * @param the type of the keys in the map + * @param the type of the values in the map + * * @since 4.0 */ public class DualLinkedHashBidiMap extends AbstractDualBidiMap implements Serializable { @@ -80,7 +82,7 @@ @Override protected BidiMap createBidiMap(final Map normalMap, final Map reverseMap, final BidiMap inverseBidiMap) { - return new DualLinkedHashBidiMap(normalMap, reverseMap, inverseBidiMap); + return new DualLinkedHashBidiMap<>(normalMap, reverseMap, inverseBidiMap); } // Serialization @@ -92,8 +94,8 @@ private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); - normalMap = new LinkedHashMap(); - reverseMap = new LinkedHashMap(); + normalMap = new LinkedHashMap<>(); + reverseMap = new LinkedHashMap<>(); @SuppressWarnings("unchecked") // will fail at runtime if stream is incorrect final Map map = (Map) in.readObject(); putAll(map); diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java 2015-06-06 20:19:03.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java 2018-07-08 00:18:18.000000000 +0000 @@ -49,8 +49,9 @@ * NOTE: From Commons Collections 3.1, all subclasses will use {@link TreeMap} * and the flawed createMap method is ignored. * + * @param the type of the keys in this map + * @param the type of the values in this map * @since 3.0 - * @version $Id: DualTreeBidiMap.java 1683951 2015-06-06 20:19:03Z tn $ */ public class DualTreeBidiMap extends AbstractDualBidiMap implements SortedBidiMap, Serializable { @@ -123,7 +124,7 @@ @Override protected DualTreeBidiMap createBidiMap(final Map normalMap, final Map reverseMap, final BidiMap inverseMap) { - return new DualTreeBidiMap(normalMap, reverseMap, inverseMap); + return new DualTreeBidiMap<>(normalMap, reverseMap, inverseMap); } //----------------------------------------------------------------------- @@ -192,7 +193,7 @@ */ @Override public OrderedMapIterator mapIterator() { - return new BidiOrderedMapIterator(this); + return new BidiOrderedMapIterator<>(this); } public SortedBidiMap inverseSortedBidiMap() { @@ -208,19 +209,19 @@ @Override public SortedMap headMap(final K toKey) { final SortedMap sub = ((SortedMap) normalMap).headMap(toKey); - return new ViewMap(this, sub); + return new ViewMap<>(this, sub); } @Override public SortedMap tailMap(final K fromKey) { final SortedMap sub = ((SortedMap) normalMap).tailMap(fromKey); - return new ViewMap(this, sub); + return new ViewMap<>(this, sub); } @Override public SortedMap subMap(final K fromKey, final K toKey) { final SortedMap sub = ((SortedMap) normalMap).subMap(fromKey, toKey); - return new ViewMap(this, sub); + return new ViewMap<>(this, sub); } @Override @@ -242,7 +243,7 @@ // the implementation is not great here... // use the normalMap as the filtered map, but reverseMap as the full map // this forces containsValue and clear to be overridden - super(new DualTreeBidiMap(sm, bidi.reverseMap, bidi.inverseBidiMap)); + super(new DualTreeBidiMap<>(sm, bidi.reverseMap, bidi.inverseBidiMap)); } @Override @@ -262,17 +263,17 @@ @Override public SortedMap headMap(final K toKey) { - return new ViewMap(decorated(), super.headMap(toKey)); + return new ViewMap<>(decorated(), super.headMap(toKey)); } @Override public SortedMap tailMap(final K fromKey) { - return new ViewMap(decorated(), super.tailMap(fromKey)); + return new ViewMap<>(decorated(), super.tailMap(fromKey)); } @Override public SortedMap subMap(final K fromKey, final K toKey) { - return new ViewMap(decorated(), super.subMap(fromKey, toKey)); + return new ViewMap<>(decorated(), super.subMap(fromKey, toKey)); } @Override @@ -313,7 +314,7 @@ protected BidiOrderedMapIterator(final AbstractDualBidiMap parent) { super(); this.parent = parent; - iterator = new ArrayList>(parent.entrySet()).listIterator(); + iterator = new ArrayList<>(parent.entrySet()).listIterator(); } @Override @@ -384,7 +385,7 @@ @Override public void reset() { - iterator = new ArrayList>(parent.entrySet()).listIterator(); + iterator = new ArrayList<>(parent.entrySet()).listIterator(); last = null; } @@ -406,8 +407,8 @@ private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); - normalMap = new TreeMap(comparator); - reverseMap = new TreeMap(valueComparator); + normalMap = new TreeMap<>(comparator); + reverseMap = new TreeMap<>(valueComparator); @SuppressWarnings("unchecked") // will fail at runtime if the stream is incorrect final Map map = (Map) in.readObject(); putAll(map); diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/package-info.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/package-info.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/package-info.java 2013-04-30 18:08:32.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/package-info.java 2018-07-08 00:18:18.000000000 +0000 @@ -36,6 +36,5 @@ *
  • Unmodifiable - ensures the map cannot be altered * * - * @version $Id: package-info.java 1477745 2013-04-30 18:08:32Z tn $ */ package org.apache.commons.collections4.bidimap; diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java 2015-06-06 20:19:03.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java 2018-07-08 00:18:18.000000000 +0000 @@ -72,13 +72,15 @@ * not allow setValue() and will throw an * UnsupportedOperationException on attempts to call that method. * + * @param the type of the keys in this map + * @param the type of the values in this map + * * @since 3.0 (previously DoubleOrderedMap v2.0) - * @version $Id: TreeBidiMap.java 1683951 2015-06-06 20:19:03Z tn $ */ public class TreeBidiMap, V extends Comparable> implements OrderedBidiMap, Serializable { - static enum DataElement { + enum DataElement { KEY("key"), VALUE("value"); private final String description; @@ -509,7 +511,7 @@ Node node = rootNode[KEY.ordinal()]; if (node == null) { // map is empty - final Node root = new Node(key, value); + final Node root = new Node<>(key, value); rootNode[KEY.ordinal()] = root; rootNode[VALUE.ordinal()] = root; grow(); @@ -526,7 +528,7 @@ if (node.getLeft(KEY) != null) { node = node.getLeft(KEY); } else { - final Node newNode = new Node(key, value); + final Node newNode = new Node<>(key, value); insertValue(newNode); node.setLeft(newNode, KEY); @@ -540,7 +542,7 @@ if (node.getRight(KEY) != null) { node = node.getRight(KEY); } else { - final Node newNode = new Node(key, value); + final Node newNode = new Node<>(key, value); insertValue(newNode); node.setRight(newNode, KEY); @@ -577,7 +579,8 @@ * do the actual lookup of a piece of data * * @param data the key or value to be looked up - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. * @return the desired Node, or null if there is no mapping of the * specified data */ @@ -591,9 +594,8 @@ if (cmp == 0) { rval = node; break; - } else { - node = cmp < 0 ? node.getLeft(dataElement) : node.getRight(dataElement); } + node = cmp < 0 ? node.getLeft(dataElement) : node.getRight(dataElement); } return rval; @@ -611,7 +613,8 @@ * get the next larger node from the specified node * * @param node the node to be searched from - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. * @return the specified node */ private Node nextGreater(final Node node, final DataElement dataElement) { @@ -645,7 +648,8 @@ * get the next larger node from the specified node * * @param node the node to be searched from - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. * @return the specified node */ private Node nextSmaller(final Node node, final DataElement dataElement) { @@ -694,7 +698,8 @@ * Find the least node from a given node. * * @param node the node from which we will start searching - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. * @return the smallest node, from the specified node, in the * specified mapping */ @@ -712,7 +717,8 @@ * Find the greatest node from a given node. * * @param node the node from which we will start searching - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. * @return the greatest node, from the specified node */ private Node greatestNode(final Node node, final DataElement dataElement) { @@ -731,7 +737,8 @@ * * @param from the node whose color we're copying; may be null * @param to the node whose color we're changing; may be null - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private void copyColor(final Node from, final Node to, final DataElement dataElement) { if (to != null) { @@ -749,7 +756,8 @@ * black, thank you * * @param node the node (may be null) in question - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private static boolean isRed(final Node node, final DataElement dataElement) { return node != null && node.isRed(dataElement); @@ -760,7 +768,8 @@ * it's black, thank you * * @param node the node (may be null) in question - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private static boolean isBlack(final Node node, final DataElement dataElement) { return node == null || node.isBlack(dataElement); @@ -770,7 +779,8 @@ * force a node (if it exists) red * * @param node the node (may be null) in question - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private static void makeRed(final Node node, final DataElement dataElement) { if (node != null) { @@ -782,7 +792,8 @@ * force a node (if it exists) black * * @param node the node (may be null) in question - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private static void makeBlack(final Node node, final DataElement dataElement) { if (node != null) { @@ -795,7 +806,8 @@ * its grandparent may not exist. no problem * * @param node the node (may be null) in question - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private Node getGrandParent(final Node node, final DataElement dataElement) { return getParent(getParent(node, dataElement), dataElement); @@ -806,7 +818,8 @@ * exist. no problem * * @param node the node (may be null) in question - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private Node getParent(final Node node, final DataElement dataElement) { return node == null ? null : node.getParent(dataElement); @@ -817,7 +830,8 @@ * problem * * @param node the node (may be null) in question - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private Node getRightChild(final Node node, final DataElement dataElement) { return node == null ? null : node.getRight(dataElement); @@ -828,7 +842,8 @@ * problem * * @param node the node (may be null) in question - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private Node getLeftChild(final Node node, final DataElement dataElement) { return node == null ? null : node.getLeft(dataElement); @@ -838,7 +853,8 @@ * do a rotate left. standard fare in the world of balanced trees * * @param node the node to be rotated - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private void rotateLeft(final Node node, final DataElement dataElement) { final Node rightChild = node.getRight(dataElement); @@ -866,7 +882,8 @@ * do a rotate right. standard fare in the world of balanced trees * * @param node the node to be rotated - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private void rotateRight(final Node node, final DataElement dataElement) { final Node leftChild = node.getLeft(dataElement); @@ -1211,8 +1228,8 @@ * Comparable and non-null * * @param o the object being checked - * @param index the KEY or VALUE int (used to put the right word in the - * exception message) + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. * * @throws NullPointerException if o is null * @throws ClassCastException if o is not Comparable @@ -1336,7 +1353,8 @@ * Compares for equals as per the API. * * @param obj the object to compare to - * @param type the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. * @return true if equal */ private boolean doEquals(final Object obj, final DataElement dataElement) { @@ -1372,7 +1390,8 @@ /** * Gets the hash code value for this map as per the API. * - * @param type the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. * @return the hash code value for this map */ private int doHashCode(final DataElement dataElement) { @@ -1390,7 +1409,8 @@ /** * Gets the string form of this map as per AbstractMap. * - * @param type the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. * @return the string form of this map */ private String doToString(final DataElement dataElement) { @@ -1431,21 +1451,28 @@ /** * Reads the content of the stream. + * + * @param stream the input stream + * @throws IOException if an error occurs while reading from the stream + * @throws ClassNotFoundException if an object read from the stream can not be loaded */ @SuppressWarnings("unchecked") // This will fail at runtime if the stream is incorrect private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException{ stream.defaultReadObject(); rootNode = new Node[2]; - int size = stream.readInt(); + final int size = stream.readInt(); for(int i = 0; i < size; i++){ - K k =(K) stream.readObject(); - V v =(V) stream.readObject(); + final K k =(K) stream.readObject(); + final V v =(V) stream.readObject(); put(k, v); } } /** * Writes the content to the stream for serialization. + * + * @param stream the output stream + * @throws IOException if an error occurs while writing to the stream */ private void writeObject(final ObjectOutputStream stream) throws IOException{ stream.defaultWriteObject(); @@ -1468,7 +1495,6 @@ /** * Constructor. * @param orderType the KEY or VALUE int for the order - * @param main the main map */ View(final DataElement orderType) { super(); @@ -1642,7 +1668,6 @@ /** * Constructor. * @param orderType the KEY or VALUE int for the order - * @param main the main map */ ViewIterator(final DataElement orderType) { super(); @@ -1847,7 +1872,7 @@ } private Map.Entry createEntry(final Node node) { - return new UnmodifiableMapEntry(node.getValue(), node.getKey()); + return new UnmodifiableMapEntry<>(node.getValue(), node.getKey()); } } @@ -1871,8 +1896,8 @@ * Make a new cell with given key and value, and with null * links, and black (true) colors. * - * @param key - * @param value + * @param key the key of this node + * @param value the value of this node */ @SuppressWarnings("unchecked") Node(final K key, final V value) { @@ -1917,7 +1942,8 @@ * Set this node's parent node. * * @param node the new parent node - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private void setParent(final Node node, final DataElement dataElement) { parentNode[dataElement.ordinal()] = node; @@ -1926,7 +1952,8 @@ /** * Get the parent node. * - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. * @return the parent node, may be null */ private Node getParent(final DataElement dataElement) { @@ -1937,7 +1964,8 @@ * Exchange colors with another node. * * @param node the node to swap with - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private void swapColors(final Node node, final DataElement dataElement) { // Swap colors -- old hacker's trick @@ -1949,7 +1977,8 @@ /** * Is this node black? * - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. * @return true if black (which is represented as a true boolean) */ private boolean isBlack(final DataElement dataElement) { @@ -1959,7 +1988,8 @@ /** * Is this node red? * - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. * @return true if non-black */ private boolean isRed(final DataElement dataElement) { @@ -1969,7 +1999,8 @@ /** * Make this node black. * - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private void setBlack(final DataElement dataElement) { blackColor[dataElement.ordinal()] = true; @@ -1978,7 +2009,8 @@ /** * Make this node red. * - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private void setRed(final DataElement dataElement) { blackColor[dataElement.ordinal()] = false; @@ -1988,7 +2020,8 @@ * Make this node the same color as another * * @param node the node whose color we're adopting - * @param index the KEY or VALUE int + * @param dataElement either {@link DataElement#KEY} key} + * or the {@link DataElement#VALUE value}. */ private void copyColor(final Node node, final DataElement dataElement) { blackColor[dataElement.ordinal()] = node.blackColor[dataElement.ordinal()]; @@ -2028,7 +2061,7 @@ /** * Optional operation that is not permitted in this implementation * - * @param ignored + * @param ignored this parameter is ignored. * @return does not return * @throws UnsupportedOperationException always */ diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableBidiMap.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableBidiMap.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableBidiMap.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableBidiMap.java 2018-07-08 00:18:18.000000000 +0000 @@ -31,8 +31,9 @@ *

    * Attempts to modify it will result in an UnsupportedOperationException. * + * @param the type of the keys in this map + * @param the type of the values in this map * @since 3.0 - * @version $Id: UnmodifiableBidiMap.java 1686855 2015-06-22 13:00:27Z tn $ */ public final class UnmodifiableBidiMap extends AbstractBidiMapDecorator implements Unmodifiable { @@ -58,7 +59,7 @@ final BidiMap tmpMap = (BidiMap) map; return tmpMap; } - return new UnmodifiableBidiMap(map); + return new UnmodifiableBidiMap<>(map); } //----------------------------------------------------------------------- @@ -127,7 +128,7 @@ @Override public synchronized BidiMap inverseBidiMap() { if (inverse == null) { - inverse = new UnmodifiableBidiMap(decorated().inverseBidiMap()); + inverse = new UnmodifiableBidiMap<>(decorated().inverseBidiMap()); inverse.inverse = this; } return inverse; diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableOrderedBidiMap.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableOrderedBidiMap.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableOrderedBidiMap.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableOrderedBidiMap.java 2018-07-08 00:18:18.000000000 +0000 @@ -31,8 +31,9 @@ *

    * Attempts to modify it will result in an UnsupportedOperationException. * + * @param the type of the keys in this map + * @param the type of the values in this map * @since 3.0 - * @version $Id: UnmodifiableOrderedBidiMap.java 1686855 2015-06-22 13:00:27Z tn $ */ public final class UnmodifiableOrderedBidiMap extends AbstractOrderedBidiMapDecorator implements Unmodifiable { @@ -59,7 +60,7 @@ final OrderedBidiMap tmpMap = (OrderedBidiMap) map; return tmpMap; } - return new UnmodifiableOrderedBidiMap(map); + return new UnmodifiableOrderedBidiMap<>(map); } //----------------------------------------------------------------------- @@ -138,7 +139,7 @@ */ public OrderedBidiMap inverseOrderedBidiMap() { if (inverse == null) { - inverse = new UnmodifiableOrderedBidiMap(decorated().inverseBidiMap()); + inverse = new UnmodifiableOrderedBidiMap<>(decorated().inverseBidiMap()); inverse.inverse = this; } return inverse; diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableSortedBidiMap.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableSortedBidiMap.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableSortedBidiMap.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableSortedBidiMap.java 2018-07-08 00:18:18.000000000 +0000 @@ -33,8 +33,9 @@ *

    * Attempts to modify it will result in an {@link UnsupportedOperationException}. * + * @param the type of the keys in this map + * @param the type of the values in this map * @since 3.0 - * @version $Id: UnmodifiableSortedBidiMap.java 1686855 2015-06-22 13:00:27Z tn $ */ public final class UnmodifiableSortedBidiMap extends AbstractSortedBidiMapDecorator implements Unmodifiable { @@ -60,7 +61,7 @@ final SortedBidiMap tmpMap = (SortedBidiMap) map; return tmpMap; } - return new UnmodifiableSortedBidiMap(map); + return new UnmodifiableSortedBidiMap<>(map); } //----------------------------------------------------------------------- @@ -131,7 +132,7 @@ @Override public SortedBidiMap inverseBidiMap() { if (inverse == null) { - inverse = new UnmodifiableSortedBidiMap(decorated().inverseBidiMap()); + inverse = new UnmodifiableSortedBidiMap<>(decorated().inverseBidiMap()); inverse.inverse = this; } return inverse; diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/BidiMap.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/BidiMap.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/BidiMap.java 2014-07-20 04:51:05.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/BidiMap.java 2018-07-08 00:18:18.000000000 +0000 @@ -39,7 +39,6 @@ * @param the type of the values in the map * * @since 3.0 - * @version $Id: BidiMap.java 1612021 2014-07-20 04:51:05Z ggregory $ */ public interface BidiMap extends IterableMap { @@ -71,6 +70,7 @@ * @throws NullPointerException (optional) if the map limits the values to * non-null and null was specified */ + @Override V put(K key, V value); /** @@ -140,5 +140,6 @@ * * @return a set view of the values contained in this map */ + @Override Set values(); } diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/BoundedCollection.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/BoundedCollection.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/BoundedCollection.java 2013-04-30 18:55:24.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/BoundedCollection.java 2018-07-08 00:18:18.000000000 +0000 @@ -28,8 +28,8 @@ * @see CollectionUtils#isFull * @see CollectionUtils#maxSize * + * @param the type of elements in this collection * @since 3.0 - * @version $Id: BoundedCollection.java 1477779 2013-04-30 18:55:24Z tn $ */ public interface BoundedCollection extends Collection { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/BoundedMap.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/BoundedMap.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/BoundedMap.java 2013-04-30 18:55:24.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/BoundedMap.java 2018-07-08 00:18:18.000000000 +0000 @@ -23,8 +23,9 @@ * maximum number of elements. This interface allows the querying of details * associated with the maximum number of elements. * + * @param the type of the keys in this map + * @param the type of the values in this map * @since 3.0 - * @version $Id: BoundedMap.java 1477779 2013-04-30 18:55:24Z tn $ */ public interface BoundedMap extends IterableMap { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/Closure.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/Closure.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/Closure.java 2013-11-19 00:47:34.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/Closure.java 2018-07-08 00:18:18.000000000 +0000 @@ -27,7 +27,6 @@ * * @param the type that the closure acts on * @since 1.0 - * @version $Id: Closure.java 1543261 2013-11-19 00:47:34Z ggregory $ */ public interface Closure { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/ClosureUtils.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/ClosureUtils.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/ClosureUtils.java 2015-11-14 20:38:02.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/ClosureUtils.java 2018-07-08 00:18:18.000000000 +0000 @@ -46,7 +46,7 @@ *

  • Exception - always throws an exception * *

    - * Since v4.1 only closures which are considered to be unsafe are + * Since v4.1 only closures which are considered to be safe are * Serializable. Closures considered to be unsafe for serialization are: *

      *
    • Invoker @@ -55,7 +55,6 @@ *
    * * @since 3.0 - * @version $Id: ClosureUtils.java 1714362 2015-11-14 20:38:02Z tn $ */ public class ClosureUtils { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/AbstractCollectionDecorator.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/AbstractCollectionDecorator.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/AbstractCollectionDecorator.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/AbstractCollectionDecorator.java 2018-07-08 00:18:18.000000000 +0000 @@ -50,7 +50,6 @@ * * @param the type of the elements in the collection * @since 3.0 - * @version $Id: AbstractCollectionDecorator.java 1686855 2015-06-22 13:00:27Z tn $ */ public abstract class AbstractCollectionDecorator implements Collection, Serializable { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/CompositeCollection.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/CompositeCollection.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/CompositeCollection.java 2015-06-06 20:19:03.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/CompositeCollection.java 2018-07-08 00:18:18.000000000 +0000 @@ -37,7 +37,6 @@ * * @param the type of the elements in the collection * @since 3.0 - * @version $Id: CompositeCollection.java 1683951 2015-06-06 20:19:03Z tn $ */ public class CompositeCollection implements Collection, Serializable { @@ -48,7 +47,7 @@ private CollectionMutator mutator; /** Collections in the composite */ - private final List> all = new ArrayList>(); + private final List> all = new ArrayList<>(); /** * Create an empty CompositeCollection. @@ -156,7 +155,7 @@ if (all.isEmpty()) { return EmptyIterator.emptyIterator(); } - final IteratorChain chain = new IteratorChain(); + final IteratorChain chain = new IteratorChain<>(); for (final Collection item : all) { chain.addIterator(item.iterator()); } @@ -401,7 +400,7 @@ * The new collection is not backed by this composite. */ public Collection toCollection() { - return new ArrayList(this); + return new ArrayList<>(this); } /** @@ -415,7 +414,7 @@ /** * Get the collection mutator to be used for this CompositeCollection. - * @return CollectionMutator + * @return CollectionMutator<E> */ protected CollectionMutator getMutator() { return mutator; diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/IndexedCollection.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/IndexedCollection.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/IndexedCollection.java 2015-06-01 22:41:31.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/IndexedCollection.java 2018-07-08 00:18:18.000000000 +0000 @@ -39,7 +39,6 @@ * @param the type of object in the collection. * * @since 4.0 - * @version $Id: IndexedCollection.java 1683018 2015-06-01 22:41:31Z tn $ */ public class IndexedCollection extends AbstractCollectionDecorator { @@ -71,7 +70,7 @@ */ public static IndexedCollection uniqueIndexedCollection(final Collection coll, final Transformer keyTransformer) { - return new IndexedCollection(coll, keyTransformer, + return new IndexedCollection<>(coll, keyTransformer, MultiValueMap.multiValueMap(new HashMap>()), true); } @@ -87,7 +86,7 @@ */ public static IndexedCollection nonUniqueIndexedCollection(final Collection coll, final Transformer keyTransformer) { - return new IndexedCollection(coll, keyTransformer, + return new IndexedCollection<>(coll, keyTransformer, MultiValueMap.multiValueMap(new HashMap>()), false); } diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/package-info.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/package-info.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/package-info.java 2013-04-30 18:11:20.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/package-info.java 2018-07-08 00:18:18.000000000 +0000 @@ -31,6 +31,5 @@ *
  • Indexed - provides a map-like view onto another collection * * - * @version $Id: package-info.java 1477746 2013-04-30 18:11:20Z tn $ */ package org.apache.commons.collections4.collection; diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java 2015-11-15 18:20:41.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java 2018-07-08 00:18:18.000000000 +0000 @@ -54,7 +54,6 @@ * * @param the type of the elements in the collection * @since 3.0 - * @version $Id: PredicatedCollection.java 1714484 2015-11-15 18:20:41Z tn $ */ public class PredicatedCollection extends AbstractCollectionDecorator { @@ -73,7 +72,7 @@ * @since 4.1 */ public static Builder builder(final Predicate predicate) { - return new Builder(predicate); + return new Builder<>(predicate); } /** @@ -84,7 +83,7 @@ * @since 4.1 */ public static Builder notNullBuilder() { - return new Builder(NotNullPredicate.notNullPredicate()); + return new Builder<>(NotNullPredicate.notNullPredicate()); } /** @@ -103,7 +102,7 @@ */ public static PredicatedCollection predicatedCollection(final Collection coll, final Predicate predicate) { - return new PredicatedCollection(coll, predicate); + return new PredicatedCollection<>(coll, predicate); } //----------------------------------------------------------------------- @@ -209,10 +208,10 @@ private final Predicate predicate; /** The buffer containing valid elements. */ - private final List accepted = new ArrayList(); + private final List accepted = new ArrayList<>(); /** The buffer containing rejected elements. */ - private final List rejected = new ArrayList(); + private final List rejected = new ArrayList<>(); // ----------------------------------------------------------------------- /** @@ -257,7 +256,7 @@ */ public Builder addAll(final Collection items) { if (items != null) { - for (E item : items) { + for (final E item : items) { add(item); } } diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/SynchronizedCollection.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/SynchronizedCollection.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/SynchronizedCollection.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/SynchronizedCollection.java 2018-07-08 00:18:18.000000000 +0000 @@ -36,7 +36,6 @@ * * @param the type of the elements in the collection * @since 3.0 - * @version $Id: SynchronizedCollection.java 1686855 2015-06-22 13:00:27Z tn $ */ public class SynchronizedCollection implements Collection, Serializable { @@ -58,7 +57,7 @@ * @since 4.0 */ public static SynchronizedCollection synchronizedCollection(final Collection coll) { - return new SynchronizedCollection(coll); + return new SynchronizedCollection<>(coll); } //----------------------------------------------------------------------- diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/TransformedCollection.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/TransformedCollection.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/TransformedCollection.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/TransformedCollection.java 2018-07-08 00:18:18.000000000 +0000 @@ -34,7 +34,6 @@ * * @param the type of the elements in the collection * @since 3.0 - * @version $Id: TransformedCollection.java 1686855 2015-06-22 13:00:27Z tn $ */ public class TransformedCollection extends AbstractCollectionDecorator { @@ -60,7 +59,7 @@ */ public static TransformedCollection transformingCollection(final Collection coll, final Transformer transformer) { - return new TransformedCollection(coll, transformer); + return new TransformedCollection<>(coll, transformer); } /** @@ -81,7 +80,7 @@ public static TransformedCollection transformedCollection(final Collection collection, final Transformer transformer) { - final TransformedCollection decorated = new TransformedCollection(collection, transformer); + final TransformedCollection decorated = new TransformedCollection<>(collection, transformer); // null collection & transformer are disallowed by the constructor call above if (collection.size() > 0) { @SuppressWarnings("unchecked") // collection is of type E @@ -134,7 +133,7 @@ * @return a transformed object */ protected Collection transform(final Collection coll) { - final List list = new ArrayList(coll.size()); + final List list = new ArrayList<>(coll.size()); for (final E item : coll) { list.add(transform(item)); } diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/UnmodifiableBoundedCollection.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/UnmodifiableBoundedCollection.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/UnmodifiableBoundedCollection.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/UnmodifiableBoundedCollection.java 2018-07-08 00:18:18.000000000 +0000 @@ -37,8 +37,8 @@ *

    * Attempts to modify it will result in an UnsupportedOperationException. * + * @param the type of elements in this collection * @since 3.0 - * @version $Id: UnmodifiableBoundedCollection.java 1686855 2015-06-22 13:00:27Z tn $ */ public final class UnmodifiableBoundedCollection extends AbstractCollectionDecorator implements BoundedCollection, Unmodifiable { @@ -61,7 +61,7 @@ final BoundedCollection tmpColl = (BoundedCollection) coll; return tmpColl; } - return new UnmodifiableBoundedCollection(coll); + return new UnmodifiableBoundedCollection<>(coll); } /** @@ -98,7 +98,7 @@ if (coll instanceof BoundedCollection == false) { throw new IllegalArgumentException("Collection is not a bounded collection."); } - return new UnmodifiableBoundedCollection((BoundedCollection) coll); + return new UnmodifiableBoundedCollection<>((BoundedCollection) coll); } /** diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/UnmodifiableCollection.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/UnmodifiableCollection.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/collection/UnmodifiableCollection.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/collection/UnmodifiableCollection.java 2018-07-08 00:18:18.000000000 +0000 @@ -31,7 +31,6 @@ * * @param the type of the elements in the collection * @since 3.0 - * @version $Id: UnmodifiableCollection.java 1686855 2015-06-22 13:00:27Z tn $ */ public final class UnmodifiableCollection extends AbstractCollectionDecorator @@ -57,7 +56,7 @@ final Collection tmpColl = (Collection) coll; return tmpColl; } - return new UnmodifiableCollection(coll); + return new UnmodifiableCollection<>(coll); } //----------------------------------------------------------------------- diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/CollectionUtils.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/CollectionUtils.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/CollectionUtils.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/CollectionUtils.java 2018-07-08 00:18:18.000000000 +0000 @@ -19,12 +19,12 @@ import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.Comparator; import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedList; import java.util.List; import java.util.ListIterator; import java.util.Map; @@ -50,7 +50,6 @@ * NOTE: From 4.0, method parameters will take {@link Iterable} objects when possible. * * @since 1.0 - * @version $Id: CollectionUtils.java 1686855 2015-06-22 13:00:27Z tn $ */ public class CollectionUtils { @@ -112,7 +111,7 @@ return getFreq(obj, cardinalityB); } - private final int getFreq(final Object obj, final Map freqMap) { + private int getFreq(final Object obj, final Map freqMap) { final Integer count = freqMap.get(obj); if (count != null) { return count.intValue(); @@ -140,13 +139,14 @@ */ public SetOperationCardinalityHelper(final Iterable a, final Iterable b) { super(a, b); - elements = new HashSet(); + elements = new HashSet<>(); addAll(elements, a); addAll(elements, b); // the resulting list must contain at least each unique element, but may grow - newList = new ArrayList(elements.size()); + newList = new ArrayList<>(elements.size()); } + @Override public Iterator iterator() { return elements.iterator(); } @@ -179,8 +179,7 @@ * undesirable. This implementation only implements Collection. */ @SuppressWarnings("rawtypes") // we deliberately use the raw type here - public static final Collection EMPTY_COLLECTION = - UnmodifiableCollection.unmodifiableCollection(new ArrayList()); + public static final Collection EMPTY_COLLECTION = Collections.emptyList(); /** * CollectionUtils should not normally be instantiated. @@ -208,9 +207,8 @@ * @param collection the collection, possibly null * @return an empty collection if the argument is null */ - @SuppressWarnings("unchecked") // OK, empty collection is compatible with any type public static Collection emptyIfNull(final Collection collection) { - return collection == null ? EMPTY_COLLECTION : collection; + return collection == null ? CollectionUtils.emptyCollection() : collection; } /** @@ -229,7 +227,7 @@ * @see Collection#addAll */ public static Collection union(final Iterable a, final Iterable b) { - final SetOperationCardinalityHelper helper = new SetOperationCardinalityHelper(a, b); + final SetOperationCardinalityHelper helper = new SetOperationCardinalityHelper<>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.max(obj)); } @@ -253,7 +251,7 @@ * @see #containsAny */ public static Collection intersection(final Iterable a, final Iterable b) { - final SetOperationCardinalityHelper helper = new SetOperationCardinalityHelper(a, b); + final SetOperationCardinalityHelper helper = new SetOperationCardinalityHelper<>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.min(obj)); } @@ -266,8 +264,8 @@ *

    * The cardinality of each element e in the returned * {@link Collection} will be equal to - * max(cardinality(e,a),cardinality(e,b)) - min(cardinality(e,a), - * cardinality(e,b)). + * max(cardinality(e,a),cardinality(e,b)) - min(cardinality(e,a), + * cardinality(e,b)). *

    * This is equivalent to * {@code {@link #subtract subtract}({@link #union union(a,b)},{@link #intersection intersection(a,b)})} @@ -281,7 +279,7 @@ * @return the symmetric difference of the two collections */ public static Collection disjunction(final Iterable a, final Iterable b) { - final SetOperationCardinalityHelper helper = new SetOperationCardinalityHelper(a, b); + final SetOperationCardinalityHelper helper = new SetOperationCardinalityHelper<>(a, b); for (final O obj : helper) { helper.setCardinality(obj, helper.max(obj) - helper.min(obj)); } @@ -330,8 +328,8 @@ public static Collection subtract(final Iterable a, final Iterable b, final Predicate p) { - final ArrayList list = new ArrayList(); - final HashBag bag = new HashBag(); + final ArrayList list = new ArrayList<>(); + final HashBag bag = new HashBag<>(); for (final O element : b) { if (p.evaluate(element)) { bag.add(element); @@ -370,32 +368,59 @@ public static boolean containsAll(final Collection coll1, final Collection coll2) { if (coll2.isEmpty()) { return true; - } else { - final Iterator it = coll1.iterator(); - final Set elementsAlreadySeen = new HashSet(); - for (final Object nextElement : coll2) { - if (elementsAlreadySeen.contains(nextElement)) { - continue; - } + } + final Iterator it = coll1.iterator(); + final Set elementsAlreadySeen = new HashSet<>(); + for (final Object nextElement : coll2) { + if (elementsAlreadySeen.contains(nextElement)) { + continue; + } - boolean foundCurrentElement = false; - while (it.hasNext()) { - final Object p = it.next(); - elementsAlreadySeen.add(p); - if (nextElement == null ? p == null : nextElement.equals(p)) { - foundCurrentElement = true; - break; - } + boolean foundCurrentElement = false; + while (it.hasNext()) { + final Object p = it.next(); + elementsAlreadySeen.add(p); + if (nextElement == null ? p == null : nextElement.equals(p)) { + foundCurrentElement = true; + break; } + } - if (foundCurrentElement) { - continue; - } else { - return false; + if (!foundCurrentElement) { + return false; + } + } + return true; + } + + /** + * Returns true iff at least one element is in both collections. + *

    + * In other words, this method returns true iff the + * {@link #intersection} of coll1 and coll2 is not empty. + * + * @param the type of object to lookup in coll1. + * @param coll1 the first collection, must not be null + * @param coll2 the second collection, must not be null + * @return true iff the intersection of the collections is non-empty + * @since 4.2 + * @see #intersection + */ + public static boolean containsAny(final Collection coll1, @SuppressWarnings("unchecked") final T... coll2) { + if (coll1.size() < coll2.length) { + for (final Object aColl1 : coll1) { + if (ArrayUtils.contains(coll2, aColl1)) { + return true; + } + } + } else { + for (final Object aColl2 : coll2) { + if (coll1.contains(aColl2)) { + return true; } } - return true; } + return false; } /** @@ -435,12 +460,12 @@ * Only those elements present in the collection will appear as * keys in the map. * - * @param the type of object in the returned {@link Map}. This is a super type of . + * @param the type of object in the returned {@link Map}. This is a super type of <I>. * @param coll the collection to get the cardinality map for, must not be null * @return the populated cardinality map */ public static Map getCardinalityMap(final Iterable coll) { - final Map count = new HashMap(); + final Map count = new HashMap<>(); for (final O obj : coll) { final Integer c = count.get(obj); if (c == null) { @@ -465,7 +490,7 @@ * @see Collection#containsAll */ public static boolean isSubCollection(final Collection a, final Collection b) { - final CardinalityHelper helper = new CardinalityHelper(a, b); + final CardinalityHelper helper = new CardinalityHelper<>(a, b); for (final Object obj : a) { if (helper.freqA(obj) > helper.freqB(obj)) { return false; @@ -486,7 +511,7 @@ *
      *
    • a.size() and b.size() represent the * total cardinality of a and b, resp.
    • - *
    • a.size() < Integer.MAXVALUE
    • + *
    • a.size() < Integer.MAXVALUE
    • *
    * * @param a the first (sub?) collection, must not be null @@ -515,7 +540,7 @@ if(a.size() != b.size()) { return false; } - final CardinalityHelper helper = new CardinalityHelper(a, b); + final CardinalityHelper helper = new CardinalityHelper<>(a, b); if(helper.cardinalityA.size() != helper.cardinalityB.size()) { return false; } @@ -561,6 +586,7 @@ @SuppressWarnings({ "unchecked", "rawtypes" }) final Transformer transformer = new Transformer() { + @Override public EquatorWrapper transform(final Object input) { return new EquatorWrapper(equator, input); } @@ -613,7 +639,7 @@ * @param obj the object to find the cardinality of * @param coll the {@link Iterable} to search * @param the type of object that the {@link Iterable} may contain. - * @return the the number of occurrences of obj in coll + * @return the number of occurrences of obj in coll * @throws NullPointerException if coll is null * @deprecated since 4.1, use {@link IterableUtils#frequency(Iterable, Object)} instead. * Be aware that the order of parameters has changed. @@ -828,14 +854,14 @@ */ @Deprecated public static boolean exists(final Iterable input, final Predicate predicate) { - return predicate == null ? false : IterableUtils.matchesAny(input, predicate); + return predicate != null && IterableUtils.matchesAny(input, predicate); } /** * Answers true if a predicate is true for every element of a * collection. *

    - * A null predicate returns false.
    + * A null predicate returns false.
    * A null or empty collection returns true. * * @param the type of object the {@link Iterable} contains @@ -848,7 +874,7 @@ */ @Deprecated public static boolean matchesAll(final Iterable input, final Predicate predicate) { - return predicate == null ? false : IterableUtils.matchesAll(input, predicate); + return predicate != null && IterableUtils.matchesAll(input, predicate); } /** @@ -926,7 +952,7 @@ * @since 4.1 */ public static > R select(final Iterable inputCollection, - final Predicate predicate, R outputCollection, R rejectedCollection) { + final Predicate predicate, final R outputCollection, final R rejectedCollection) { if (inputCollection != null && predicate != null) { for (final O element : inputCollection) { @@ -1160,7 +1186,7 @@ * @return {@code true} if the collection was changed, {@code false} otherwise * @throws NullPointerException if the collection or array is null */ - public static boolean addAll(final Collection collection, final C[] elements) { + public static boolean addAll(final Collection collection, final C... elements) { boolean changed = false; for (final C element : elements) { changed |= collection.add(element); @@ -1248,7 +1274,7 @@ * @throws IllegalArgumentException if the object type is invalid */ public static Object get(final Object object, final int index) { - int i = index; + final int i = index; if (i < 0) { throw new IndexOutOfBoundsException("Index cannot be negative: " + i); } @@ -1264,9 +1290,6 @@ } else if (object instanceof Iterable) { final Iterable iterable = (Iterable) object; return IterableUtils.get(iterable, i); - } else if (object instanceof Collection) { - final Iterator iterator = ((Collection) object).iterator(); - return IteratorUtils.get(iterator, i); } else if (object instanceof Enumeration) { final Enumeration it = (Enumeration) object; return EnumerationUtils.get(it, i); @@ -1311,7 +1334,7 @@ * * @param object the object to get the size of, may be null * @return the size of the specified collection or 0 if the object was null - * @throws IllegalArgumentException thrown if object is not recognised + * @throws IllegalArgumentException thrown if object is not recognized * @since 3.1 */ public static int size(final Object object) { @@ -1362,7 +1385,7 @@ * * @param object the object to get the size of, may be null * @return true if empty or null - * @throws IllegalArgumentException thrown if object is not recognised + * @throws IllegalArgumentException thrown if object is not recognized * @since 3.2 */ public static boolean sizeIsEmpty(final Object object) { @@ -1512,8 +1535,8 @@ * @throws NullPointerException if either collection is null * @since 4.0 */ - public static > List collate(Iterable a, - Iterable b) { + public static > List collate(final Iterable a, + final Iterable b) { return collate(a, b, ComparatorUtils.naturalComparator(), true); } @@ -1587,24 +1610,23 @@ final int totalSize = a instanceof Collection && b instanceof Collection ? Math.max(1, ((Collection) a).size() + ((Collection) b).size()) : 10; - final Iterator iterator = new CollatingIterator(c, a.iterator(), b.iterator()); + final Iterator iterator = new CollatingIterator<>(c, a.iterator(), b.iterator()); if (includeDuplicates) { return IteratorUtils.toList(iterator, totalSize); - } else { - final ArrayList mergedList = new ArrayList(totalSize); + } + final ArrayList mergedList = new ArrayList<>(totalSize); - O lastItem = null; - while (iterator.hasNext()) { - final O item = iterator.next(); - if (lastItem == null || !lastItem.equals(item)) { - mergedList.add(item); - } - lastItem = item; + O lastItem = null; + while (iterator.hasNext()) { + final O item = iterator.next(); + if (lastItem == null || !lastItem.equals(item)) { + mergedList.add(item); } - - mergedList.trimToSize(); - return mergedList; + lastItem = item; } + + mergedList.trimToSize(); + return mergedList; } //----------------------------------------------------------------------- @@ -1628,8 +1650,8 @@ * @since 4.0 */ public static Collection> permutations(final Collection collection) { - final PermutationIterator it = new PermutationIterator(collection); - final Collection> result = new LinkedList>(); + final PermutationIterator it = new PermutationIterator<>(collection); + final Collection> result = new ArrayList<>(); while (it.hasNext()) { result.add(it.next()); } @@ -1693,17 +1715,18 @@ final Equator equator) { final Transformer> transformer = new Transformer>() { - public EquatorWrapper transform(E input) { - return new EquatorWrapper(equator, input); + @Override + public EquatorWrapper transform(final E input) { + return new EquatorWrapper<>(equator, input); } }; final Set> retainSet = collect(retain, transformer, new HashSet>()); - final List list = new ArrayList(); + final List list = new ArrayList<>(); for (final E element : collection) { - if (retainSet.contains(new EquatorWrapper(equator, element))) { + if (retainSet.contains(new EquatorWrapper<>(equator, element))) { list.add(element); } } @@ -1768,17 +1791,18 @@ final Equator equator) { final Transformer> transformer = new Transformer>() { - public EquatorWrapper transform(E input) { - return new EquatorWrapper(equator, input); + @Override + public EquatorWrapper transform(final E input) { + return new EquatorWrapper<>(equator, input); } }; final Set> removeSet = collect(remove, transformer, new HashSet>()); - final List list = new ArrayList(); + final List list = new ArrayList<>(); for (final E element : collection) { - if (!removeSet.contains(new EquatorWrapper(equator, element))) { + if (!removeSet.contains(new EquatorWrapper<>(equator, element))) { list.add(element); } } diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java 2015-06-06 20:19:03.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/BooleanComparator.java 2018-07-08 00:18:18.000000000 +0000 @@ -28,7 +28,6 @@ * @see #booleanComparator(boolean) * * @since 3.0 - * @version $Id: BooleanComparator.java 1683951 2015-06-06 20:19:03Z tn $ */ public final class BooleanComparator implements Comparator, Serializable { @@ -48,12 +47,13 @@ /** * Returns a BooleanComparator instance that sorts * true values before false values. - *

    + *

    * Clients are encouraged to use the value returned from * this method instead of constructing a new instance * to reduce allocation and garbage collection overhead when * multiple BooleanComparators may be used in the same * virtual machine. + *

    * * @return the true first singleton BooleanComparator */ @@ -64,12 +64,13 @@ /** * Returns a BooleanComparator instance that sorts * false values before true values. - *

    + *

    * Clients are encouraged to use the value returned from * this method instead of constructing a new instance * to reduce allocation and garbage collection overhead when * multiple BooleanComparators may be used in the same * virtual machine. + *

    * * @return the false first singleton BooleanComparator */ @@ -81,12 +82,13 @@ * Returns a BooleanComparator instance that sorts * trueFirst values before * !trueFirst values. - *

    + *

    * Clients are encouraged to use the value returned from * this method instead of constructing a new instance * to reduce allocation and garbage collection overhead when * multiple BooleanComparators may be used in the same * virtual machine. + *

    * * @param trueFirst when true, sort * true Booleans before false diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java 2015-06-06 20:19:03.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/ComparableComparator.java 2018-07-08 00:18:18.000000000 +0000 @@ -35,9 +35,9 @@ * This is no longer the case. See {@link #compare(Object, Object) compare} for * details. * - * @since 2.0 - * @version $Id: ComparableComparator.java 1683951 2015-06-06 20:19:03Z tn $ + * @param the type of objects compared by this comparator * + * @since 2.0 * @see java.util.Collections#reverseOrder() */ public class ComparableComparator> implements Comparator, Serializable { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java 2015-06-06 20:19:03.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java 2018-07-08 00:18:18.000000000 +0000 @@ -44,8 +44,8 @@ * thread-safe at construction time, but it is thread-safe to perform * multiple comparisons after all the setup operations are complete. * + * @param the type of objects compared by this comparator * @since 2.0 - * @version $Id: ComparatorChain.java 1683951 2015-06-06 20:19:03Z tn $ */ public class ComparatorChain implements Comparator, Serializable { @@ -88,7 +88,7 @@ * @param reverse false = forward sort; true = reverse sort */ public ComparatorChain(final Comparator comparator, final boolean reverse) { - comparatorChain = new ArrayList>(1); + comparatorChain = new ArrayList<>(1); comparatorChain.add(comparator); orderingBits = new BitSet(1); if (reverse == true) { @@ -161,7 +161,7 @@ * * @param index index of the Comparator to replace * @param comparator Comparator to place at the given index - * @exception IndexOutOfBoundsException + * @throws IndexOutOfBoundsException * if index < 0 or index >= size() */ public void setComparator(final int index, final Comparator comparator) throws IndexOutOfBoundsException { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java 2015-06-22 13:00:27.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/FixedOrderComparator.java 2018-07-08 00:18:18.000000000 +0000 @@ -43,8 +43,8 @@ *

    * This class is Serializable from Commons Collections 4.0. * + * @param the type of objects compared by this comparator * @since 3.0 - * @version $Id: FixedOrderComparator.java 1686855 2015-06-22 13:00:27Z tn $ */ public class FixedOrderComparator implements Comparator, Serializable { @@ -55,12 +55,12 @@ * Unknown object behavior enum. * @since 4.0 */ - public static enum UnknownObjectBehavior { + public enum UnknownObjectBehavior { BEFORE, AFTER, EXCEPTION; } /** Internal map of object to position */ - private final Map map = new HashMap(); + private final Map map = new HashMap<>(); /** Counter used in determining the position in the map */ private int counter = 0; @@ -214,7 +214,7 @@ * Compares two objects according to the order of this Comparator. *

    * It is important to note that this class will throw an IllegalArgumentException - * in the case of an unrecognised object. This is not specified in the + * in the case of an unrecognized object. This is not specified in the * Comparator interface, but is the most appropriate exception. * * @param obj1 the first object to compare diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java 2015-06-06 20:19:03.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java 2018-07-08 00:18:18.000000000 +0000 @@ -25,8 +25,8 @@ * A Comparator that will compare nulls to be either lower or higher than * other objects. * + * @param the type of objects compared by this comparator * @since 2.0 - * @version $Id: NullComparator.java 1683951 2015-06-06 20:19:03Z tn $ */ public class NullComparator implements Comparator, Serializable { @@ -66,7 +66,7 @@ * non-null objects. This argument cannot be * null * - * @exception NullPointerException if nonNullComparator is + * @throws NullPointerException if nonNullComparator is * null **/ public NullComparator(final Comparator nonNullComparator) { @@ -106,7 +106,7 @@ * that null should be compared as lower than a * non-null object. * - * @exception NullPointerException if nonNullComparator is + * @throws NullPointerException if nonNullComparator is * null **/ public NullComparator(final Comparator nonNullComparator, final boolean nullsAreHigh) { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/package-info.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/package-info.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/package-info.java 2013-04-30 18:16:48.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/package-info.java 2018-07-08 00:18:18.000000000 +0000 @@ -23,6 +23,5 @@ * which is a single class that uses static methods to construct instances * of the classes in this package. * - * @version $Id: package-info.java 1477747 2013-04-30 18:16:48Z tn $ */ package org.apache.commons.collections4.comparators; diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java 2015-06-06 20:19:03.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java 2018-07-08 00:18:18.000000000 +0000 @@ -25,9 +25,9 @@ * Reverses the order of another comparator by reversing the arguments * to its {@link #compare(Object, Object) compare} method. * - * @since 2.0 - * @version $Id: ReverseComparator.java 1683951 2015-06-06 20:19:03Z tn $ + * @param the type of objects compared by this comparator * + * @since 2.0 * @see java.util.Collections#reverseOrder() */ public class ReverseComparator implements Comparator, Serializable { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/TransformingComparator.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/TransformingComparator.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/comparators/TransformingComparator.java 2015-06-06 20:19:03.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/comparators/TransformingComparator.java 2018-07-08 00:18:18.000000000 +0000 @@ -29,8 +29,10 @@ *

    * This class is Serializable from Commons Collections 4.0. * + * @param the input type to the transformer + * @param the output type from the transformer + * * @since 2.1 - * @version $Id: TransformingComparator.java 1683951 2015-06-06 20:19:03Z tn $ * * @see org.apache.commons.collections4.Transformer * @see org.apache.commons.collections4.comparators.ComparableComparator diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/ComparatorUtils.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/ComparatorUtils.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/ComparatorUtils.java 2014-05-02 08:58:40.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/ComparatorUtils.java 2018-07-08 00:18:18.000000000 +0000 @@ -36,7 +36,6 @@ * in the comparators subpackage. * * @since 2.1 - * @version $Id: ComparatorUtils.java 1591832 2014-05-02 08:58:40Z tn $ */ public class ComparatorUtils { @@ -75,7 +74,7 @@ * @see ComparatorChain */ public static Comparator chainedComparator(final Comparator... comparators) { - final ComparatorChain chain = new ComparatorChain(); + final ComparatorChain chain = new ComparatorChain<>(); for (final Comparator comparator : comparators) { if (comparator == null) { throw new NullPointerException("Comparator cannot be null"); @@ -113,7 +112,7 @@ * @see ReverseComparator */ public static Comparator reversedComparator(final Comparator comparator) { - return new ReverseComparator(comparator); + return new ReverseComparator<>(comparator); } /** @@ -149,7 +148,7 @@ if (comparator == null) { comparator = NATURAL_COMPARATOR; } - return new NullComparator(comparator, false); + return new NullComparator<>(comparator, false); } /** @@ -169,7 +168,7 @@ if (comparator == null) { comparator = NATURAL_COMPARATOR; } - return new NullComparator(comparator, true); + return new NullComparator<>(comparator, true); } /** @@ -193,7 +192,7 @@ if (comparator == null) { comparator = NATURAL_COMPARATOR; } - return new TransformingComparator(transformer, comparator); + return new TransformingComparator<>(transformer, comparator); } /** diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/EnumerationUtils.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/EnumerationUtils.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/EnumerationUtils.java 2015-06-01 21:53:01.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/EnumerationUtils.java 2018-07-08 00:18:18.000000000 +0000 @@ -27,7 +27,6 @@ * Provides utility methods for {@link Enumeration} instances. * * @since 3.0 - * @version $Id: EnumerationUtils.java 1683009 2015-06-01 21:53:01Z tn $ */ public class EnumerationUtils { @@ -58,9 +57,8 @@ i--; if (i == -1) { return e.nextElement(); - } else { - e.nextElement(); } + e.nextElement(); } throw new IndexOutOfBoundsException("Entry does not exist: " + i); } @@ -77,7 +75,7 @@ * @throws NullPointerException if the enumeration parameter is null. */ public static List toList(final Enumeration enumeration) { - return IteratorUtils.toList(new EnumerationIterator(enumeration)); + return IteratorUtils.toList(new EnumerationIterator<>(enumeration)); } /** @@ -88,7 +86,7 @@ * @return a list containing all tokens of the given StringTokenizer */ public static List toList(final StringTokenizer stringTokenizer) { - final List result = new ArrayList(stringTokenizer.countTokens()); + final List result = new ArrayList<>(stringTokenizer.countTokens()); while (stringTokenizer.hasMoreTokens()) { result.add(stringTokenizer.nextToken()); } diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/Equator.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/Equator.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/Equator.java 2013-11-10 22:19:29.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/Equator.java 2018-07-08 00:18:18.000000000 +0000 @@ -18,7 +18,6 @@ * * @param the types of object this {@link Equator} can evaluate. * @since 4.0 - * @version $Id: Equator.java 1540567 2013-11-10 22:19:29Z tn $ */ public interface Equator { /** diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/Factory.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/Factory.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/Factory.java 2013-11-19 00:45:38.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/Factory.java 2018-07-08 00:18:18.000000000 +0000 @@ -29,7 +29,6 @@ * @param the type that the factory creates * * @since 2.1 - * @version $Id: Factory.java 1543256 2013-11-19 00:45:38Z ggregory $ */ public interface Factory { diff -Nru libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/FactoryUtils.java libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/FactoryUtils.java --- libcommons-collections4-java-4.1/src/main/java/org/apache/commons/collections4/FactoryUtils.java 2015-11-14 20:38:02.000000000 +0000 +++ libcommons-collections4-java-4.2/src/main/java/org/apache/commons/collections4/FactoryUtils.java 2018-07-08 00:18:18.000000000 +0000 @@ -32,7 +32,7 @@ *

  • Exception - always throws an exception * *

    - * Since v4.1 only factories which are considered to be unsafe are + * Since v4.1 only factories which are considered to be safe are * Serializable. Factories considered to be unsafe for serialization are: *

      *
    • Prototype @@ -40,7 +40,6 @@ *
    * * @since 3.0 - * @version $Id: FactoryUtils.java 1714362 2015-11-14 20:38:02Z tn $ */ public class FactoryUtils { @@ -94,11 +93,12 @@ * Creates a Factory that will return a clone of the same prototype object * each time the factory is used. The prototype will be cloned using one of these * techniques (in order): + * *