Move back to jdk 1.4 compliance in these projects.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@598761 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2007-11-27 20:36:01 +00:00
parent 92f4fe42e9
commit d1f7e63e51
5 changed files with 48 additions and 37 deletions

View File

@ -26,7 +26,7 @@ public privileged aspect ErrorReportingAspect
{
projectErrorReporter = new DefaultProjectErrorReporter();
PBEDerivativeReporterAspect pbeDerivativeReporterAspect = Aspects.aspectOf( PBEDerivativeReporterAspect.class );
PBEDerivativeReporterAspect pbeDerivativeReporterAspect = (PBEDerivativeReporterAspect) Aspects.aspectOf( PBEDerivativeReporterAspect.class );
pbeDerivativeReporterAspect.setProjectErrorReporter( projectErrorReporter );
}
@ -40,7 +40,7 @@ public privileged aspect ErrorReportingAspect
{
projectErrorReporter = new DefaultProjectErrorReporter();
PBEDerivativeReporterAspect pbeDerivativeReporterAspect = Aspects.aspectOf( PBEDerivativeReporterAspect.class );
PBEDerivativeReporterAspect pbeDerivativeReporterAspect = (PBEDerivativeReporterAspect) Aspects.aspectOf( PBEDerivativeReporterAspect.class );
pbeDerivativeReporterAspect.setProjectErrorReporter( projectErrorReporter );
}

View File

@ -19,7 +19,7 @@ import java.util.Map;
public privileged aspect ProjectCacheAspect
{
private Map<Object, MavenProject> DefaultMavenProjectBuilder.projectCache = new HashMap<Object, MavenProject>();
private Map DefaultMavenProjectBuilder.projectCache = new HashMap();
public void DefaultMavenProjectBuilder.clearProjectCache()
{
@ -159,7 +159,7 @@ public privileged aspect ProjectCacheAspect
return groupId + ":" + artifactId + ":" + version;
}
private Map<Object, ModelAndFile> DefaultModelLineageBuilder.modelAndFileCache = new HashMap<Object, ModelAndFile>();
private Map DefaultModelLineageBuilder.modelAndFileCache = new HashMap();
public void DefaultModelLineageBuilder.clearModelAndFileCache()
{

View File

@ -30,9 +30,9 @@ public class DefaultProjectErrorReporter
implements ProjectErrorReporter
{
private Map<Throwable, String> formattedMessages = new HashMap<Throwable, String>();
private Map formattedMessages = new HashMap();
private Map<Throwable, Throwable> realCauses = new HashMap<Throwable, Throwable>();
private Map realCauses = new HashMap();
/**
* @see org.apache.maven.project.error.ProjectErrorReporter#clearErrors()
@ -65,7 +65,7 @@ public class DefaultProjectErrorReporter
*/
public String getFormattedMessage( Throwable error )
{
return formattedMessages.get( error );
return (String) formattedMessages.get( error );
}
/**
@ -73,7 +73,7 @@ public class DefaultProjectErrorReporter
*/
public Throwable getRealCause( Throwable error )
{
return realCauses.get( error );
return (Throwable) realCauses.get( error );
}
private void registerProjectBuildError( Throwable error,
@ -345,7 +345,7 @@ public class DefaultProjectErrorReporter
writer.write( String.valueOf( pomFile ) );
}
private void addTips( List<String> tips,
private void addTips( List tips,
StringWriter writer )
{
if ( ( tips != null ) && !tips.isEmpty() )
@ -353,8 +353,10 @@ public class DefaultProjectErrorReporter
writer.write( NEWLINE );
writer.write( NEWLINE );
writer.write( "Some tips:" );
for ( String tip : tips )
for ( Iterator it = tips.iterator(); it.hasNext(); )
{
String tip = (String) it.next();
writer.write( NEWLINE );
writer.write( "\t- " );
writer.write( tip );

View File

@ -20,6 +20,11 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
// NOTE: The strange String[] syntax is a backward adaptation from java5 stuff, where
// I was using varargs in listOf(..). I'm not moving them to constants because I'd like
// to go back to this someday...
// TODO: Optimize the String[] instances in here to List constants, and remove listOf(..)
public final class ProjectErrorTips
{
@ -27,103 +32,103 @@ public final class ProjectErrorTips
{
}
public static List<String> getTipsForActivatorErrorWhileApplyingProfiles( ProfileActivator activator,
public static List getTipsForActivatorErrorWhileApplyingProfiles( ProfileActivator activator,
Model model,
File pomFile,
Profile profile,
ProfileActivationContext context,
ProfileActivationException cause )
{
return listOf( "If this is a standard profile activator, see "
return listOf( new String[]{ "If this is a standard profile activator, see "
+ "http://maven.apache.org/pom.html#Activation for help configuring profile activation.",
"XSD location for pom.xml: http://maven.apache.org/xsd/maven-4.0.0.xsd",
"XSD location for settings.xml: http://maven.apache.org/xsd/settings-1.0.0.xsd",
"XSD location for profiles.xml: http://maven.apache.org/xsd/profiles-1.0.0.xsd" );
"XSD location for profiles.xml: http://maven.apache.org/xsd/profiles-1.0.0.xsd" } );
}
public static List<String> getTipsForActivatorErrorWhileGettingRepositoriesFromProfiles( ProfileActivator activator,
public static List getTipsForActivatorErrorWhileGettingRepositoriesFromProfiles( ProfileActivator activator,
String projectId,
File pomFile,
Profile profile,
ProfileActivationContext context,
ProfileActivationException cause )
{
return listOf( "If this is a standard profile activator, see "
return listOf( new String[]{ "If this is a standard profile activator, see "
+ "http://maven.apache.org/pom.html#Activation for help configuring profile activation.",
"XSD location for pom.xml: http://maven.apache.org/xsd/maven-4.0.0.xsd",
"XSD location for settings.xml: http://maven.apache.org/xsd/settings-1.0.0.xsd",
"XSD location for profiles.xml: http://maven.apache.org/xsd/profiles-1.0.0.xsd" );
"XSD location for profiles.xml: http://maven.apache.org/xsd/profiles-1.0.0.xsd" } );
}
public static List<String> getTipsForActivatorLookupErrorWhileApplyingProfiles( Model model,
public static List getTipsForActivatorLookupErrorWhileApplyingProfiles( Model model,
File pomFile,
Profile profile,
ComponentLookupException cause )
{
return listOf( "If this is a custom profile activator, please ensure the activator's "
return listOf( new String[]{ "If this is a custom profile activator, please ensure the activator's "
+ "artifact is present in the POM's build/extensions list.",
"See http://maven.apache.org/pom.html#Extensions for more on build extensions.",
"XSD location for pom.xml: http://maven.apache.org/xsd/maven-4.0.0.xsd",
"XSD location for settings.xml: http://maven.apache.org/xsd/settings-1.0.0.xsd",
"XSD location for profiles.xml: http://maven.apache.org/xsd/profiles-1.0.0.xsd" );
"XSD location for profiles.xml: http://maven.apache.org/xsd/profiles-1.0.0.xsd" } );
}
public static List<String> getTipsForActivatorLookupErrorWhileGettingRepositoriesFromProfiles( String projectId,
public static List getTipsForActivatorLookupErrorWhileGettingRepositoriesFromProfiles( String projectId,
File pomFile,
Profile profile,
ComponentLookupException cause )
{
return listOf( "If this is a custom profile activator, please ensure the activator's "
return listOf( new String[]{ "If this is a custom profile activator, please ensure the activator's "
+ "artifact is present in the POM's build/extensions list.",
"See http://maven.apache.org/pom.html#Extensions for more on build extensions.",
"XSD location for pom.xml: http://maven.apache.org/xsd/maven-4.0.0.xsd",
"XSD location for settings.xml: http://maven.apache.org/xsd/settings-1.0.0.xsd",
"XSD location for profiles.xml: http://maven.apache.org/xsd/profiles-1.0.0.xsd" );
"XSD location for profiles.xml: http://maven.apache.org/xsd/profiles-1.0.0.xsd" } );
}
public static List<String> getTipsForErrorLoadingExternalProfilesFromFile( Model model,
public static List getTipsForErrorLoadingExternalProfilesFromFile( Model model,
File pomFile,
File projectDir,
IOException cause )
{
String profilesXmlPath = new File( projectDir, "profiles.xml" ).getAbsolutePath();
return listOf( "Please ensure the " + profilesXmlPath + " file exists and is readable." );
return listOf( new String[]{ "Please ensure the " + profilesXmlPath + " file exists and is readable." } );
}
public static List<String> getTipsForErrorLoadingExternalProfilesFromFile( Model model,
public static List getTipsForErrorLoadingExternalProfilesFromFile( Model model,
File pomFile,
File projectDir,
XmlPullParserException cause )
{
return listOf( "XSD location: http://maven.apache.org/xsd/profiles-1.0.0.xsd" );
return listOf( new String[]{ "XSD location: http://maven.apache.org/xsd/profiles-1.0.0.xsd" } );
}
public static List<String> getTipsForInvalidRepositorySpec( RepositoryBase repo,
public static List getTipsForInvalidRepositorySpec( RepositoryBase repo,
String projectId,
File pomFile,
InvalidRepositoryException cause )
{
return listOf( "See http://maven.apache.org/pom.html#Repositories for more on custom artifact repositories.",
return listOf( new String[]{ "See http://maven.apache.org/pom.html#Repositories for more on custom artifact repositories.",
"See http://maven.apache.org/pom.html#PluginRepositories for more on custom plugin repositories.",
"XSD location for pom.xml: http://maven.apache.org/xsd/maven-4.0.0.xsd",
"XSD location for settings.xml: http://maven.apache.org/xsd/settings-1.0.0.xsd",
"XSD location for profiles.xml: http://maven.apache.org/xsd/profiles-1.0.0.xsd" );
"XSD location for profiles.xml: http://maven.apache.org/xsd/profiles-1.0.0.xsd" } );
}
private static List<String> listOf( String... tips )
private static List listOf( String[] tips )
{
List<String> list = new ArrayList<String>();
List list = new ArrayList();
for ( String tip : tips )
for ( int i = 0; i < tips.length; i++ )
{
list.add( tip );
list.add( tips[i] );
}
return list;
}
public static List<String> getTipsForProjectValidationFailure( MavenProject project,
public static List getTipsForProjectValidationFailure( MavenProject project,
File pomFile,
ModelValidationResult validationResult )
{
@ -131,7 +136,7 @@ public final class ProjectErrorTips
return null;
}
public static List<String> getTipsForBadDependencySpec( MavenProject project,
public static List getTipsForBadDependencySpec( MavenProject project,
File pomFile,
Dependency dep )
{
@ -139,7 +144,7 @@ public final class ProjectErrorTips
return null;
}
public static List<String> getTipsForBadNonDependencyArtifactSpec( MavenProject project,
public static List getTipsForBadNonDependencyArtifactSpec( MavenProject project,
File pomFile,
InvalidProjectVersionException cause )
{
@ -147,7 +152,7 @@ public final class ProjectErrorTips
return null;
}
public static List<String> getTipsForProjectInterpolationError( MavenProject project,
public static List getTipsForProjectInterpolationError( MavenProject project,
File pomFile,
ModelInterpolationException cause )
{

View File

@ -93,19 +93,23 @@ under the License.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<!-- Maybe someday...
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
-->
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.0-beta-2</version>
<!-- Maybe someday...
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
-->
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>