Skip to content

Commit

Permalink
Fix Javadoc build with Java 11 (#88)
Browse files Browse the repository at this point in the history
* remove svn id
* fix javadoc
* remove svn tokens
* fix javadoc with jdk14

Signed-off-by: olivier lamy <olamy@apache.org>
  • Loading branch information
olamy committed Aug 15, 2020
1 parent 787141a commit 01d82ae
Show file tree
Hide file tree
Showing 86 changed files with 594 additions and 434 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Expand Up @@ -49,4 +49,4 @@ jobs:
java-version: ${{ matrix.java }}

- name: Build with Maven
run: mvn verify -e -B -V
run: mvn verify javadoc:javadoc -e -B -V
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -81,7 +81,7 @@ limitations under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<version>3.2.0</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/codehaus/plexus/util/Base64.java
Expand Up @@ -26,7 +26,7 @@
* @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>
* @author Apache Software Foundation
* @since 1.0-dev
* @version $Id$
*
*/
public class Base64
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/codehaus/plexus/util/CachedMap.java
Expand Up @@ -415,7 +415,7 @@ public Set entrySet()
}

/**
* Compares the specified object with this map for equality. Returns <tt>true</tt> if the given object is also a map
* Compares the specified object with this map for equality. Returns <code>true</code> if the given object is also a map
* and the two Maps represent the same mappings.
*
* @param o object to be compared for equality with this map.
Expand All @@ -437,4 +437,4 @@ public int hashCode()
{
return _backingMap.hashCode();
}
}
}
31 changes: 18 additions & 13 deletions src/main/java/org/codehaus/plexus/util/CollectionUtils.java
Expand Up @@ -28,7 +28,7 @@

/**
* @author <a href="mailto:olamy@codehaus.org">olamy</a>
* @version $Id$
*
*/
public class CollectionUtils
{
Expand All @@ -44,6 +44,8 @@ public class CollectionUtils
*
* @param dominantMap Dominant Map.
* @param recessiveMap Recessive Map.
* @param <K> type
* @param <V> type
* @return The result map with combined dominant and recessive values.
*/
public static <K, V> Map<K, V> mergeMaps( Map<K, V> dominantMap, Map<K, V> recessiveMap )
Expand All @@ -64,7 +66,7 @@ public static <K, V> Map<K, V> mergeMaps( Map<K, V> dominantMap, Map<K, V> reces
return recessiveMap;
}

Map<K, V> result = new HashMap<K, V>();
Map<K, V> result = new HashMap<>();

// Grab the keys from the dominant and recessive maps.
Set<K> dominantMapKeys = dominantMap.keySet();
Expand Down Expand Up @@ -94,6 +96,8 @@ public static <K, V> Map<K, V> mergeMaps( Map<K, V> dominantMap, Map<K, V> reces
* order.
*
* @param maps An array of Maps to merge.
* @param <K> type
* @param <V> type
* @return Map The result Map produced after the merging process.
*/
public static <K, V> Map<K, V> mergeMaps( Map<K, V>[] maps )
Expand Down Expand Up @@ -122,22 +126,24 @@ else if ( maps.length == 1 )
}

/**
* Returns a {@link Collection} containing the intersection of the given {@link Collection}s.
* <p>
* Returns a {@link Collection} containing the intersection of the given {@link Collection}s.
* </p>
* The cardinality of each element in the returned {@link Collection} will be equal to the minimum of the
* cardinality of that element in the two given {@link Collection}s.
*
* @param a The first collection
* @param b The second collection
* @param <E> the type
* @see Collection#retainAll
* @return The intersection of a and b, never null
*/
public static <E> Collection<E> intersection( final Collection<E> a, final Collection<E> b )
{
ArrayList<E> list = new ArrayList<E>();
ArrayList<E> list = new ArrayList<>();
Map<E, Integer> mapa = getCardinalityMap( a );
Map<E, Integer> mapb = getCardinalityMap( b );
Set<E> elts = new HashSet<E>( a );
Set<E> elts = new HashSet<>( a );
elts.addAll( b );
for ( E obj : elts )
{
Expand All @@ -150,18 +156,19 @@ public static <E> Collection<E> intersection( final Collection<E> a, final Colle
}

/**
* Returns a {@link Collection} containing <tt><i>a</i> - <i>b</i></tt>. The cardinality of each element <i>e</i> in
* Returns a {@link Collection} containing <code>a - b</code>. The cardinality of each element <i>e</i> in
* the returned {@link Collection} will be the cardinality of <i>e</i> in <i>a</i> minus the cardinality of <i>e</i>
* in <i>b</i>, or zero, whichever is greater.
*
* @param a The start collection
* @param b The collection that will be subtracted
* @param <T> the type
* @see Collection#removeAll
* @return The result of the subtraction
*/
public static <T> Collection<T> subtract( final Collection<T> a, final Collection<T> b )
{
ArrayList<T> list = new ArrayList<T>( a );
ArrayList<T> list = new ArrayList<>( a );
for ( T aB : b )
{
list.remove( aB );
Expand All @@ -172,14 +179,15 @@ public static <T> Collection<T> subtract( final Collection<T> a, final Collectio
/**
* Returns a {@link Map} mapping each unique element in the given {@link Collection} to an {@link Integer}
* representing the number of occurrences of that element in the {@link Collection}. An entry that maps to
* <tt>null</tt> indicates that the element does not appear in the given {@link Collection}.
* <code>null</code> indicates that the element does not appear in the given {@link Collection}.
*
* @param col The collection to count cardinalities for
* @param <E> the type
* @return A map of counts, indexed on each element in the collection
*/
public static <E> Map<E, Integer> getCardinalityMap( final Collection<E> col )
{
HashMap<E, Integer> count = new HashMap<E, Integer>();
HashMap<E, Integer> count = new HashMap<>();
for ( E obj : col )
{
Integer c = count.get( obj );
Expand Down Expand Up @@ -226,10 +234,7 @@ private static <E> int getFreq( final E obj, final Map<E, Integer> freqMap )
return o;
}
}
catch ( NullPointerException ignore )
{
}
catch ( NoSuchElementException ignore )
catch ( NullPointerException | NoSuchElementException ignore )
{
}
return 0;
Expand Down
Expand Up @@ -21,7 +21,7 @@
/**
* Observes the actions of a {@link DirectoryWalker}.
*
* @version $Id$
*
* @see DirectoryWalker
*/
public interface DirectoryWalkListener
Expand Down
Expand Up @@ -25,7 +25,7 @@
/**
* DirectoryWalker
*
* @version $Id$
*
*/
public class DirectoryWalker
{
Expand Down
18 changes: 14 additions & 4 deletions src/main/java/org/codehaus/plexus/util/ExceptionUtils.java
Expand Up @@ -76,7 +76,7 @@
* @author Dmitri Plotnikov
* @author Stephen Colebourne
* @since 1.0
* @version $Id$
*
*/
public class ExceptionUtils
{
Expand Down Expand Up @@ -158,6 +158,7 @@ public static Throwable getCause( Throwable throwable )
* </p>
*
* @param throwable The exception to introspect for a cause.
* @param methodNames the methods names to match
* @return The cause of the <code>Throwable</code>.
* @throws NullPointerException if the method names array is null or contains null
* @throws NullPointerException if the throwable is null
Expand Down Expand Up @@ -343,7 +344,7 @@ public static int getThrowableCount( Throwable throwable )
*/
public static Throwable[] getThrowables( Throwable throwable )
{
List<Throwable> list = new ArrayList<Throwable>();
List<Throwable> list = new ArrayList<>();
while ( throwable != null )
{
list.add( throwable );
Expand All @@ -357,7 +358,9 @@ public static Throwable[] getThrowables( Throwable throwable )
* Delegates to {@link #indexOfThrowable(Throwable, Class, int)}, starting the search at the beginning of the
* exception chain.
* </p>
*
* @param throwable the exception to inspect
* @param type <code>Class</code> to look for
* @return index of the stack matching the type
* @see #indexOfThrowable(Throwable, Class, int)
*/
public static int indexOfThrowable( Throwable throwable, Class type )
Expand Down Expand Up @@ -406,6 +409,8 @@ public static int indexOfThrowable( Throwable throwable, Class type, int fromInd
* exception and continues with stack frames until the wrapper exception is caught and wrapped again, etc.
* <p>
* The method is equivalent to t.printStackTrace() for throwables that don't have nested causes.
* @param t the exception
* @param stream the stream
*/
public static void printRootCauseStackTrace( Throwable t, PrintStream stream )
{
Expand All @@ -419,6 +424,7 @@ public static void printRootCauseStackTrace( Throwable t, PrintStream stream )

/**
* Equivalent to printRootCauseStackTrace(t, System.err)
* @param t the exception
*/
public static void printRootCauseStackTrace( Throwable t )
{
Expand All @@ -427,6 +433,8 @@ public static void printRootCauseStackTrace( Throwable t )

/**
* Same as printRootCauseStackTrace(t, stream), except it takes a PrintWriter as an argument.
* @param t the cause
* @param writer the writer
*/
public static void printRootCauseStackTrace( Throwable t, PrintWriter writer )
{
Expand All @@ -441,12 +449,14 @@ public static void printRootCauseStackTrace( Throwable t, PrintWriter writer )
/**
* Creates a compact stack trace for the root cause of the supplied throwable. See
* <code>printRootCauseStackTrace(Throwable t, PrintStream s)</code>
* @param t the cause
* @return the Stack
*/
public static String[] getRootCauseStackTrace( Throwable t )
{
Throwable[] throwables = getThrowables( t );
int count = throwables.length;
ArrayList<String> frames = new ArrayList<String>();
ArrayList<String> frames = new ArrayList<>();
List<String> nextTrace = getStackFrameList( throwables[count - 1] );
for ( int i = count; --i >= 0; )
{
Expand Down
13 changes: 2 additions & 11 deletions src/main/java/org/codehaus/plexus/util/Expand.java
Expand Up @@ -71,7 +71,7 @@
* @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
* @author <a href="mailto:umagesh@codehaus.org">Magesh Umasankar</a>
* @since Ant 1.1 @ant.task category="packaging" name="unzip" name="unjar" name="unwar"
* @version $Id$
*
*/
public class Expand
{
Expand All @@ -93,12 +93,6 @@ public void execute()
expandFile( source, dest );
}

/*
* This method is to be overridden by extending unarchival tasks.
*/
/**
* Description of the Method
*/
protected void expandFile( final File srcF, final File dir )
throws Exception
{
Expand All @@ -116,9 +110,6 @@ protected void expandFile( final File srcF, final File dir )
}
}

/**
* Description of the Method
*/
protected void extractFile( File srcF, File dir, InputStream compressedInputStream, String entryName,
Date entryDate, boolean isDirectory )
throws Exception
Expand Down Expand Up @@ -188,7 +179,7 @@ public void setSrc( File s )
}

/**
* Should we overwrite files in dest, even if they are newer than the corresponding entries in the archive?
* @param b Should we overwrite files in dest, even if they are newer than the corresponding entries in the archive?
*/
public void setOverwrite( boolean b )
{
Expand Down
21 changes: 11 additions & 10 deletions src/main/java/org/codehaus/plexus/util/FileUtils.java
Expand Up @@ -82,7 +82,7 @@
/**
* <p>This class provides basic facilities for manipulating files and file paths.</p>
*
* <h3>Path-related methods</h3>
* <b>Path-related methods</b>
*
* <p>Methods exist to retrieve the components of a typical file path. For example
* <code>/www/hosted/mysite/index.html</code>, can be broken into:
Expand All @@ -95,7 +95,7 @@
* <p>There are also methods to {@link #catPath concatenate two paths}, {@link #resolveFile resolve a path relative to a
* File} and {@link #normalize} a path.</p>
* <h3>File-related methods</h3>
* <b>File-related methods</b>
*
* <p>There are methods to create a {@link #toFile File from a URL}, copy a {@link #copyFileToDirectory File to a
* directory}, copy a {@link #copyFile File to another File}, copy a {@link #copyURLToFile URL's contents to a File}, as
Expand All @@ -112,7 +112,7 @@
* @author <a href="mailto:Christoph.Reck@dlr.de">Christoph.Reck</a>
* @author <a href="mailto:peter@codehaus.org">Peter Donald</a>
* @author <a href="mailto:jefft@codehaus.org">Jeff Turner</a>
* @version $Id$
*
*/
public class FileUtils
{
Expand Down Expand Up @@ -988,6 +988,7 @@ public static void copyFileToDirectoryIfModified( final File source, final File
* @param sourceBase The basedir used for the directory scan
* @param dirs The getIncludedDirs from the dirscanner
* @param destination The base dir of the output structure
* @throws IOException io issue
*/
public static void mkDirs( final File sourceBase, String[] dirs, final File destination )
throws IOException
Expand Down Expand Up @@ -1696,7 +1697,7 @@ public static long sizeOfDirectory( final File directory )
* @param includes the includes pattern, comma separated
* @param excludes the excludes pattern, comma separated
* @return a list of File objects
* @throws IOException
* @throws IOException io issue
* @see #getFileNames(File, String, String, boolean)
*/
public static List<File> getFiles( File directory, String includes, String excludes )
Expand All @@ -1713,7 +1714,7 @@ public static List<File> getFiles( File directory, String includes, String exclu
* @param excludes the excludes pattern, comma separated
* @param includeBasedir true to include the base dir in each file
* @return a list of File objects
* @throws IOException
* @throws IOException io issue
* @see #getFileNames(File, String, String, boolean)
*/
public static List<File> getFiles( File directory, String includes, String excludes, boolean includeBasedir )
Expand All @@ -1739,7 +1740,7 @@ public static List<File> getFiles( File directory, String includes, String exclu
* @param excludes the excludes pattern, comma separated
* @param includeBasedir true to include the base dir in each String of file
* @return a list of files as String
* @throws IOException
* @throws IOException io issue
*/
public static List<String> getFileNames( File directory, String includes, String excludes, boolean includeBasedir )
throws IOException
Expand All @@ -1756,7 +1757,7 @@ public static List<String> getFileNames( File directory, String includes, String
* @param includeBasedir true to include the base dir in each String of file
* @param isCaseSensitive true if case sensitive
* @return a list of files as String
* @throws IOException
* @throws IOException io issue
*/
public static List<String> getFileNames( File directory, String includes, String excludes, boolean includeBasedir,
boolean isCaseSensitive )
Expand All @@ -1773,7 +1774,7 @@ public static List<String> getFileNames( File directory, String includes, String
* @param excludes the excludes pattern, comma separated
* @param includeBasedir true to include the base dir in each String of file
* @return a list of directories as String
* @throws IOException
* @throws IOException io issue
*/
public static List<String> getDirectoryNames( File directory, String includes, String excludes,
boolean includeBasedir )
Expand All @@ -1791,7 +1792,7 @@ public static List<String> getDirectoryNames( File directory, String includes, S
* @param includeBasedir true to include the base dir in each String of file
* @param isCaseSensitive true if case sensitive
* @return a list of directories as String
* @throws IOException
* @throws IOException io issue
*/
public static List<String> getDirectoryNames( File directory, String includes, String excludes,
boolean includeBasedir, boolean isCaseSensitive )
Expand All @@ -1811,7 +1812,7 @@ public static List<String> getDirectoryNames( File directory, String includes, S
* @param getFiles true if get files
* @param getDirectories true if get directories
* @return a list of files as String
* @throws IOException
* @throws IOException io issue
*/
public static List<String> getFileAndDirectoryNames( File directory, String includes, String excludes,
boolean includeBasedir, boolean isCaseSensitive,
Expand Down

0 comments on commit 01d82ae

Please sign in to comment.