archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1585087 - in /archiva/redback/redback-components/trunk: expression-evaluator/src/main/java/org/apache/archiva/redback/components/evaluator/ modello-plugins/modello-db-keywords/src/main/java/org/apache/archiva/redback/components/modello/db/...
Date Sat, 05 Apr 2014 12:44:37 GMT
Author: olamy
Date: Sat Apr  5 12:44:37 2014
New Revision: 1585087

URL: http://svn.apache.org/r1585087
Log:
use diamond

Modified:
    archiva/redback/redback-components/trunk/expression-evaluator/src/main/java/org/apache/archiva/redback/components/evaluator/DefaultExpressionEvaluator.java
    archiva/redback/redback-components/trunk/modello-plugins/modello-db-keywords/src/main/java/org/apache/archiva/redback/components/modello/db/SQLReservedWords.java
    archiva/redback/redback-components/trunk/modello-plugins/modello-plugin-jpox/src/main/java/org/apache/archiva/redback/components/modello/jpox/JPoxJdoMappingModelloGenerator.java
    archiva/redback/redback-components/trunk/modello-plugins/modello-plugin-redback-registry/src/test/java/org/apache/archiva/redback/components/registry/modello/AbstractRegistryGeneratorTestCase.java
    archiva/redback/redback-components/trunk/spring-cache/spring-cache-test/src/main/java/org/apache/archiva/redback/components/cache/test/AbstractCacheTestCase.java
    archiva/redback/redback-components/trunk/spring-quartz/src/main/java/org/apache/archiva/redback/components/scheduler/CronExpressionValidator.java
    archiva/redback/redback-components/trunk/spring-registry/spring-registry-commons/src/main/java/org/apache/archiva/redback/components/registry/commons/CommonsConfigurationRegistry.java
    archiva/redback/redback-components/trunk/spring-taskqueue/src/main/java/org/apache/archiva/redback/components/taskqueue/DefaultTaskQueue.java
    archiva/redback/redback-components/trunk/spring-taskqueue/src/test/java/org/apache/archiva/redback/components/taskqueue/BuildProjectTaskViabilityEvaluator.java
    archiva/redback/redback-components/trunk/spring-taskqueue/src/test/java/org/apache/archiva/redback/components/taskqueue/TaskQueueTest.java

Modified: archiva/redback/redback-components/trunk/expression-evaluator/src/main/java/org/apache/archiva/redback/components/evaluator/DefaultExpressionEvaluator.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/expression-evaluator/src/main/java/org/apache/archiva/redback/components/evaluator/DefaultExpressionEvaluator.java?rev=1585087&r1=1585086&r2=1585087&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/expression-evaluator/src/main/java/org/apache/archiva/redback/components/evaluator/DefaultExpressionEvaluator.java
(original)
+++ archiva/redback/redback-components/trunk/expression-evaluator/src/main/java/org/apache/archiva/redback/components/evaluator/DefaultExpressionEvaluator.java
Sat Apr  5 12:44:37 2014
@@ -36,11 +36,11 @@ import java.util.regex.Pattern;
 public class DefaultExpressionEvaluator
     implements ExpressionEvaluator
 {
-    private List expressionSources;
+    private List<ExpressionSource> expressionSources;
 
     public DefaultExpressionEvaluator()
     {
-        expressionSources = new ArrayList();
+        expressionSources = new ArrayList<>();
     }
 
     public void addExpressionSource( ExpressionSource source )
@@ -51,10 +51,10 @@ public class DefaultExpressionEvaluator
     public String expand( String str )
         throws EvaluatorException
     {
-        return recursiveExpand( str, new ArrayList() );
+        return recursiveExpand( str, new ArrayList<String>() );
     }
 
-    private String recursiveExpand( String str, List seenExpressions )
+    private String recursiveExpand( String str, List<String> seenExpressions )
         throws EvaluatorException
     {
         if ( StringUtils.isEmpty( str ) )

Modified: archiva/redback/redback-components/trunk/modello-plugins/modello-db-keywords/src/main/java/org/apache/archiva/redback/components/modello/db/SQLReservedWords.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/modello-plugins/modello-db-keywords/src/main/java/org/apache/archiva/redback/components/modello/db/SQLReservedWords.java?rev=1585087&r1=1585086&r2=1585087&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/modello-plugins/modello-db-keywords/src/main/java/org/apache/archiva/redback/components/modello/db/SQLReservedWords.java
(original)
+++ archiva/redback/redback-components/trunk/modello-plugins/modello-db-keywords/src/main/java/org/apache/archiva/redback/components/modello/db/SQLReservedWords.java
Sat Apr  5 12:44:37 2014
@@ -48,7 +48,7 @@ public class SQLReservedWords
     extends AbstractLogEnabled
     implements Initializable
 {
-    private Map keywords;
+    private Map<String,List<KeywordSource>> keywords;
 
     /**
      * Tests the provided word to see if it is a keyword.
@@ -65,7 +65,7 @@ public class SQLReservedWords
         }
 
         String key = word.trim().toUpperCase();
-        return ( keywords.containsKey( key ) );
+        return keywords.containsKey( key );
     }
 
     /**
@@ -76,7 +76,7 @@ public class SQLReservedWords
      * @return the {@link List} of {@link KeywordSource} objects, or <code>null</code>
if specified word is
      *         not a reserved word.
      */
-    public List /*<KeywordSource>*/getKeywordSourceList( String word )
+    public List<KeywordSource> getKeywordSourceList( String word )
     {
         if ( StringUtils.isEmpty( word ) )
         {
@@ -85,7 +85,7 @@ public class SQLReservedWords
         }
 
         String key = word.trim().toUpperCase();
-        return (List) this.keywords.get( key );
+        return this.keywords.get( key );
     }
 
     /**
@@ -105,7 +105,7 @@ public class SQLReservedWords
         }
 
         String key = word.trim().toUpperCase();
-        List sources = (List) this.keywords.get( key );
+        List<KeywordSource> sources = this.keywords.get( key );
 
         if ( sources == null )
         {
@@ -114,9 +114,9 @@ public class SQLReservedWords
 
         StringBuffer ret = new StringBuffer();
 
-        for ( Iterator it = sources.iterator(); it.hasNext(); )
+        for ( Iterator<KeywordSource> it = sources.iterator(); it.hasNext(); )
         {
-            KeywordSource source = (KeywordSource) it.next();
+            KeywordSource source = it.next();
             if ( ret.length() > 0 )
             {
                 ret.append( ", " );
@@ -138,7 +138,7 @@ public class SQLReservedWords
      */
     private void loadKeywords()
     {
-        this.keywords = new HashMap();
+        this.keywords = new HashMap<>();
 
         Properties props = new Properties();
 
@@ -228,10 +228,10 @@ public class SQLReservedWords
     private void addKeyword( String keyword, KeywordSource source )
     {
         String key = keyword.trim().toUpperCase();
-        List sources = (List) this.keywords.get( key );
+        List<KeywordSource> sources = this.keywords.get( key );
         if ( sources == null )
         {
-            sources = new ArrayList();
+            sources = new ArrayList<>();
         }
         sources.add( source );
         this.keywords.put( key, sources );

Modified: archiva/redback/redback-components/trunk/modello-plugins/modello-plugin-jpox/src/main/java/org/apache/archiva/redback/components/modello/jpox/JPoxJdoMappingModelloGenerator.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/modello-plugins/modello-plugin-jpox/src/main/java/org/apache/archiva/redback/components/modello/jpox/JPoxJdoMappingModelloGenerator.java?rev=1585087&r1=1585086&r2=1585087&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/modello-plugins/modello-plugin-jpox/src/main/java/org/apache/archiva/redback/components/modello/jpox/JPoxJdoMappingModelloGenerator.java
(original)
+++ archiva/redback/redback-components/trunk/modello-plugins/modello-plugin-jpox/src/main/java/org/apache/archiva/redback/components/modello/jpox/JPoxJdoMappingModelloGenerator.java
Sat Apr  5 12:44:37 2014
@@ -19,21 +19,21 @@ package org.apache.archiva.redback.compo
  * under the License.
  */
 
-import org.codehaus.modello.ModelloException;
-import org.codehaus.modello.ModelloParameterConstants;
 import org.apache.archiva.redback.components.modello.db.SQLReservedWords;
 import org.apache.archiva.redback.components.modello.db.SQLReservedWords.KeywordSource;
-import org.codehaus.modello.model.Model;
-import org.codehaus.modello.model.ModelAssociation;
-import org.codehaus.modello.model.ModelClass;
-import org.codehaus.modello.model.ModelField;
-import org.codehaus.modello.plugin.AbstractModelloGenerator;
 import org.apache.archiva.redback.components.modello.jpox.metadata.JPoxAssociationMetadata;
 import org.apache.archiva.redback.components.modello.jpox.metadata.JPoxClassMetadata;
 import org.apache.archiva.redback.components.modello.jpox.metadata.JPoxFieldMetadata;
 import org.apache.archiva.redback.components.modello.jpox.metadata.JPoxModelMetadata;
 import org.apache.archiva.redback.components.modello.plugin.store.metadata.StoreAssociationMetadata;
 import org.apache.archiva.redback.components.modello.plugin.store.metadata.StoreFieldMetadata;
+import org.codehaus.modello.ModelloException;
+import org.codehaus.modello.ModelloParameterConstants;
+import org.codehaus.modello.model.Model;
+import org.codehaus.modello.model.ModelAssociation;
+import org.codehaus.modello.model.ModelClass;
+import org.codehaus.modello.model.ModelField;
+import org.codehaus.modello.plugin.AbstractModelloGenerator;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
 import org.codehaus.plexus.util.xml.XMLWriter;
@@ -56,19 +56,20 @@ import java.util.Properties;
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id: JPoxJdoMappingModelloGenerator.java 829 2007-03-22 14:32:42Z joakime $
  * @plexus.component role="org.codehaus.modello.plugin.ModelloGenerator"
- *              role-hint="jpox-jdo-mapping"
+ * role-hint="jpox-jdo-mapping"
  */
-public class JPoxJdoMappingModelloGenerator extends AbstractModelloGenerator
+public class JPoxJdoMappingModelloGenerator
+    extends AbstractModelloGenerator
 {
     private static final char EOL = '\n';
 
     private static final String ERROR_LINE = "----------------------------------------------------------------";
 
-    private final static Map PRIMITIVE_IDENTITY_MAP;
+    private final static Map<String, String> PRIMITIVE_IDENTITY_MAP;
 
-    private final static List IDENTITY_TYPES;
+    private final static List<String> IDENTITY_TYPES;
 
-    private final static List VALUE_STRATEGY_LIST;
+    private final static List<String> VALUE_STRATEGY_LIST;
 
     /**
      * @plexus.requirement
@@ -81,7 +82,7 @@ public class JPoxJdoMappingModelloGenera
 
     static
     {
-        PRIMITIVE_IDENTITY_MAP = new HashMap();
+        PRIMITIVE_IDENTITY_MAP = new HashMap<>();
 
         // TODO: These should be the fully qualified class names
         PRIMITIVE_IDENTITY_MAP.put( "short", "javax.jdo.identity.ShortIdentity" );
@@ -96,12 +97,12 @@ public class JPoxJdoMappingModelloGenera
         PRIMITIVE_IDENTITY_MAP.put( "byte", "javax.jdo.identity.ByteIdentity" );
         PRIMITIVE_IDENTITY_MAP.put( "Byte", "javax.jdo.identity.ByteIdentity" );
 
-        IDENTITY_TYPES = new ArrayList();
+        IDENTITY_TYPES = new ArrayList<>();
         IDENTITY_TYPES.add( "application" );
         IDENTITY_TYPES.add( "datastore" );
         IDENTITY_TYPES.add( "nondurable" );
 
-        VALUE_STRATEGY_LIST = new ArrayList();
+        VALUE_STRATEGY_LIST = new ArrayList<>();
         //VALUE_STRATEGY_LIST.add( "off" ); -- this isn't really valid. It turns it on. We
use it internally to set an explicit null
         VALUE_STRATEGY_LIST.add( "native" );
         VALUE_STRATEGY_LIST.add( "sequence" );
@@ -114,7 +115,8 @@ public class JPoxJdoMappingModelloGenera
         VALUE_STRATEGY_LIST.add( "auid" );
     }
 
-    protected void initialize( Model model, Properties parameters ) throws ModelloException
+    protected void initialize( Model model, Properties parameters )
+        throws ModelloException
     {
         super.initialize( model, parameters );
 
@@ -122,7 +124,8 @@ public class JPoxJdoMappingModelloGenera
         objectIdClassOverride = parameters.getProperty( "JPOX.override.objectid-class" );
     }
 
-    public void generate( Model model, Properties properties ) throws ModelloException
+    public void generate( Model model, Properties properties )
+        throws ModelloException
     {
         initialize( model, properties );
 
@@ -158,8 +161,9 @@ public class JPoxJdoMappingModelloGenera
             {
                 if ( !parent.mkdirs() )
                 {
-                    throw new ModelloException( "Error while creating parent directories
for the file " + "'"
-                                    + packageJdo.getAbsolutePath() + "'." );
+                    throw new ModelloException(
+                        "Error while creating parent directories for the file " + "'" + packageJdo.getAbsolutePath()
+                            + "'." );
                 }
             }
 
@@ -175,7 +179,8 @@ public class JPoxJdoMappingModelloGenera
     //
     // ----------------------------------------------------------------------
 
-    private void generatePackageJdo( File file, Model model ) throws IOException, ModelloException
+    private void generatePackageJdo( File file, Model model )
+        throws IOException, ModelloException
     {
         OutputStreamWriter fileWriter = new OutputStreamWriter( new FileOutputStream( file
), "UTF-8" );
 
@@ -183,13 +188,14 @@ public class JPoxJdoMappingModelloGenera
 
         XMLWriter writer = new PrettyPrintXMLWriter( printWriter );
 
-        Map classes = new HashMap();
+        Map<String, List<ModelClass>> classes = new HashMap<>();
 
-        for ( Iterator it = model.getClasses( getGeneratedVersion() ).iterator(); it.hasNext();
)
+        for ( Iterator<ModelClass> it = model.getClasses( getGeneratedVersion() ).iterator();
it.hasNext(); )
         {
-            ModelClass modelClass = (ModelClass) it.next();
+            ModelClass modelClass = it.next();
 
-            JPoxClassMetadata jpoxMetadata = (JPoxClassMetadata) modelClass.getMetadata(
JPoxClassMetadata.ID );
+            JPoxClassMetadata jpoxMetadata =
+                JPoxClassMetadata.class.cast( modelClass.getMetadata( JPoxClassMetadata.ID
) );
 
             if ( !jpoxMetadata.isEnabled() )
             {
@@ -199,11 +205,11 @@ public class JPoxJdoMappingModelloGenera
 
             String packageName = modelClass.getPackageName( isPackageWithVersion(), getGeneratedVersion()
);
 
-            List list = (List) classes.get( packageName );
+            List<ModelClass> list = classes.get( packageName );
 
             if ( list == null )
             {
-                list = new ArrayList();
+                list = new ArrayList<>();
             }
 
             list.add( modelClass );
@@ -220,27 +226,24 @@ public class JPoxJdoMappingModelloGenera
 
         writer.startElement( "jdo" );
 
-        for ( Iterator it = classes.entrySet().iterator(); it.hasNext(); )
+        for ( Map.Entry<String, List<ModelClass>> entry : classes.entrySet()
)
         {
-            Map.Entry entry = (Map.Entry) it.next();
 
-            List list = (List) entry.getValue();
+            List<ModelClass> list = entry.getValue();
 
             if ( list.size() == 0 )
             {
                 continue;
             }
 
-            String packageName = (String) entry.getKey();
+            String packageName = entry.getKey();
 
             writer.startElement( "package" );
 
             writer.addAttribute( "name", packageName );
 
-            for ( Iterator it2 = list.iterator(); it2.hasNext(); )
+            for ( ModelClass modelClass : list )
             {
-                ModelClass modelClass = (ModelClass) it2.next();
-
                 writeClass( writer, modelClass );
             }
 
@@ -259,7 +262,8 @@ public class JPoxJdoMappingModelloGenera
         printWriter.close();
     }
 
-    private void writeClass( XMLWriter writer, ModelClass modelClass ) throws ModelloException
+    private void writeClass( XMLWriter writer, ModelClass modelClass )
+        throws ModelloException
     {
         JPoxClassMetadata jpoxMetadata = (JPoxClassMetadata) modelClass.getMetadata( JPoxClassMetadata.ID
);
 
@@ -285,8 +289,8 @@ public class JPoxJdoMappingModelloGenera
             String superPackageName =
                 persistenceCapableSuperclass.getPackageName( isPackageWithVersion(), getGeneratedVersion()
);
 
-            writer.addAttribute( "persistence-capable-superclass", superPackageName + "."
-                            + persistenceCapableSuperclass.getName() );
+            writer.addAttribute( "persistence-capable-superclass",
+                                 superPackageName + "." + persistenceCapableSuperclass.getName()
);
         }
 
         writer.addAttribute( "detachable", String.valueOf( jpoxMetadata.isDetachable() )
);
@@ -313,9 +317,9 @@ public class JPoxJdoMappingModelloGenera
                 String identityType = jpoxMetadata.getIdentityType();
                 if ( !IDENTITY_TYPES.contains( identityType ) )
                 {
-                    throw new ModelloException( "The JDO mapping generator does not support
the specified "
-                                    + "class identity type '" + identityType + "'. " + "Supported
types: "
-                                    + IDENTITY_TYPES );
+                    throw new ModelloException(
+                        "The JDO mapping generator does not support the specified " + "class
identity type '"
+                            + identityType + "'. " + "Supported types: " + IDENTITY_TYPES
);
                 }
                 writer.addAttribute( "identity-type", identityType );
             }
@@ -353,10 +357,10 @@ public class JPoxJdoMappingModelloGenera
             if ( primaryKeys.size() > 1 )
             {
                 throw new ModelloException(
-                                            "The JDO mapping generator does not yet support
Object Identifier generation "
-                                                            + "for the " + primaryKeys.size()
-                                                            + " fields specified as <identifier>
or "
-                                                            + "with jpox.primary-key=\"true\""
);
+                    "The JDO mapping generator does not yet support Object Identifier generation
" + "for the "
+                        + primaryKeys.size() + " fields specified as <identifier> or
"
+                        + "with jpox.primary-key=\"true\""
+                );
             }
 
             if ( primaryKeys.size() == 1 )
@@ -495,13 +499,14 @@ public class JPoxJdoMappingModelloGenera
     /**
      * Utility method to obtain the table name from the {@link ModelClass} or {@link JPoxClassMetadata}
taking into
      * account the possibility of prefixes in use at the {@link JPoxModelMetadata} level.
-     * 
-     * @param modelClass the model class to get the class.name from.
+     *
+     * @param modelClass    the model class to get the class.name from.
      * @param classMetadata the class metadata to get the class-metadata.table name from.
-     * @return the table name (with possible prefix applied) 
+     * @return the table name (with possible prefix applied)
      * @throws ModelloException if there was a problem with the table name violating a sql
reserved word.
      */
-    private String getTableName( ModelClass modelClass, JPoxClassMetadata classMetadata )
throws ModelloException
+    private String getTableName( ModelClass modelClass, JPoxClassMetadata classMetadata )
+        throws ModelloException
     {
         JPoxModelMetadata modelMetadata = (JPoxModelMetadata) modelClass.getModel().getMetadata(
JPoxModelMetadata.ID );
 
@@ -610,10 +615,10 @@ public class JPoxJdoMappingModelloGenera
     }
 
     /**
-     * Support method for the {@link #getTableName(ModelClass, JPoxClassMetadata)}, 
-     * {@link #getColumnName(ModelField, JPoxFieldMetadata)}, and 
+     * Support method for the {@link #getTableName(ModelClass, JPoxClassMetadata)},
+     * {@link #getColumnName(ModelField, JPoxFieldMetadata)}, and
      * {@link #getJoinTableName(ModelField, JPoxFieldMetadata)} reserved word tests.
-     * 
+     *
      * @param word the word in violation.
      * @param emsg the string buffer to append to.
      * @return if this word has any ERROR severity level violations.
@@ -657,7 +662,8 @@ public class JPoxJdoMappingModelloGenera
         return hasError;
     }
 
-    private void writeModelloMetadataClass( XMLWriter writer ) throws ModelloException
+    private void writeModelloMetadataClass( XMLWriter writer )
+        throws ModelloException
     {
         writer.startElement( "class" );
 
@@ -714,7 +720,8 @@ public class JPoxJdoMappingModelloGenera
         }
     }
 
-    private void writeModelField( XMLWriter writer, ModelField modelField ) throws ModelloException
+    private void writeModelField( XMLWriter writer, ModelField modelField )
+        throws ModelloException
     {
         writer.startElement( "field" );
 
@@ -787,7 +794,7 @@ public class JPoxJdoMappingModelloGenera
             }
 
             // Work out potential <column> subelement
-            
+
             // Store potential column properties.
             Properties columnProps = new Properties();
 
@@ -828,18 +835,18 @@ public class JPoxJdoMappingModelloGenera
                 writer.addAttribute( "name", columnName.toUpperCase() + "_UNIQUE_CONSTRAINT"
);
                 writer.endElement();
             }
-            
+
             // Work out potential <foreign-key> subelement
             if ( jpoxMetadata.isForeignKey() )
             {
                 writer.startElement( "foreign-key" );
                 writer.addAttribute( "name", columnName.toUpperCase() + "_FK" );
-                
+
                 if ( StringUtils.isNotEmpty( jpoxMetadata.getForeignKeyDeferred() ) )
                 {
                     writer.addAttribute( "deferred", jpoxMetadata.getForeignKeyDeferred()
);
                 }
-                
+
                 if ( StringUtils.isNotEmpty( jpoxMetadata.getForeignKeyDeleteAction() ) )
                 {
                     writer.addAttribute( "delete-action", jpoxMetadata.getForeignKeyDeleteAction()
);
@@ -859,13 +866,14 @@ public class JPoxJdoMappingModelloGenera
     /**
      * Utility method to obtain the join table name from the {@link JPoxFieldMetadata} taking
into
      * account the possibility of prefixes in use at the {@link JPoxModelMetadata} level.
-     * 
-     * @param modelField the model field to get the field.name from.
+     *
+     * @param modelField    the model field to get the field.name from.
      * @param fieldMetadata the field metadata to get the field-metadata.join-table name
from.
-     * @return the join table name (with possible prefix applied) 
+     * @return the join table name (with possible prefix applied)
      * @throws ModelloException if there was a problem with the table name violating a sql
reserved word.
      */
-    private String getJoinTableName( ModelField modelField, JPoxFieldMetadata fieldMetadata
) throws ModelloException
+    private String getJoinTableName( ModelField modelField, JPoxFieldMetadata fieldMetadata
)
+        throws ModelloException
     {
         ModelClass modelClass = modelField.getModelClass();
         JPoxModelMetadata modelMetadata = (JPoxModelMetadata) modelClass.getModel().getMetadata(
JPoxModelMetadata.ID );
@@ -966,13 +974,14 @@ public class JPoxJdoMappingModelloGenera
     /**
      * Utility method to obtain the column name from the {@link ModelField} or {@link JPoxFieldMetadata}
taking into
      * account the possibility of prefixes in use at the {@link JPoxModelMetadata} or {@link
JPoxClassMetadata} level.
-     * 
-     * @param modelField the model field to get the field.name from.
+     *
+     * @param modelField    the model field to get the field.name from.
      * @param fieldMetadata the field metadata to get the field-metadata.column name from.
-     * @return the column name (with possible prefix applied) 
+     * @return the column name (with possible prefix applied)
      * @throws ModelloException if there was a problem with the column name violating a sql
reserved word.
      */
-    private String getColumnName( ModelField modelField, JPoxFieldMetadata fieldMetadata
) throws ModelloException
+    private String getColumnName( ModelField modelField, JPoxFieldMetadata fieldMetadata
)
+        throws ModelloException
     {
         boolean hasClassPrefix = false;
         boolean hasModelPrefix = false;
@@ -1097,7 +1106,8 @@ public class JPoxJdoMappingModelloGenera
             emsg.append( "                  <field jpox.column=\"DIFFERENT\">" ).append(
EOL );
             emsg.append( "               4) Use a different field name in" ).append( EOL
);
             emsg.append( "                  <class>" ).append( EOL );
-            emsg.append( "                    <name>" ).append( modelClass.getName()
).append( "</name>" ).append( EOL );
+            emsg.append( "                    <name>" ).append( modelClass.getName()
).append( "</name>" ).append(
+                EOL );
             emsg.append( "                    <fields>" ).append( EOL );
             emsg.append( "                      <field>" ).append( EOL );
             emsg.append( "                        <name>DIFFERENT</name>" ).append(
EOL );
@@ -1120,15 +1130,16 @@ public class JPoxJdoMappingModelloGenera
         return columnName;
     }
 
-    private static void writeValueStrategy( String valueStrategy, XMLWriter writer ) throws
ModelloException
+    private static void writeValueStrategy( String valueStrategy, XMLWriter writer )
+        throws ModelloException
     {
         if ( !"off".equals( valueStrategy ) )
         {
             if ( !VALUE_STRATEGY_LIST.contains( valueStrategy ) )
             {
-                throw new ModelloException( "The JDO mapping generator does not support the
specified "
-                                + "value-strategy '" + valueStrategy + "'. " + "Supported
types: "
-                                + VALUE_STRATEGY_LIST );
+                throw new ModelloException(
+                    "The JDO mapping generator does not support the specified " + "value-strategy
'" + valueStrategy
+                        + "'. " + "Supported types: " + VALUE_STRATEGY_LIST );
             }
             writer.addAttribute( "value-strategy", valueStrategy );
         }
@@ -1262,7 +1273,8 @@ public class JPoxJdoMappingModelloGenera
         return identifierFields.size() > 0;
     }
 
-    private List getPrimaryKeyFields( ModelClass modelClass ) throws ModelloException
+    private List getPrimaryKeyFields( ModelClass modelClass )
+        throws ModelloException
     {
         List primaryKeys = new ArrayList();
         List fields = modelClass.getFields( getGeneratedVersion() );
@@ -1294,12 +1306,14 @@ public class JPoxJdoMappingModelloGenera
         return primaryKeys;
     }
 
-    private void assertSupportedIdentityPrimitive( ModelField modelField ) throws ModelloException
+    private void assertSupportedIdentityPrimitive( ModelField modelField )
+        throws ModelloException
     {
         if ( !PRIMITIVE_IDENTITY_MAP.containsKey( modelField.getType() ) )
         {
-            throw new ModelloException( "The JDO mapping generator does not support the specified
" + "field type '"
-                            + modelField.getType() + "'. " + "Supported types: " + PRIMITIVE_IDENTITY_MAP.keySet()
);
+            throw new ModelloException(
+                "The JDO mapping generator does not support the specified " + "field type
'" + modelField.getType()
+                    + "'. " + "Supported types: " + PRIMITIVE_IDENTITY_MAP.keySet() );
         }
     }
 

Modified: archiva/redback/redback-components/trunk/modello-plugins/modello-plugin-redback-registry/src/test/java/org/apache/archiva/redback/components/registry/modello/AbstractRegistryGeneratorTestCase.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/modello-plugins/modello-plugin-redback-registry/src/test/java/org/apache/archiva/redback/components/registry/modello/AbstractRegistryGeneratorTestCase.java?rev=1585087&r1=1585086&r2=1585087&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/modello-plugins/modello-plugin-redback-registry/src/test/java/org/apache/archiva/redback/components/registry/modello/AbstractRegistryGeneratorTestCase.java
(original)
+++ archiva/redback/redback-components/trunk/modello-plugins/modello-plugin-redback-registry/src/test/java/org/apache/archiva/redback/components/registry/modello/AbstractRegistryGeneratorTestCase.java
Sat Apr  5 12:44:37 2014
@@ -116,7 +116,7 @@ public abstract class AbstractRegistryGe
 
         addDependency( "org.codehaus.modello", "modello-test" );//, getModelloVersion() );
 
-        List<String> classPathElements = new ArrayList<String>( getClasspath().size()
+ 2 );
+        List<String> classPathElements = new ArrayList<>( getClasspath().size()
+ 2 );
 
         classPathElements.add( getTestPath( "target/classes" ) );
 

Modified: archiva/redback/redback-components/trunk/spring-cache/spring-cache-test/src/main/java/org/apache/archiva/redback/components/cache/test/AbstractCacheTestCase.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-test/src/main/java/org/apache/archiva/redback/components/cache/test/AbstractCacheTestCase.java?rev=1585087&r1=1585086&r2=1585087&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-test/src/main/java/org/apache/archiva/redback/components/cache/test/AbstractCacheTestCase.java
(original)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-test/src/main/java/org/apache/archiva/redback/components/cache/test/AbstractCacheTestCase.java
Sat Apr  5 12:44:37 2014
@@ -95,7 +95,7 @@ public abstract class AbstractCacheTestC
         }
 
         // Put some holes into the list.
-        List<String> removedKeys = new ArrayList<String>();
+        List<String> removedKeys = new ArrayList<>();
         removedKeys.add( fmt.toText( 4600 ) );
         removedKeys.add( fmt.toText( 4700 ) );
         removedKeys.add( fmt.toText( 4800 ) );

Modified: archiva/redback/redback-components/trunk/spring-quartz/src/main/java/org/apache/archiva/redback/components/scheduler/CronExpressionValidator.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-quartz/src/main/java/org/apache/archiva/redback/components/scheduler/CronExpressionValidator.java?rev=1585087&r1=1585086&r2=1585087&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/spring-quartz/src/main/java/org/apache/archiva/redback/components/scheduler/CronExpressionValidator.java
(original)
+++ archiva/redback/redback-components/trunk/spring-quartz/src/main/java/org/apache/archiva/redback/components/scheduler/CronExpressionValidator.java
Sat Apr  5 12:44:37 2014
@@ -378,7 +378,7 @@ public final class CronExpressionValidat
     {
         StringTokenizer st = new StringTokenizer( value, "," );
 
-        List values = new ArrayList();
+        List<String> values = new ArrayList<>();
 
         while ( st.hasMoreTokens() )
         {
@@ -387,9 +387,9 @@ public final class CronExpressionValidat
 
         int previousValue = -1;
 
-        for ( Iterator i = values.iterator(); i.hasNext(); )
+        for ( Iterator<String> i = values.iterator(); i.hasNext(); )
         {
-            String currentValue = (String) i.next();
+            String currentValue = i.next();
 
             if ( !checkIntValue( currentValue, minimal, maximal ) )
             {

Modified: archiva/redback/redback-components/trunk/spring-registry/spring-registry-commons/src/main/java/org/apache/archiva/redback/components/registry/commons/CommonsConfigurationRegistry.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-registry/spring-registry-commons/src/main/java/org/apache/archiva/redback/components/registry/commons/CommonsConfigurationRegistry.java?rev=1585087&r1=1585086&r2=1585087&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/spring-registry/spring-registry-commons/src/main/java/org/apache/archiva/redback/components/registry/commons/CommonsConfigurationRegistry.java
(original)
+++ archiva/redback/redback-components/trunk/spring-registry/spring-registry-commons/src/main/java/org/apache/archiva/redback/components/registry/commons/CommonsConfigurationRegistry.java
Sat Apr  5 12:44:37 2014
@@ -127,9 +127,9 @@ public class CommonsConfigurationRegistr
         return configuration.getList( key );
     }
 
-    public List getSubsetList( String key )
+    public List<Registry> getSubsetList( String key )
     {
-        List subsets = new ArrayList();
+        List<Registry> subsets = new ArrayList<>();
 
         boolean done = false;
         do

Modified: archiva/redback/redback-components/trunk/spring-taskqueue/src/main/java/org/apache/archiva/redback/components/taskqueue/DefaultTaskQueue.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-taskqueue/src/main/java/org/apache/archiva/redback/components/taskqueue/DefaultTaskQueue.java?rev=1585087&r1=1585086&r2=1585087&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/spring-taskqueue/src/main/java/org/apache/archiva/redback/components/taskqueue/DefaultTaskQueue.java
(original)
+++ archiva/redback/redback-components/trunk/spring-taskqueue/src/main/java/org/apache/archiva/redback/components/taskqueue/DefaultTaskQueue.java
Sat Apr  5 12:44:37 2014
@@ -43,13 +43,13 @@ public class DefaultTaskQueue
 
     private Logger logger = LoggerFactory.getLogger( getClass() );
 
-    private List<TaskEntryEvaluator> taskEntryEvaluators = new ArrayList<TaskEntryEvaluator>();
+    private List<TaskEntryEvaluator> taskEntryEvaluators = new ArrayList<>();
 
-    private List<TaskExitEvaluator> taskExitEvaluators = new ArrayList<TaskExitEvaluator>();
+    private List<TaskExitEvaluator> taskExitEvaluators = new ArrayList<>();
 
-    private List<TaskViabilityEvaluator> taskViabilityEvaluators = new ArrayList<TaskViabilityEvaluator>();
+    private List<TaskViabilityEvaluator> taskViabilityEvaluators = new ArrayList<>();
 
-    private BlockingQueue<Task> queue = new LinkedBlockingQueue<Task>();
+    private BlockingQueue<Task> queue = new LinkedBlockingQueue<>();
 
     // ----------------------------------------------------------------------
     // Component Lifecycle

Modified: archiva/redback/redback-components/trunk/spring-taskqueue/src/test/java/org/apache/archiva/redback/components/taskqueue/BuildProjectTaskViabilityEvaluator.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-taskqueue/src/test/java/org/apache/archiva/redback/components/taskqueue/BuildProjectTaskViabilityEvaluator.java?rev=1585087&r1=1585086&r2=1585087&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/spring-taskqueue/src/test/java/org/apache/archiva/redback/components/taskqueue/BuildProjectTaskViabilityEvaluator.java
(original)
+++ archiva/redback/redback-components/trunk/spring-taskqueue/src/test/java/org/apache/archiva/redback/components/taskqueue/BuildProjectTaskViabilityEvaluator.java
Sat Apr  5 12:44:37 2014
@@ -32,18 +32,18 @@ import java.util.List;
  */
 @Service( "taskViabilityEvaluator#build-project" )
 public class BuildProjectTaskViabilityEvaluator
-    implements TaskViabilityEvaluator
+    implements TaskViabilityEvaluator<BuildProjectTask>
 {
-    public Collection evaluate( Collection tasks )
+    public Collection<Task> evaluate( Collection<BuildProjectTask> tasks )
         throws TaskQueueException
     {
         BuildProjectTask okTask = null;
 
-        List toBeRemoved = new ArrayList( tasks.size() );
+        List<Task> toBeRemoved = new ArrayList<>( tasks.size() );
 
-        for ( Iterator it = tasks.iterator(); it.hasNext(); )
+        for ( Iterator<BuildProjectTask> it = tasks.iterator(); it.hasNext(); )
         {
-            BuildProjectTask buildProjectTask = (BuildProjectTask) it.next();
+            BuildProjectTask buildProjectTask = it.next();
 
             if ( okTask == null )
             {

Modified: archiva/redback/redback-components/trunk/spring-taskqueue/src/test/java/org/apache/archiva/redback/components/taskqueue/TaskQueueTest.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-taskqueue/src/test/java/org/apache/archiva/redback/components/taskqueue/TaskQueueTest.java?rev=1585087&r1=1585086&r2=1585087&view=diff
==============================================================================
--- archiva/redback/redback-components/trunk/spring-taskqueue/src/test/java/org/apache/archiva/redback/components/taskqueue/TaskQueueTest.java
(original)
+++ archiva/redback/redback-components/trunk/spring-taskqueue/src/test/java/org/apache/archiva/redback/components/taskqueue/TaskQueueTest.java
Sat Apr  5 12:44:37 2014
@@ -147,7 +147,7 @@ public class TaskQueueTest
 
         assertEquals( 2, taskQueue.getQueueSnapshot().size() );
 
-        List tasks = new ArrayList();
+        List<Task> tasks = new ArrayList<>();
 
         tasks.add( firstTask );
 



Mime
View raw message