directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r588760 - in /directory/studio/trunk: studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/ studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/ studio-lda...
Date Fri, 26 Oct 2007 19:38:17 GMT
Author: seelmann
Date: Fri Oct 26 12:38:15 2007
New Revision: 588760

URL: http://svn.apache.org/viewvc?rev=588760&view=rev
Log:
Removed ModelModificationException

Removed:
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ModelModificationException.java
Modified:
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/DeleteAction.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/NewAttributeAction.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MultivaluedDialog.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAttributeModificationJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractNotificationJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameValuesJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IAttribute.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Attribute.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ModelConverter.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorCellModifier.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryAttributesWizardPage.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryDnWizardPage.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java
    directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/LdifEntryEditorDialog.java
    directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifAttributeAction.java

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/DeleteAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/DeleteAction.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/DeleteAction.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/DeleteAction.java Fri Oct 26 12:38:15 2007
@@ -40,7 +40,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.RDNPart;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.ObjectClassDescription;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
@@ -290,13 +289,7 @@
                         }
                         if ( att.getValueSize() == 0 )
                         {
-                            try
-                            {
-                                att.getEntry().deleteAttribute( att );
-                            }
-                            catch ( ModelModificationException e )
-                            {
-                            }
+                            att.getEntry().deleteAttribute( att );
                             it.remove();
                         }
                     }

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/NewAttributeAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/NewAttributeAction.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/NewAttributeAction.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/NewAttributeAction.java Fri Oct 26 12:38:15 2007
@@ -26,12 +26,9 @@
 import org.apache.directory.studio.ldapbrowser.common.wizards.AttributeWizard;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute;
-import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Display;
 
 
 /**
@@ -95,22 +92,14 @@
                 String newAttributeDescription = wizard.getAttributeDescription();
                 if ( newAttributeDescription != null && !"".equals( newAttributeDescription ) )
                 {
-                    try
+                    IAttribute att = entry.getAttribute( newAttributeDescription );
+                    if ( att == null )
                     {
-                        IAttribute att = entry.getAttribute( newAttributeDescription );
-                        if ( att == null )
-                        {
-                            att = new Attribute( entry, newAttributeDescription );
-                            entry.addAttribute( att ) ;
-                        }
-
-                        att.addEmptyValue();
-                    }
-                    catch ( ModelModificationException mme )
-                    {
-                        MessageDialog.openError( Display.getDefault().getActiveShell(), "Error While Adding Attribute",
-                            mme.getMessage() );
+                        att = new Attribute( entry, newAttributeDescription );
+                        entry.addAttribute( att ) ;
                     }
+
+                    att.addEmptyValue();
                 }
             }
         }

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MultivaluedDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MultivaluedDialog.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MultivaluedDialog.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MultivaluedDialog.java Fri Oct 26 12:38:15 2007
@@ -42,7 +42,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
@@ -165,9 +164,9 @@
             dispose();
 
             // cleanup attribute hierarchy after editing
-            for ( Iterator it = attributeHierarchie.iterator(); it.hasNext(); )
+            for ( Iterator<IAttribute> it = attributeHierarchie.iterator(); it.hasNext(); )
             {
-                IAttribute attribute = ( IAttribute ) it.next();
+                IAttribute attribute = it.next();
                 if ( attribute != null )
                 {
                     // remove empty values
@@ -180,16 +179,10 @@
                         }
                     }
 
-                    // deltet attribute from entry if all values were deleted
+                    // delete attribute from entry if all values were deleted
                     if ( attribute.getValueSize() == 0 )
                     {
-                        try
-                        {
-                            attribute.getEntry().deleteAttribute( attribute );
-                        }
-                        catch ( ModelModificationException e )
-                        {
-                        }
+                        attribute.getEntry().deleteAttribute( attribute );
                     }
                 }
             }
@@ -257,9 +250,9 @@
             .getOpenDefaultEditorAction() );
 
         // start edit mode if an empty value exists
-        for ( Iterator it = attributeHierarchie.iterator(); it.hasNext(); )
+        for ( Iterator<IAttribute> it = attributeHierarchie.iterator(); it.hasNext(); )
         {
-            IAttribute attribute = ( IAttribute ) it.next();
+            IAttribute attribute = it.next();
             IValue[] values = attribute.getValues();
             for ( int i = 0; i < values.length; i++ )
             {
@@ -321,15 +314,9 @@
             if ( attributeHierarchie == null )
             {
                 EventRegistry.suspendEventFireingInCurrentThread();
-                try
-                {
-                    IAttribute attribute = new Attribute( entry, attributeDescription );
-                    entry.addAttribute( attribute );
-                    attribute.addEmptyValue();
-                }
-                catch ( ModelModificationException e )
-                {
-                }
+                IAttribute attribute = new Attribute( entry, attributeDescription );
+                entry.addAttribute( attribute );
+                attribute.addEmptyValue();
                 EventRegistry.resumeEventFireingInCurrentThread();
                 attributeHierarchie = entry.getAttributeWithSubtypes( attributeDescription );
             }

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/valueeditors/ValueEditorManager.java Fri Oct 26 12:38:15 2007
@@ -24,7 +24,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
@@ -40,7 +39,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.AttributeTypeDescription;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.LdapSyntaxDescription;
@@ -145,10 +143,9 @@
             this.defaultStringMultiLineValueEditor.dispose();
             this.defaultBinaryValueEditor.dispose();
 
-            for ( Iterator it = this.class2ValueEditors.values().iterator(); it.hasNext(); )
+            for ( IValueEditor ve : class2ValueEditors.values() )
             {
-                IValueEditor vp = ( IValueEditor ) it.next();
-                vp.dispose();
+                ve.dispose();
             }
 
             this.parent = null;
@@ -519,7 +516,6 @@
      * @throws ModelModificationException the model modification exception
      */
     public void createValue( IEntry entry, String attributeDescription, Object newRawValue )
-        throws ModelModificationException
     {
         if ( entry != null && attributeDescription != null && newRawValue != null
             && ( newRawValue instanceof byte[] || newRawValue instanceof String ) )

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAttributeModificationJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAttributeModificationJob.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAttributeModificationJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractAttributeModificationJob.java Fri Oct 26 12:38:15 2007
@@ -24,7 +24,6 @@
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 
 
 /**
@@ -40,7 +39,7 @@
     /**
      * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractNotificationJob#executeNotificationJob(org.apache.directory.studio.connection.core.StudioProgressMonitor)
      */
-    protected void executeNotificationJob( StudioProgressMonitor monitor ) throws ModelModificationException
+    protected void executeNotificationJob( StudioProgressMonitor monitor )
     {
         try
         {
@@ -79,11 +78,8 @@
      * Execute the attribute modification job.
      * 
      * @param monitor the progress monitor
-     * 
-     * @throws ModelModificationException the model modification exception
      */
-    protected abstract void executeAttributeModificationJob( StudioProgressMonitor monitor )
-        throws ModelModificationException;
+    protected abstract void executeAttributeModificationJob( StudioProgressMonitor monitor );
 
 
     /**

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractNotificationJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractNotificationJob.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractNotificationJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractNotificationJob.java Fri Oct 26 12:38:15 2007
@@ -23,7 +23,6 @@
 
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 
 
 /**
@@ -35,7 +34,7 @@
 public abstract class AbstractNotificationJob extends AbstractEclipseJob
 {
 
-    protected final void executeAsyncJob( StudioProgressMonitor pm ) throws ModelModificationException
+    protected final void executeAsyncJob( StudioProgressMonitor pm )
     {
         EventRegistry.suspendEventFireingInCurrentThread();
 
@@ -56,10 +55,8 @@
      * Executes the job.
      * 
      * @param pm monitor progress monitor
-     * 
-     * @throws ModelModificationException the model modification exception
      */
-    protected abstract void executeNotificationJob( StudioProgressMonitor monitor ) throws ModelModificationException;
+    protected abstract void executeNotificationJob( StudioProgressMonitor monitor );
 
 
     /**

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java Fri Oct 26 12:38:15 2007
@@ -40,7 +40,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Value;
 
@@ -96,7 +95,7 @@
     /**
      * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractAttributeModificationJob#executeAttributeModificationJob(org.apache.directory.studio.connection.core.StudioProgressMonitor)
      */
-    protected void executeAttributeModificationJob( StudioProgressMonitor monitor ) throws ModelModificationException
+    protected void executeAttributeModificationJob( StudioProgressMonitor monitor )
     {
         monitor.beginTask( valuesToCreate.length == 1 ? BrowserCoreMessages.jobs__create_values_task_1
             : BrowserCoreMessages.jobs__create_values_task_n, 2 );
@@ -184,11 +183,9 @@
      * @param entryToModify the entry to modify
      * @param valuesToCreate the values to create
      * @param monitor the progress monitor
-     * 
-     * @throws ModelModificationException
      */
     static void createValues( IBrowserConnection browserConnection, IEntry entryToModify, IValue[] valuesToCreate,
-        StudioProgressMonitor monitor ) throws ModelModificationException
+        StudioProgressMonitor monitor )
     {
         if ( browserConnection.getConnection() != null )
         {

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java Fri Oct 26 12:38:15 2007
@@ -44,7 +44,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 
 
 /**
@@ -128,7 +127,7 @@
     /**
      * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractAttributeModificationJob#executeAttributeModificationJob(org.apache.directory.studio.connection.core.StudioProgressMonitor)
      */
-    protected void executeAttributeModificationJob( StudioProgressMonitor monitor ) throws ModelModificationException
+    protected void executeAttributeModificationJob( StudioProgressMonitor monitor )
     {
         monitor.beginTask(
             attributesToDelete.length + valuesToDelete.length == 1 ? BrowserCoreMessages.jobs__delete_attributes_task_1
@@ -216,12 +215,9 @@
      * @param attributesToDelete the attributes to delete
      * @param valuesToDelete the values to delete
      * @param monitor the progress monitor
-     * 
-     * @throws ModelModificationException the model modification exception
      */
     static void deleteAttributesAndValues( IBrowserConnection browserConnection, IEntry entry,
         IAttribute[] attributesToDelete, IValue[] valuesToDelete, StudioProgressMonitor monitor )
-        throws ModelModificationException
     {
         if ( browserConnection.getConnection() != null )
         {

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java Fri Oct 26 12:38:15 2007
@@ -55,7 +55,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.NameException;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifEnumeration;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifChangeAddRecord;
@@ -152,7 +151,7 @@
     /**
      * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractNotificationJob#executeNotificationJob(org.apache.directory.studio.connection.core.StudioProgressMonitor)
      */
-    protected void executeNotificationJob( StudioProgressMonitor monitor ) throws ModelModificationException
+    protected void executeNotificationJob( StudioProgressMonitor monitor )
     {
         monitor.beginTask( BrowserCoreMessages.jobs__import_ldif_task, 2 );
         monitor.reportProgress( " " ); //$NON-NLS-1$

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java Fri Oct 26 12:38:15 2007
@@ -37,7 +37,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Value;
 
 
@@ -81,7 +80,7 @@
     /**
      * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractAttributeModificationJob#executeAttributeModificationJob(org.apache.directory.studio.connection.core.StudioProgressMonitor)
      */
-    protected void executeAttributeModificationJob( StudioProgressMonitor monitor ) throws ModelModificationException
+    protected void executeAttributeModificationJob( StudioProgressMonitor monitor )
     {
         monitor.beginTask( BrowserCoreMessages.jobs__modify_value_task, 2 );
         monitor.reportProgress( " " ); //$NON-NLS-1$
@@ -154,11 +153,9 @@
      * @param oldValue the old value
      * @param newValue the new value
      * @param monitor the progress monitor
-     * 
-     * @throws ModelModificationException
      */
     private void modifyValue( IBrowserConnection browserConnection, IEntry entry, IValue oldValue, IValue newValue,
-        StudioProgressMonitor monitor ) throws ModelModificationException
+        StudioProgressMonitor monitor )
     {
         if ( browserConnection.getConnection() != null )
         {

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java Fri Oct 26 12:38:15 2007
@@ -29,7 +29,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
@@ -114,12 +113,11 @@
     /**
      * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractNotificationJob#executeNotificationJob(org.apache.directory.studio.connection.core.StudioProgressMonitor)
      */
-    protected void executeNotificationJob( StudioProgressMonitor pm ) throws ModelModificationException
+    protected void executeNotificationJob( StudioProgressMonitor pm )
     {
         readEntry = browserConnection.getEntryFromCache( dn );
         if ( readEntry == null )
         {
-
             pm.beginTask( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__read_entry_task, new String[]
                 { dn.toString() } ), 2 );
             pm.reportProgress( " " ); //$NON-NLS-1$

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameValuesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameValuesJob.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameValuesJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameValuesJob.java Fri Oct 26 12:38:15 2007
@@ -33,7 +33,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Value;
 
@@ -81,7 +80,7 @@
     /**
      * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractAttributeModificationJob#executeAttributeModificationJob(org.apache.directory.studio.connection.core.StudioProgressMonitor)
      */
-    protected void executeAttributeModificationJob( StudioProgressMonitor monitor ) throws ModelModificationException
+    protected void executeAttributeModificationJob( StudioProgressMonitor monitor )
     {
         monitor.beginTask( oldValues.length == 1 ? BrowserCoreMessages.jobs__rename_value_task_1
             : BrowserCoreMessages.jobs__rename_value_task_n, 2 );

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java Fri Oct 26 12:38:15 2007
@@ -51,7 +51,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IRootDSE;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.ReferralException;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
@@ -598,11 +597,9 @@
      * @param entry the entry
      * @param sr the JNDI search result
      * @param searchParameter the search parameters
-     * 
-     * @throws ModelModificationException the model modification exception
      */
     private static void fillAttributes( IEntry entry, SearchResult sr, SearchParameter searchParameter )
-        throws ModelModificationException, NamingException
+        throws NamingException
     {
         if ( searchParameter.getReturningAttributes() == null || searchParameter.getReturningAttributes().length > 0 )
         {
@@ -620,13 +617,7 @@
                     {
                         if ( !oldAttributes[i].isOperationalAttribute() )
                         {
-                            try
-                            {
-                                entry.deleteAttribute( oldAttributes[i] );
-                            }
-                            catch ( ModelModificationException e )
-                            {
-                            }
+                            entry.deleteAttribute( oldAttributes[i] );
                         }
                     }
                 }
@@ -640,13 +631,7 @@
                     {
                         if ( oldAttributes[i].isOperationalAttribute() )
                         {
-                            try
-                            {
-                                entry.deleteAttribute( oldAttributes[i] );
-                            }
-                            catch ( ModelModificationException e )
-                            {
-                            }
+                            entry.deleteAttribute( oldAttributes[i] );
                         }
                     }
                 }
@@ -660,13 +645,7 @@
                         for ( Iterator<IAttribute> it = ah.iterator(); it.hasNext(); )
                         {
                             IAttribute attribute = it.next();
-                            try
-                            {
-                                entry.deleteAttribute( attribute );
-                            }
-                            catch ( ModelModificationException e )
-                            {
-                            }
+                            entry.deleteAttribute( attribute );
                         }
                     }
                 }
@@ -677,13 +656,7 @@
                 IAttribute[] oldAttributes = entry.getAttributes();
                 for ( int i = 0; oldAttributes != null && i < oldAttributes.length; i++ )
                 {
-                    try
-                    {
-                        entry.deleteAttribute( oldAttributes[i] );
-                    }
-                    catch ( ModelModificationException e )
-                    {
-                    }
+                    entry.deleteAttribute( oldAttributes[i] );
                 }
             }
 
@@ -696,13 +669,7 @@
                 IAttribute oldAttribute = entry.getAttribute( attributeDescription );
                 if ( oldAttribute != null )
                 {
-                    try
-                    {
-                        entry.deleteAttribute( oldAttribute );
-                    }
-                    catch ( ModelModificationException mme )
-                    {
-                    }
+                    entry.deleteAttribute( oldAttribute );
                 }
             }
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IAttribute.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IAttribute.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IAttribute.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IAttribute.java Fri Oct 26 12:38:15 2007
@@ -244,11 +244,11 @@
      * 
      * @param valueToAdd
      *                the value to add
-     * @throws ModelModificationException
+     * @throws IllegalArgumentException
      *                 if the value is null or if the value's attribute
      *                 isn't this attribute.
      */
-    public abstract void addValue( IValue valueToAdd ) throws ModelModificationException;
+    public abstract void addValue( IValue valueToAdd ) throws IllegalArgumentException;
 
 
     /**
@@ -256,11 +256,11 @@
      * 
      * @param valueToDelete
      *                the value to delete
-     * @throws ModelModificationException
+     * @throws IllegalArgumentException
      *                 if the value is null or if the value's attribute
      *                 isn't this attribute.
      */
-    public abstract void deleteValue( IValue valueToDelete ) throws ModelModificationException;
+    public abstract void deleteValue( IValue valueToDelete ) throws IllegalArgumentException;
 
 
     /**
@@ -270,12 +270,12 @@
      *                the value that should be replaced
      * @param newValue
      *                the value that should be added
-     * @throws ModelModificationException
+     * @throws IllegalArgumentException
      *                 if the value is null or if the value's attribute
      *                 isn't this attribute.
      */
     public abstract void modifyValue( IValue oldValue, IValue newValue )
-        throws ModelModificationException;
+        throws IllegalArgumentException;
 
 
     /**

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java Fri Oct 26 12:38:15 2007
@@ -62,11 +62,11 @@
      * 
      * @param attributeToAdd
      *                the attribute to add
-     * @throws ModelModificationException
-     *                 if the attribute is alreade present in this entry or
+     * @throws IllegalArgumentException
+     *                 if the attribute is already present in this entry or
      *                 if the attribute's entry isn't this entry.
      */
-    public abstract void addAttribute( IAttribute attributeToAdd ) throws ModelModificationException;
+    public abstract void addAttribute( IAttribute attributeToAdd ) throws IllegalArgumentException;
 
 
     /**
@@ -74,10 +74,10 @@
      * 
      * @param attributeToDelete
      *                the attribute to delete
-     * @throws ModelModificationException
+     * @throws IllegalArgumentException
      *                 if the attribute isn't present in this entry.
      */
-    public abstract void deleteAttribute( IAttribute attributeToDelete ) throws ModelModificationException;
+    public abstract void deleteAttribute( IAttribute attributeToDelete ) throws IllegalArgumentException;
 
 
     /**
@@ -85,7 +85,7 @@
      * conditions must be fulfilled:
      * 
      * <ul>
-     * <li>The objectClass attrbute must be present</li>
+     * <li>The objectClass attribute must be present</li>
      * <li>All must attributes must be present</li>
      * <li>There mustn't be any empty value</li>
      * </ul>
@@ -96,9 +96,7 @@
 
 
     /**
-     * TODO: still needed?
-     * 
-     * Indicates wheter this entry exists in directory. Otherwise it
+     * Indicates whether this entry exists in directory. Otherwise it
      * is a new entry created from the user and not still written to directory.
      * 
      * @return true it this entry is a directory entry
@@ -107,9 +105,7 @@
 
 
     /**
-     * TODO: still needed?
-     * 
-     * Sets wheter this entry exists in directory.
+     * Sets whether this entry exists in directory.
      * 
      * @param isDirectoryEntry
      *                true if this entry exists in directory.
@@ -118,7 +114,7 @@
 
 
     /**
-     * Indicates wheter this entry is an alias entry.
+     * Indicates whether this entry is an alias entry.
      * 
      * An entry is an alias entry if it has the object class 'alias'.
      * 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java Fri Oct 26 12:38:15 2007
@@ -45,7 +45,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.RDN;
 import org.apache.directory.studio.ldapbrowser.core.model.URL;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.AttributeTypeDescription;
@@ -54,6 +53,12 @@
 import org.eclipse.search.ui.ISearchPageScoreComputer;
 
 
+/**
+ * Base implementation of the {@link IEntry} interface.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public abstract class AbstractEntry implements IEntry
 {
 
@@ -118,9 +123,8 @@
     }
 
 
-    public void addAttribute( IAttribute attributeToAdd ) throws ModelModificationException
+    public void addAttribute( IAttribute attributeToAdd ) throws IllegalArgumentException
     {
-
         String oidString = attributeToAdd.getAttributeDescription().toOidString( getBrowserConnection().getSchema() );
 
         AttributeInfo ai = this.getJNDIConnection().getAttributeInfo( this );
@@ -132,38 +136,24 @@
 
         if ( !this.equals( attributeToAdd.getEntry() ) )
         {
-            throw new ModelModificationException( BrowserCoreMessages.model__attributes_entry_is_not_myself );
+            throw new IllegalArgumentException( BrowserCoreMessages.model__attributes_entry_is_not_myself );
         }
-        // else
-        // if(ai.attributeMap.containsKey(attributeToAdd.getDescription().toLowerCase()))
-        // {
         else if ( ai.attributeMap.containsKey( oidString.toLowerCase() ) )
         {
-            throw new ModelModificationException( BrowserCoreMessages.model__attribute_already_exists );
+            throw new IllegalArgumentException( BrowserCoreMessages.model__attribute_already_exists );
         }
         else
         {
-            // ai.attributeMap.put(attributeToAdd.getDescription().toLowerCase(),
-            // attributeToAdd);
             ai.attributeMap.put( oidString.toLowerCase(), attributeToAdd );
             this.entryModified( new AttributeAddedEvent( this.getJNDIConnection(), this, attributeToAdd ) );
         }
     }
 
 
-    public void deleteAttribute( IAttribute attributeToDelete ) throws ModelModificationException
+    public void deleteAttribute( IAttribute attributeToDelete ) throws IllegalArgumentException
     {
-
         String oidString = attributeToDelete.getAttributeDescription().toOidString( getBrowserConnection().getSchema() );
-
         AttributeInfo ai = this.getJNDIConnection().getAttributeInfo( this );
-
-        // if(ai != null && ai.attributeMap != null &&
-        // ai.attributeMap.containsKey(attributeToDelete.getDescription().toLowerCase()))
-        // {
-        // IAttribute attribute =
-        // (IAttribute)ai.attributeMap.get(attributeToDelete.getDescription().toLowerCase());
-        // ai.attributeMap.remove(attributeToDelete.getDescription().toLowerCase());
         if ( ai != null && ai.attributeMap != null && ai.attributeMap.containsKey( oidString.toLowerCase() ) )
         {
             IAttribute attribute = ( IAttribute ) ai.attributeMap.get( oidString.toLowerCase() );
@@ -176,17 +166,13 @@
         }
         else
         {
-            throw new ModelModificationException( BrowserCoreMessages.model__attribute_does_not_exist );
+            throw new IllegalArgumentException( BrowserCoreMessages.model__attribute_does_not_exist );
         }
     }
 
 
     public boolean isConsistent()
     {
-
-        // if(!this.isAttributesInitialized() && this.isDirectoryEntry())
-        // return true;
-
         AttributeInfo ai = this.getJNDIConnection().getAttributeInfo( this );
 
         if ( ai == null || ai.attributeMap == null )

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Attribute.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Attribute.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Attribute.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Attribute.java Fri Oct 26 12:38:15 2007
@@ -40,7 +40,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.AttributeTypeDescription;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
 import org.eclipse.search.ui.ISearchPageScoreComputer;
@@ -108,9 +107,8 @@
             return false;
         }
 
-        for ( Iterator it = valueList.iterator(); it.hasNext(); )
+        for ( IValue value : valueList )
         {
-            IValue value = ( IValue ) it.next();
             if ( value.isEmpty() )
             {
                 return false;
@@ -133,9 +131,8 @@
         else
         {
             String[] mustAttributeNames = getEntry().getSubschema().getMustAttributeNames();
-            for ( int i = 0; i < mustAttributeNames.length; i++ )
+            for ( String must : mustAttributeNames )
             {
-                String must = mustAttributeNames[i];
                 if ( must.equalsIgnoreCase( getType() ) )
                 {
                     return true;
@@ -198,7 +195,7 @@
     {
         IValue emptyValue = new Value( this );
         valueList.add( emptyValue );
-        this.attributeModified( new EmptyValueAddedEvent( getEntry().getBrowserConnection(), getEntry(), this, emptyValue ) );
+        attributeModified( new EmptyValueAddedEvent( getEntry().getBrowserConnection(), getEntry(), this, emptyValue ) );
     }
 
 
@@ -207,13 +204,14 @@
      */
     public void deleteEmptyValue()
     {
-        for ( Iterator it = this.valueList.iterator(); it.hasNext(); )
+        for ( Iterator<IValue> it = this.valueList.iterator(); it.hasNext(); )
         {
-            IValue value = ( IValue ) it.next();
+            IValue value = it.next();
             if ( value.isEmpty() )
             {
                 it.remove();
-                attributeModified( new EmptyValueDeletedEvent( getEntry().getBrowserConnection(), getEntry(), this, value ) );
+                attributeModified( new EmptyValueDeletedEvent( getEntry().getBrowserConnection(), getEntry(), this,
+                    value ) );
                 return;
             }
         }
@@ -235,17 +233,17 @@
      * Checks if the given value is valid.
      *
      * @param value the value to check
-     * @throws ModelModificationException if the value is not valid
+     * @throws IllegalArgumentException if the value is not valid
      */
-    private void checkValue( IValue value ) throws ModelModificationException
+    private void checkValue( IValue value ) throws IllegalArgumentException
     {
         if ( value == null )
         {
-            throw new ModelModificationException( BrowserCoreMessages.model__empty_value );
+            throw new IllegalArgumentException( BrowserCoreMessages.model__empty_value );
         }
         if ( !value.getAttribute().equals( this ) )
         {
-            throw new ModelModificationException( BrowserCoreMessages.model__values_attribute_is_not_myself );
+            throw new IllegalArgumentException( BrowserCoreMessages.model__values_attribute_is_not_myself );
         }
     }
 
@@ -258,9 +256,9 @@
      */
     private boolean internalDeleteValue( IValue valueToDelete )
     {
-        for ( Iterator it = valueList.iterator(); it.hasNext(); )
+        for ( Iterator<IValue> it = valueList.iterator(); it.hasNext(); )
         {
-            IValue value = ( IValue ) it.next();
+            IValue value = it.next();
             if ( value.equals( valueToDelete ) )
             {
                 it.remove();
@@ -274,10 +272,9 @@
     /**
      * {@inheritDoc}
      */
-    public void addValue( IValue valueToAdd ) throws ModelModificationException
+    public void addValue( IValue valueToAdd ) throws IllegalArgumentException
     {
-        this.checkValue( valueToAdd );
-
+        checkValue( valueToAdd );
         valueList.add( valueToAdd );
         attributeModified( new ValueAddedEvent( getEntry().getBrowserConnection(), getEntry(), this, valueToAdd ) );
     }
@@ -286,13 +283,14 @@
     /**
      * {@inheritDoc}
      */
-    public void deleteValue( IValue valueToDelete ) throws ModelModificationException
+    public void deleteValue( IValue valueToDelete ) throws IllegalArgumentException
     {
-        this.checkValue( valueToDelete );
+        checkValue( valueToDelete );
 
-        if ( this.internalDeleteValue( valueToDelete ) )
+        if ( internalDeleteValue( valueToDelete ) )
         {
-            this.attributeModified( new ValueDeletedEvent( getEntry().getBrowserConnection(), getEntry(), this, valueToDelete ) );
+            attributeModified( new ValueDeletedEvent( getEntry().getBrowserConnection(), getEntry(), this,
+                valueToDelete ) );
         }
     }
 
@@ -300,14 +298,14 @@
     /**
      * {@inheritDoc}
      */
-    public void modifyValue( IValue oldValue, IValue newValue ) throws ModelModificationException
+    public void modifyValue( IValue oldValue, IValue newValue ) throws IllegalArgumentException
     {
-        this.checkValue( oldValue );
-        this.checkValue( newValue );
+        checkValue( oldValue );
+        checkValue( newValue );
 
-        this.internalDeleteValue( oldValue );
-        this.valueList.add( newValue );
-        this.attributeModified( new ValueModifiedEvent( getEntry().getBrowserConnection(), getEntry(), this, oldValue,
+        internalDeleteValue( oldValue );
+        valueList.add( newValue );
+        attributeModified( new ValueModifiedEvent( getEntry().getBrowserConnection(), getEntry(), this, oldValue,
             newValue ) );
     }
 
@@ -326,7 +324,7 @@
      */
     public int getValueSize()
     {
-        return this.valueList.size();
+        return valueList.size();
     }
 
 
@@ -397,9 +395,9 @@
         List<byte[]> binaryValueList = new ArrayList<byte[]>();
 
         IValue[] values = getValues();
-        for ( int i = 0; i < values.length; i++ )
+        for ( IValue value : values )
         {
-            binaryValueList.add( values[i].getBinaryValue() );
+            binaryValueList.add( value.getBinaryValue() );
         }
 
         return binaryValueList.toArray( new byte[0][] );
@@ -430,9 +428,9 @@
         List<String> stringValueList = new ArrayList<String>();
 
         IValue[] values = getValues();
-        for ( int i = 0; i < values.length; i++ )
+        for ( IValue value : values )
         {
-            stringValueList.add( values[i].getStringValue() );
+            stringValueList.add( value.getStringValue() );
         }
 
         return stringValueList.toArray( new String[stringValueList.size()] );
@@ -451,6 +449,7 @@
     /**
      * {@inheritDoc}
      */
+    @SuppressWarnings("unchecked")
     public Object getAdapter( Class adapter )
     {
         Class<?> clazz = ( Class<?> ) adapter;

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java Fri Oct 26 12:38:15 2007
@@ -41,7 +41,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.RDN;
 import org.apache.directory.studio.ldapbrowser.core.model.URL;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Subschema;
@@ -154,7 +153,7 @@
     }
 
 
-    public void addAttribute( IAttribute attributeToAdd ) throws ModelModificationException
+    public void addAttribute( IAttribute attributeToAdd )
     {
         if ( this.getDelegate() != null )
             getDelegate().addAttribute( attributeToAdd );
@@ -168,7 +167,7 @@
     }
 
 
-    public void deleteAttribute( IAttribute attributeToDelete ) throws ModelModificationException
+    public void deleteAttribute( IAttribute attributeToDelete )
     {
         if ( this.getDelegate() != null )
             getDelegate().deleteAttribute( attributeToDelete );

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java Fri Oct 26 12:38:15 2007
@@ -38,7 +38,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.RDN;
 import org.apache.directory.studio.ldapbrowser.core.model.URL;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.ObjectClassDescription;
@@ -86,7 +85,7 @@
     }
 
 
-    public void addAttribute( IAttribute attributeToAdd ) throws ModelModificationException
+    public void addAttribute( IAttribute attributeToAdd )
     {
         attributeMap.put( attributeToAdd.getDescription().toLowerCase(), attributeToAdd );
         EventRegistry.fireEntryUpdated( new AttributeAddedEvent( attributeToAdd.getEntry().getBrowserConnection(), this,
@@ -99,7 +98,7 @@
     }
 
 
-    public void deleteAttribute( IAttribute attributeToDelete ) throws ModelModificationException
+    public void deleteAttribute( IAttribute attributeToDelete )
     {
         attributeMap.remove( attributeToDelete.getDescription().toLowerCase() );
         EventRegistry.fireEntryUpdated( new AttributeDeletedEvent( attributeToDelete.getEntry().getBrowserConnection(), this,
@@ -306,17 +305,6 @@
     public boolean isChildrenInitialized()
     {
         return false;
-    }
-
-
-    public void moveTo( IEntry newParent ) throws ModelModificationException
-    {
-    }
-
-
-    public void rename( RDN newRdn, boolean deleteOldRdn ) throws ModelModificationException
-    {
-
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ModelConverter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ModelConverter.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ModelConverter.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ModelConverter.java Fri Oct 26 12:38:15 2007
@@ -30,7 +30,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.NameException;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry;
@@ -60,11 +59,10 @@
      *
      * @return the resulting dummy entry
      *
-     * @throws ModelModificationException the model modification exception
      * @throws NameException the name exception
      */
     public static DummyEntry ldifContentRecordToEntry( LdifContentRecord ldifContentRecord, IBrowserConnection connection )
-        throws NameException, ModelModificationException
+        throws NameException
     {
         return createIntern( ldifContentRecord, connection );
     }
@@ -78,11 +76,10 @@
      *
      * @return the resulting dummy entry
      *
-     * @throws ModelModificationException the model modification exception
      * @throws NameException the name exception
      */
     public static DummyEntry ldifChangeAddRecordToEntry( LdifChangeAddRecord ldifChangeAddRecord, IBrowserConnection connection )
-        throws NameException, ModelModificationException
+        throws NameException
     {
         return createIntern( ldifChangeAddRecord, connection );
     }
@@ -96,11 +93,9 @@
      *
      * @return the dummy entry
      *
-     * @throws ModelModificationException the model modification exception
      * @throws NameException the name exception
      */
-    private static DummyEntry createIntern( LdifRecord ldifRecord, IBrowserConnection connection ) throws NameException,
-        ModelModificationException
+    private static DummyEntry createIntern( LdifRecord ldifRecord, IBrowserConnection connection ) throws NameException
     {
         LdifPart[] parts = ldifRecord.getParts();
 

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorCellModifier.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorCellModifier.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorCellModifier.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorCellModifier.java Fri Oct 26 12:38:15 2007
@@ -26,12 +26,10 @@
 import org.apache.directory.studio.ldapbrowser.core.model.AttributeHierarchy;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
 import org.apache.directory.studio.valueeditors.ValueEditorManager;
-import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ICellModifier;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.swt.widgets.Item;
@@ -159,29 +157,21 @@
 
         if ( element != null && element instanceof ISearchResult && property != null )
         {
-            try
-            {
-                ISearchResult result = ( ISearchResult ) element;
-                AttributeHierarchy ah = result.getAttributeWithSubtypes( property );
+            ISearchResult result = ( ISearchResult ) element;
+            AttributeHierarchy ah = result.getAttributeWithSubtypes( property );
 
-                // switch operation:
-                if ( ah == null && newRawValue != null )
-                {
-                    this.valueEditorManager.createValue( result.getEntry(), property, newRawValue );
-                }
-                else if ( ah != null && newRawValue == null )
-                {
-                    this.valueEditorManager.deleteAttribute( ah );
-                }
-                else if ( ah != null && ah.size() == 1 && ah.getAttribute().getValueSize() == 1 && newRawValue != null )
-                {
-                    this.valueEditorManager.modifyValue( ah.getAttribute().getValues()[0], newRawValue );
-                }
+            // switch operation:
+            if ( ah == null && newRawValue != null )
+            {
+                this.valueEditorManager.createValue( result.getEntry(), property, newRawValue );
+            }
+            else if ( ah != null && newRawValue == null )
+            {
+                this.valueEditorManager.deleteAttribute( ah );
             }
-            catch ( ModelModificationException mme )
+            else if ( ah != null && ah.size() == 1 && ah.getAttribute().getValueSize() == 1 && newRawValue != null )
             {
-                MessageDialog.openError( this.viewer.getTable().getShell(), "Error While Modifying Value", mme
-                    .getMessage() );
+                this.valueEditorManager.modifyValue( ah.getAttribute().getValues()[0], newRawValue );
             }
         }
     }

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryAttributesWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryAttributesWizardPage.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryAttributesWizardPage.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryAttributesWizardPage.java Fri Oct 26 12:38:15 2007
@@ -34,7 +34,6 @@
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
@@ -186,10 +185,6 @@
                         }
                     }
                 }
-            }
-            catch ( ModelModificationException e )
-            {
-                e.printStackTrace();
             }
             finally
             {

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryDnWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryDnWizardPage.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryDnWizardPage.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryDnWizardPage.java Fri Oct 26 12:38:15 2007
@@ -33,7 +33,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.RDN;
 import org.apache.directory.studio.ldapbrowser.core.model.RDNPart;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute;
@@ -193,10 +192,6 @@
                 }
             }
 
-        }
-        catch ( ModelModificationException e )
-        {
-            e.printStackTrace();
         }
         finally
         {

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryObjectclassWizardPage.java Fri Oct 26 12:38:15 2007
@@ -31,7 +31,6 @@
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Value;
@@ -57,7 +56,6 @@
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.KeyAdapter;
 import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -274,10 +272,6 @@
                 ObjectClassDescription ocd = it.next();
                 ocAttribute.addValue( new Value( ocAttribute, ocd.getNames()[0] ) );
             }
-        }
-        catch ( ModelModificationException e )
-        {
-            e.printStackTrace();
         }
         finally
         {

Modified: directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/LdifEntryEditorDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/LdifEntryEditorDialog.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/LdifEntryEditorDialog.java (original)
+++ directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/LdifEntryEditorDialog.java Fri Oct 26 12:38:15 2007
@@ -29,7 +29,6 @@
 import org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor.EntryEditorWidgetUniversalListener;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.NameException;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifChangeAddRecord;
@@ -224,10 +223,6 @@
                 this.mainWidget.getViewer().setInput( entry );
             }
 
-        }
-        catch ( ModelModificationException e )
-        {
-            e.printStackTrace();
         }
         catch ( NameException e )
         {

Modified: directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifAttributeAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifAttributeAction.java?rev=588760&r1=588759&r2=588760&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifAttributeAction.java (original)
+++ directory/studio/trunk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifAttributeAction.java Fri Oct 26 12:38:15 2007
@@ -26,7 +26,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.DN;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.ModelModificationException;
 import org.apache.directory.studio.ldapbrowser.core.model.NameException;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry;
@@ -206,9 +205,6 @@
                 }
             }
             catch ( NameException e )
-            {
-            }
-            catch ( ModelModificationException e )
             {
             }
         }



Mime
View raw message