Don't use commons-collections 3.1 which is binary incompatible with commons-collections 2.1 (bundled in maven 1.0.2)
downgrade to 3.0 git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@293038 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
518f4fbddb
commit
a0fa5497cc
@ -140,7 +140,7 @@
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>3.1</version>
|
||||
<version>3.0</version>
|
||||
<type>jar</type>
|
||||
<properties/>
|
||||
</dependency>
|
||||
|
||||
@ -17,26 +17,6 @@ package org.apache.maven.javadoc;
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
import org.apache.commons.collections.set.ListOrderedSet;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright 2001-2004 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed 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.
|
||||
* ====================================================================
|
||||
*/
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
@ -46,13 +26,17 @@ import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.apache.commons.collections.SetUtils;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
/**
|
||||
* Converts the javadoc warnings into an xml (xdoc format) file.
|
||||
@ -130,8 +114,7 @@ public class JavadocWarningsTextToXml
|
||||
{
|
||||
if ( this.isVerbose() )
|
||||
{
|
||||
System.out.println("Setting input file name: '" + inputFileNameValue
|
||||
+ "'");
|
||||
System.out.println( "Setting input file name: '" + inputFileNameValue + "'" );
|
||||
}
|
||||
|
||||
this.inputFileName = inputFileNameValue;
|
||||
@ -176,8 +159,7 @@ public class JavadocWarningsTextToXml
|
||||
{
|
||||
if ( this.isVerbose() )
|
||||
{
|
||||
System.out.println("Setting output file name: '" + outputFileNameValue
|
||||
+ "'");
|
||||
System.out.println( "Setting output file name: '" + outputFileNameValue + "'" );
|
||||
}
|
||||
|
||||
this.outputFileName = outputFileNameValue;
|
||||
@ -221,14 +203,12 @@ public class JavadocWarningsTextToXml
|
||||
{
|
||||
if ( StringUtils.isBlank( getInputFileName() ) )
|
||||
{
|
||||
throw new IllegalArgumentException(
|
||||
"Input file name must be specified");
|
||||
throw new IllegalArgumentException( "Input file name must be specified" );
|
||||
}
|
||||
|
||||
if ( StringUtils.isBlank( getOutputFileName() ) )
|
||||
{
|
||||
throw new IllegalArgumentException(
|
||||
"Output file name must be specified");
|
||||
throw new IllegalArgumentException( "Output file name must be specified" );
|
||||
}
|
||||
|
||||
String[] lines = this.readInput();
|
||||
@ -256,8 +236,7 @@ public class JavadocWarningsTextToXml
|
||||
{
|
||||
if ( this.isVerbose() )
|
||||
{
|
||||
System.out.println("Building map from " + input.length
|
||||
+ " input line(s)");
|
||||
System.out.println( "Building map from " + input.length + " input line(s)" );
|
||||
}
|
||||
|
||||
Map files = new TreeMap();
|
||||
@ -278,15 +257,11 @@ public class JavadocWarningsTextToXml
|
||||
int fileNameStart = javaDocStart += PADDING;
|
||||
int warningStart = line.indexOf( "warning - " );
|
||||
int fileNameEnd = warningStart - 1;
|
||||
String fileNameAndLineNumber = line.substring(fileNameStart,
|
||||
fileNameEnd);
|
||||
String fileNameAndLineNumber = line.substring( fileNameStart, fileNameEnd );
|
||||
int lastColon = fileNameAndLineNumber.lastIndexOf( ':' );
|
||||
int nextToLastColon = fileNameAndLineNumber.lastIndexOf(':',
|
||||
lastColon - 1);
|
||||
String fileName = fileNameAndLineNumber.substring(0,
|
||||
nextToLastColon);
|
||||
String lineNumber = fileNameAndLineNumber.substring(nextToLastColon
|
||||
+ 1, lastColon);
|
||||
int nextToLastColon = fileNameAndLineNumber.lastIndexOf( ':', lastColon - 1 );
|
||||
String fileName = fileNameAndLineNumber.substring( 0, nextToLastColon );
|
||||
String lineNumber = fileNameAndLineNumber.substring( nextToLastColon + 1, lastColon );
|
||||
int msgStart = warningStart + PADDING;
|
||||
String msg = line.substring( msgStart );
|
||||
|
||||
@ -300,12 +275,11 @@ public class JavadocWarningsTextToXml
|
||||
}
|
||||
|
||||
// Get the messages for the line
|
||||
Set lineMessages = (Set) fileMessages.get(new Integer(
|
||||
lineNumber));
|
||||
Set lineMessages = (Set) fileMessages.get( new Integer( lineNumber ) );
|
||||
|
||||
if ( lineMessages == null )
|
||||
{
|
||||
lineMessages = new ListOrderedSet();
|
||||
lineMessages = SetUtils.orderedSet( new TreeSet() );
|
||||
|
||||
fileMessages.put( new Integer( lineNumber ), lineMessages );
|
||||
}
|
||||
@ -315,8 +289,7 @@ public class JavadocWarningsTextToXml
|
||||
}
|
||||
catch ( Throwable t )
|
||||
{
|
||||
System.err.println("*** WARNING: exception parsing line '"
|
||||
+ line + "': " + t.getMessage());
|
||||
System.err.println( "*** WARNING: exception parsing line '" + line + "': " + t.getMessage() );
|
||||
|
||||
if ( this.isVerbose() )
|
||||
{
|
||||
@ -345,8 +318,8 @@ public class JavadocWarningsTextToXml
|
||||
dir.mkdirs();
|
||||
}
|
||||
|
||||
PrintWriter out = new PrintWriter(new OutputStreamWriter(
|
||||
new FileOutputStream(output), this.getOutputEncoding()));
|
||||
PrintWriter out = new PrintWriter( new OutputStreamWriter( new FileOutputStream( output ), this
|
||||
.getOutputEncoding() ) );
|
||||
|
||||
writeOutput( fileMap, out );
|
||||
out.flush();
|
||||
@ -367,8 +340,7 @@ public class JavadocWarningsTextToXml
|
||||
System.out.println( "Reading '" + getInputFileName() + "'" );
|
||||
}
|
||||
|
||||
BufferedReader reader = new BufferedReader(new FileReader(
|
||||
getInputFileName()));
|
||||
BufferedReader reader = new BufferedReader( new FileReader( getInputFileName() ) );
|
||||
|
||||
List lines = new ArrayList();
|
||||
String line = null;
|
||||
@ -386,8 +358,7 @@ public class JavadocWarningsTextToXml
|
||||
|
||||
if ( this.isVerbose() )
|
||||
{
|
||||
System.out.println("Read " + lines.size()
|
||||
+ " line(s) from input file");
|
||||
System.out.println( "Read " + lines.size() + " line(s) from input file" );
|
||||
}
|
||||
|
||||
return (String[]) lines.toArray( new String[lines.size()] );
|
||||
@ -405,12 +376,10 @@ public class JavadocWarningsTextToXml
|
||||
System.out.println( "Writing to output file '" + this.outputFileName );
|
||||
}
|
||||
|
||||
out.println("<?xml version=\"1.0\" encoding=\""
|
||||
+ this.getOutputEncoding() + "\"?>");
|
||||
out.println( "<?xml version=\"1.0\" encoding=\"" + this.getOutputEncoding() + "\"?>" );
|
||||
out.println( "<javadoc>" );
|
||||
|
||||
for (Iterator fileMapIterator = fileMap.keySet().iterator();
|
||||
fileMapIterator.hasNext();)
|
||||
for ( Iterator fileMapIterator = fileMap.keySet().iterator(); fileMapIterator.hasNext(); )
|
||||
{
|
||||
String fileName = (String) fileMapIterator.next();
|
||||
|
||||
@ -418,21 +387,17 @@ public class JavadocWarningsTextToXml
|
||||
|
||||
Map fileMessages = (Map) fileMap.get( fileName );
|
||||
|
||||
for (Iterator fileMessagesIterator = fileMessages.entrySet()
|
||||
.iterator();
|
||||
fileMessagesIterator.hasNext();)
|
||||
for ( Iterator fileMessagesIterator = fileMessages.entrySet().iterator(); fileMessagesIterator.hasNext(); )
|
||||
{
|
||||
Map.Entry entry = (Map.Entry) fileMessagesIterator.next();
|
||||
Integer lineNumber = (Integer) entry.getKey();
|
||||
Set lineMessages = (Set) entry.getValue();
|
||||
|
||||
for (Iterator lineMessagesIterator = lineMessages.iterator();
|
||||
lineMessagesIterator.hasNext();)
|
||||
for ( Iterator lineMessagesIterator = lineMessages.iterator(); lineMessagesIterator.hasNext(); )
|
||||
{
|
||||
String msg = (String) lineMessagesIterator.next();
|
||||
|
||||
out.println("<error line=\"" + lineNumber
|
||||
+ "\" severity=\"warning\" message=\""
|
||||
out.println( "<error line=\"" + lineNumber + "\" severity=\"warning\" message=\""
|
||||
+ StringEscapeUtils.escapeXml( msg ) + "\"/>" );
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,16 +16,16 @@ package org.apache.maven.javadoc;
|
||||
* limitations under the License.
|
||||
* ====================================================================
|
||||
*/
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
import junit.textui.TestRunner;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
import junit.textui.TestRunner;
|
||||
|
||||
/**
|
||||
* Test case.
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user