directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r559810 - /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/schemachecker/SchemaChecker.java
Date Thu, 26 Jul 2007 13:36:58 GMT
Author: pamarcelot
Date: Thu Jul 26 06:36:57 2007
New Revision: 559810

URL: http://svn.apache.org/viewvc?view=rev&rev=559810
Log:
Improved Schema Checker problem detection.

Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/schemachecker/SchemaChecker.java

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/schemachecker/SchemaChecker.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/schemachecker/SchemaChecker.java?view=diff&rev=559810&r1=559809&r2=559810
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/schemachecker/SchemaChecker.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/model/schemachecker/SchemaChecker.java
Thu Jul 26 06:36:57 2007
@@ -90,13 +90,21 @@
 
         public void attributeTypeModified( AttributeTypeImpl at )
         {
+            List<?> deps = ( List<?> ) dependenciesMap.get( at );
+
             checkAttributeType( at );
+
+            checkDependencies( deps );
         }
 
 
         public void attributeTypeRemoved( AttributeTypeImpl at )
         {
+            List<?> deps = ( List<?> ) dependenciesMap.get( at );
+
             removeSchemaObject( at );
+
+            checkDependencies( deps );
         }
 
 
@@ -108,13 +116,21 @@
 
         public void objectClassModified( ObjectClassImpl oc )
         {
+            List<?> deps = ( List<?> ) dependenciesMap.get( oc );
+
             checkObjectClass( oc );
+
+            checkDependencies( deps );
         }
 
 
         public void objectClassRemoved( ObjectClassImpl oc )
         {
+            List<?> deps = ( List<?> ) dependenciesMap.get( oc );
+
             removeSchemaObject( oc );
+
+            checkDependencies( deps );
         }
 
 
@@ -587,8 +603,8 @@
             {
                 errorsList.remove( error );
             }
+            errorsMap.remove( element );
         }
-        errorsMap.remove( element );
         List<?> warnings = ( List<?> ) warningsMap.get( element );
         if ( ( warnings != null ) && ( warnings.size() >= 1 ) )
         {
@@ -596,8 +612,25 @@
             {
                 warningsList.remove( warning );
             }
+            warningsMap.remove( element );
+        }
+
+        // Removing 'depends on' and dependencies
+        List<?> dependsOn = ( List<?> ) dependsOnMap.get( element );
+        if ( dependsOn != null )
+        {
+            for ( Object dep : dependsOn )
+            {
+                dependenciesMap.remove( dep, element );
+            }
+            dependsOnMap.remove( element );
+        }
+
+        if ( notify )
+        {
+            notifyListeners();
         }
-        warningsMap.remove( element );
+
     }
 
 
@@ -771,6 +804,31 @@
         else
         {
             return warnings.size() > 0;
+        }
+    }
+
+
+    /**
+     * Checks the given list of dependencies.
+     * 
+     * @param deps
+     *      the list of dependencies
+     */
+    public void checkDependencies( List<?> deps )
+    {
+        if ( deps != null )
+        {
+            for ( Object object : deps )
+            {
+                if ( object instanceof AttributeTypeImpl )
+                {
+                    checkAttributeType( ( AttributeTypeImpl ) object );
+                }
+                else if ( object instanceof ObjectClassImpl )
+                {
+                    checkObjectClass( ( ObjectClassImpl ) object );
+                }
+            }
         }
     }
 }



Mime
View raw message