You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2007/11/27 21:36:02 UTC
svn commit: r598761 - in /maven/components/trunk: ./
maven-embedder/src/main/aspect/org/apache/maven/embedder/cache/
maven-project/src/main/aspect/org/apache/maven/project/aspect/
maven-project/src/main/java/org/apache/maven/project/error/
Author: jdcasey
Date: Tue Nov 27 12:36:01 2007
New Revision: 598761
URL: http://svn.apache.org/viewvc?rev=598761&view=rev
Log:
Move back to jdk 1.4 compliance in these projects.
Modified:
maven/components/trunk/maven-embedder/src/main/aspect/org/apache/maven/embedder/cache/ErrorReportingAspect.aj
maven/components/trunk/maven-project/src/main/aspect/org/apache/maven/project/aspect/ProjectCacheAspect.aj
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/error/DefaultProjectErrorReporter.java
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/error/ProjectErrorTips.java
maven/components/trunk/pom.xml
Modified: maven/components/trunk/maven-embedder/src/main/aspect/org/apache/maven/embedder/cache/ErrorReportingAspect.aj
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/main/aspect/org/apache/maven/embedder/cache/ErrorReportingAspect.aj?rev=598761&r1=598760&r2=598761&view=diff
==============================================================================
--- maven/components/trunk/maven-embedder/src/main/aspect/org/apache/maven/embedder/cache/ErrorReportingAspect.aj (original)
+++ maven/components/trunk/maven-embedder/src/main/aspect/org/apache/maven/embedder/cache/ErrorReportingAspect.aj Tue Nov 27 12:36:01 2007
@@ -26,7 +26,7 @@
{
projectErrorReporter = new DefaultProjectErrorReporter();
- PBEDerivativeReporterAspect pbeDerivativeReporterAspect = Aspects.aspectOf( PBEDerivativeReporterAspect.class );
+ PBEDerivativeReporterAspect pbeDerivativeReporterAspect = (PBEDerivativeReporterAspect) Aspects.aspectOf( PBEDerivativeReporterAspect.class );
pbeDerivativeReporterAspect.setProjectErrorReporter( projectErrorReporter );
}
@@ -40,7 +40,7 @@
{
projectErrorReporter = new DefaultProjectErrorReporter();
- PBEDerivativeReporterAspect pbeDerivativeReporterAspect = Aspects.aspectOf( PBEDerivativeReporterAspect.class );
+ PBEDerivativeReporterAspect pbeDerivativeReporterAspect = (PBEDerivativeReporterAspect) Aspects.aspectOf( PBEDerivativeReporterAspect.class );
pbeDerivativeReporterAspect.setProjectErrorReporter( projectErrorReporter );
}
Modified: maven/components/trunk/maven-project/src/main/aspect/org/apache/maven/project/aspect/ProjectCacheAspect.aj
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/aspect/org/apache/maven/project/aspect/ProjectCacheAspect.aj?rev=598761&r1=598760&r2=598761&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/aspect/org/apache/maven/project/aspect/ProjectCacheAspect.aj (original)
+++ maven/components/trunk/maven-project/src/main/aspect/org/apache/maven/project/aspect/ProjectCacheAspect.aj Tue Nov 27 12:36:01 2007
@@ -19,7 +19,7 @@
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 @@
return groupId + ":" + artifactId + ":" + version;
}
- private Map<Object, ModelAndFile> DefaultModelLineageBuilder.modelAndFileCache = new HashMap<Object, ModelAndFile>();
+ private Map DefaultModelLineageBuilder.modelAndFileCache = new HashMap();
public void DefaultModelLineageBuilder.clearModelAndFileCache()
{
Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/error/DefaultProjectErrorReporter.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/error/DefaultProjectErrorReporter.java?rev=598761&r1=598760&r2=598761&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/error/DefaultProjectErrorReporter.java (original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/error/DefaultProjectErrorReporter.java Tue Nov 27 12:36:01 2007
@@ -30,9 +30,9 @@
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 String getFormattedMessage( Throwable error )
{
- return formattedMessages.get( error );
+ return (String) formattedMessages.get( error );
}
/**
@@ -73,7 +73,7 @@
*/
public Throwable getRealCause( Throwable error )
{
- return realCauses.get( error );
+ return (Throwable) realCauses.get( error );
}
private void registerProjectBuildError( Throwable error,
@@ -345,7 +345,7 @@
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 @@
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 );
Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/error/ProjectErrorTips.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/error/ProjectErrorTips.java?rev=598761&r1=598760&r2=598761&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/error/ProjectErrorTips.java (original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/error/ProjectErrorTips.java Tue Nov 27 12:36:01 2007
@@ -20,6 +20,11 @@
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 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 @@
return null;
}
- public static List<String> getTipsForBadDependencySpec( MavenProject project,
+ public static List getTipsForBadDependencySpec( MavenProject project,
File pomFile,
Dependency dep )
{
@@ -139,7 +144,7 @@
return null;
}
- public static List<String> getTipsForBadNonDependencyArtifactSpec( MavenProject project,
+ public static List getTipsForBadNonDependencyArtifactSpec( MavenProject project,
File pomFile,
InvalidProjectVersionException cause )
{
@@ -147,7 +152,7 @@
return null;
}
- public static List<String> getTipsForProjectInterpolationError( MavenProject project,
+ public static List getTipsForProjectInterpolationError( MavenProject project,
File pomFile,
ModelInterpolationException cause )
{
Modified: maven/components/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/pom.xml?rev=598761&r1=598760&r2=598761&view=diff
==============================================================================
--- maven/components/trunk/pom.xml (original)
+++ maven/components/trunk/pom.xml Tue Nov 27 12:36:01 2007
@@ -93,19 +93,23 @@
<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>