directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r474738 - /directory/branches/apacheds-schema/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java
Date Tue, 14 Nov 2006 11:22:31 GMT
Author: elecharny
Date: Tue Nov 14 03:22:31 2006
New Revision: 474738

URL: http://svn.apache.org/viewvc?view=rev&rev=474738
Log:
End the switch to Enums.

Modified:
    directory/branches/apacheds-schema/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java

Modified: directory/branches/apacheds-schema/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds-schema/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java?view=diff&rev=474738&r1=474737&r2=474738
==============================================================================
--- directory/branches/apacheds-schema/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java
(original)
+++ directory/branches/apacheds-schema/apacheds/core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/DirectorySchemaToolMojo.java
Tue Nov 14 03:22:31 2006
@@ -143,8 +143,8 @@
 
     protected void generateRest( BootstrapSchema schema ) throws Exception
     {
-        List types = new ArrayList();
-        types.addAll( ProducerTypeEnum.list() );
+        List<ProducerTypeEnum> types = new ArrayList<ProducerTypeEnum>();
+        types.addAll( ProducerTypeEnum.getList() );
         types.remove( ProducerTypeEnum.ATTRIBUTE_TYPE_PRODUCER );
         types.remove( ProducerTypeEnum.OBJECT_CLASS_PRODUCER );
 
@@ -166,43 +166,55 @@
             context.put( "type", type.toString().substring( 0, type.toString().length() -
8 ) );
 
             String typeName = null;
+            
             switch ( type )
             {
-                case ( ProducerTypeEnum.COMPARATOR_PRODUCER_VAL  ):
+                case COMPARATOR_PRODUCER :
                     typeName = "ProducerTypeEnum.COMPARATOR_PRODUCER";
                     break;
-                case ( ProducerTypeEnum.DIT_CONTENT_RULE_PRODUCER_VAL  ):
+                    
+                case DIT_CONTENT_RULE_PRODUCER :
                     typeName = "ProducerTypeEnum.DIT_CONTENT_RULE_PRODUCER";
                     break;
-                case ( ProducerTypeEnum.DIT_STRUCTURE_RULE_PRODUCER_VAL  ):
+                    
+                case DIT_STRUCTURE_RULE_PRODUCER :
                     typeName = "ProducerTypeEnum.DIT_STRUCTURE_RULE_PRODUCER";
                     break;
-                case ( ProducerTypeEnum.MATCHING_RULE_PRODUCER_VAL  ):
+                    
+                case MATCHING_RULE_PRODUCER :
                     typeName = "ProducerTypeEnum.MATCHING_RULE_PRODUCER";
                     break;
-                case ( ProducerTypeEnum.MATCHING_RULE_USE_PRODUCER_VAL  ):
+                    
+                case MATCHING_RULE_USE_PRODUCER :
                     typeName = "ProducerTypeEnum.MATCHING_RULE_USE_PRODUCER";
                     break;
-                case ( ProducerTypeEnum.NAME_FORM_PRODUCER_VAL  ):
+                    
+                case NAME_FORM_PRODUCER :
                     typeName = "ProducerTypeEnum.NAME_FORM_PRODUCER";
                     break;
-                case ( ProducerTypeEnum.NORMALIZER_PRODUCER_VAL  ):
+                    
+                case NORMALIZER_PRODUCER :
                     typeName = "ProducerTypeEnum.NORMALIZER_PRODUCER";
                     break;
-                case ( ProducerTypeEnum.SYNTAX_CHECKER_PRODUCER_VAL  ):
+                    
+                case SYNTAX_CHECKER_PRODUCER :
                     typeName = "ProducerTypeEnum.SYNTAX_CHECKER_PRODUCER";
                     break;
-                case ( ProducerTypeEnum.SYNTAX_PRODUCER_VAL  ):
+                    
+                case SYNTAX_PRODUCER :
                     typeName = "ProducerTypeEnum.SYNTAX_PRODUCER";
                     break;
-                case ( ProducerTypeEnum.STATE_FACTORY_PRODUCER_VAL  ):
+                    
+                case STATE_FACTORY_PRODUCER :
                     typeName = "ProducerTypeEnum.STATE_FACTORY_PRODUCER";
                     break;
-                case ( ProducerTypeEnum.OBJECT_FACTORY_PRODUCER_VAL  ):
+                    
+                case OBJECT_FACTORY_PRODUCER :
                     typeName = "ProducerTypeEnum.OBJECT_FACTORY_PRODUCER";
                     break;
+                    
                 default:
-                    throw new IllegalStateException( "Unexpected producer: " + type.getName()
);
+                    throw new IllegalStateException( "Unexpected producer: " + type );
             }
 
             context.put( "typeName", typeName );



Mime
View raw message