Transaction start moved before try-catch block BLD200405121759
authorthurka@netbeans.org
Wed, 12 May 2004 15:31:14 +0000
changeset 15140d39fabca7e8
parent 1513 8b9a6dcadf94
child 1515 9ab1ae46d171
Transaction start moved before try-catch block
mdr/src/org/netbeans/mdr/NBMDRepositoryImpl.java
mdr/src/org/netbeans/mdr/handlers/AEIndexSetWrapper.java
mdr/src/org/netbeans/mdr/handlers/AEIndexUListWrapper.java
mdr/src/org/netbeans/mdr/handlers/AttrCollWrapper.java
mdr/src/org/netbeans/mdr/handlers/AttrImmutCollWrapper.java
mdr/src/org/netbeans/mdr/handlers/AttrImmutListWrapper.java
mdr/src/org/netbeans/mdr/handlers/AttrListWrapper.java
mdr/src/org/netbeans/mdr/handlers/IndexSetWrapper.java
mdr/src/org/netbeans/mdr/handlers/InstanceHandler.java
mdr/src/org/netbeans/mdr/handlers/PackageProxyHandler.java
     1.1 --- a/mdr/src/org/netbeans/mdr/NBMDRepositoryImpl.java	Tue May 11 22:21:38 2004 +0000
     1.2 +++ b/mdr/src/org/netbeans/mdr/NBMDRepositoryImpl.java	Wed May 12 15:31:14 2004 +0000
     1.3 @@ -283,8 +283,8 @@
     1.4          
     1.5          initCheck();
     1.6          
     1.7 +        beginTrans(false);
     1.8          try {
     1.9 -            beginTrans(false);
    1.10              
    1.11              try {
    1.12                  // retrieve the package
    1.13 @@ -313,8 +313,8 @@
    1.14          initCheck();
    1.15          
    1.16          String result[] = new String[0];
    1.17 +        beginTrans(false);
    1.18          try {
    1.19 -            beginTrans(false);
    1.20              result = (String[]) mdrStorage.getContexts().toArray(result);
    1.21              return result;
    1.22          } catch (StorageException e) {
    1.23 @@ -408,8 +408,8 @@
    1.24              metaPackage = getMOFModelPackage();
    1.25          }
    1.26  
    1.27 +        beginTrans(true);
    1.28          try {
    1.29 -            beginTrans(true);
    1.30              if (getExtent(substName) != null) {
    1.31                  throw new CreationFailedException("Package extent named \'" + substName + "\' already exists.");
    1.32              }
    1.33 @@ -474,8 +474,8 @@
    1.34       */
    1.35      public String mountStorage(String storageFactoryClass, Map properties) throws MountFailedException {
    1.36          boolean failed = true;
    1.37 +        beginTrans(true);
    1.38          try {
    1.39 -            beginTrans(true);
    1.40              // Firing of event is done inside a MdrStorage mountStorage method
    1.41              String storageId = this.mdrStorage.mountStorage(storageFactoryClass, properties);
    1.42              failed = false;
    1.43 @@ -498,8 +498,8 @@
    1.44       */
    1.45      public void unmountStorage(String storageId) {
    1.46          boolean failed = true;
    1.47 +        beginTrans(true);
    1.48          try {
    1.49 -            beginTrans(true);
    1.50              if (mdrStorage.eventsEnabled()) {
    1.51                  Collection c = mdrStorage.getContexts(storageId);
    1.52                  for (Iterator it = c.iterator(); it.hasNext();) {
    1.53 @@ -1230,8 +1230,8 @@
    1.54          boolean fail = true;
    1.55          Logger.getDefault().log( "Booting repository ..." );
    1.56          mdrStorage.setBooting(true);
    1.57 +        beginTrans(true);
    1.58          try {
    1.59 -            beginTrans(true);
    1.60              installFakeMof();
    1.61              installPureMof();
    1.62              fail = false;
     2.1 --- a/mdr/src/org/netbeans/mdr/handlers/AEIndexSetWrapper.java	Tue May 11 22:21:38 2004 +0000
     2.2 +++ b/mdr/src/org/netbeans/mdr/handlers/AEIndexSetWrapper.java	Wed May 12 15:31:14 2004 +0000
     2.3 @@ -44,8 +44,8 @@
     2.4      
     2.5      public void clear() {
     2.6          boolean fail = true;
     2.7 +        lock(true);
     2.8          try {
     2.9 -            lock(true);
    2.10              Object elements[] = inner.toArray();
    2.11              for (int i = 0; i < elements.length; i++) {
    2.12                  remove(wrap(elements[i]));
    2.13 @@ -58,9 +58,9 @@
    2.14      
    2.15      public boolean addAll(Collection collection) {
    2.16          boolean fail = true;
    2.17 +        lock(true);
    2.18          try {
    2.19              boolean result = false;
    2.20 -            lock(true);
    2.21              for (Iterator it = collection.iterator(); it.hasNext();) {
    2.22                  result |= add(it.next());
    2.23              }
    2.24 @@ -73,9 +73,9 @@
    2.25      
    2.26      public boolean retainAll(Collection collection) {
    2.27          boolean fail = true;
    2.28 +        lock(true);
    2.29          try {
    2.30              boolean result = false;
    2.31 -            lock(true);
    2.32              Object elements[] = inner.toArray();
    2.33              for (int i = 0; i < elements.length; i++) {
    2.34                  Object w = wrap(elements[i]);
    2.35 @@ -93,9 +93,9 @@
    2.36      
    2.37      public boolean removeAll(Collection collection) {
    2.38          boolean fail = true;
    2.39 +        lock(true);
    2.40          try {
    2.41              boolean result = false;
    2.42 -            lock(true);
    2.43              for (Iterator it = collection.iterator(); it.hasNext();) {
    2.44                  result |= remove(it.next());
    2.45              }
    2.46 @@ -109,8 +109,8 @@
    2.47      public boolean remove(Object obj) {
    2.48          boolean fail = true;
    2.49          innerTC.checkType(obj);
    2.50 +        lock(true);
    2.51          try {
    2.52 -            lock(true);
    2.53              if (storage.eventsEnabled()) {
    2.54                  AssociationEvent event = new AssociationEvent(
    2.55                  source,
    2.56 @@ -146,8 +146,8 @@
    2.57      public boolean add(Object obj) {
    2.58          boolean fail = true;
    2.59          innerTC.checkType(obj);
    2.60 +        lock(true);
    2.61          try {
    2.62 -            lock(true);
    2.63              if (storage.eventsEnabled()) {
    2.64                  AssociationEvent event = new AssociationEvent(
    2.65                  source,
    2.66 @@ -181,8 +181,8 @@
    2.67      }
    2.68      
    2.69      public Iterator iterator() {
    2.70 +        lock(false);
    2.71          try {
    2.72 -            lock(false);
    2.73              return new AEIndexIteratorWrapper(inner.iterator());
    2.74          } finally {
    2.75              unlock();
    2.76 @@ -202,8 +202,8 @@
    2.77          
    2.78          public void remove() {
    2.79              boolean fail = true;
    2.80 +            lock(true);
    2.81              try {
    2.82 -                lock(true);
    2.83                  if (storage.eventsEnabled()) {
    2.84                      AssociationEvent event = new AssociationEvent(
    2.85                      source,
     3.1 --- a/mdr/src/org/netbeans/mdr/handlers/AEIndexUListWrapper.java	Tue May 11 22:21:38 2004 +0000
     3.2 +++ b/mdr/src/org/netbeans/mdr/handlers/AEIndexUListWrapper.java	Wed May 12 15:31:14 2004 +0000
     3.3 @@ -33,8 +33,8 @@
     3.4      
     3.5      public Object remove(int param) {
     3.6          boolean fail = true;
     3.7 +        lock(true);
     3.8          try {
     3.9 -            lock(true);
    3.10              if (storage.eventsEnabled()) {
    3.11                  AssociationEvent event = new AssociationEvent(
    3.12                  source,
    3.13 @@ -68,8 +68,8 @@
    3.14      public void add(int param, Object obj) {
    3.15          boolean fail = true;
    3.16          innerTC.checkType(obj);
    3.17 +        lock(true);
    3.18          try {
    3.19 -            lock(true);
    3.20              if (storage.eventsEnabled()) {
    3.21                  AssociationEvent event = new AssociationEvent(
    3.22                  source,
    3.23 @@ -103,8 +103,8 @@
    3.24      public Object set(int param, Object obj) {
    3.25          boolean fail = true;
    3.26          innerTC.checkType(obj);
    3.27 +        lock(true);
    3.28          try {
    3.29 -            lock(true);
    3.30              if (storage.eventsEnabled()) {
    3.31                  AssociationEvent event = new AssociationEvent(
    3.32                  source,
    3.33 @@ -150,8 +150,8 @@
    3.34      
    3.35      public boolean addAll(Collection collection) {
    3.36          boolean fail = true;
    3.37 +        lock(true);
    3.38          try {
    3.39 -            lock(true);
    3.40              ListIterator lit = listIterator(size());
    3.41              for (Iterator it = collection.iterator(); it.hasNext();) {
    3.42                  lit.add(it.next());
    3.43 @@ -165,8 +165,8 @@
    3.44      
    3.45      public boolean addAll(int param, Collection collection) {
    3.46          boolean fail = true;
    3.47 +        lock(true);
    3.48          try {
    3.49 -            lock(true);
    3.50              ListIterator lit = listIterator(param);
    3.51              for (Iterator it = collection.iterator(); it.hasNext();) {
    3.52                  lit.add(it.next());
    3.53 @@ -179,8 +179,8 @@
    3.54      }
    3.55      
    3.56      public int indexOf(Object obj) {
    3.57 +        lock(false);
    3.58          try {
    3.59 -            lock(false);
    3.60              return innerList.indexOf(unwrap(obj));
    3.61          } finally {
    3.62              unlock();
    3.63 @@ -188,8 +188,8 @@
    3.64      }
    3.65      
    3.66      public int lastIndexOf(Object obj) {
    3.67 +        lock(false);
    3.68          try {
    3.69 -            lock(false);
    3.70              return innerList.lastIndexOf(unwrap(obj));
    3.71          } finally {
    3.72              unlock();
    3.73 @@ -197,8 +197,8 @@
    3.74      }
    3.75      
    3.76      public Object get(int param) {
    3.77 +        lock(false);
    3.78          try {
    3.79 -            lock(false);
    3.80              return wrap(innerList.get(param));
    3.81          } finally {
    3.82              unlock();
    3.83 @@ -206,8 +206,8 @@
    3.84      }
    3.85      
    3.86      public ListIterator listIterator() {
    3.87 +        lock(false);
    3.88          try {
    3.89 -            lock(false);
    3.90              return new AEIndexListIteratorWrapper(innerList.listIterator());
    3.91          } finally {
    3.92              unlock();
    3.93 @@ -215,8 +215,8 @@
    3.94      }
    3.95      
    3.96      public ListIterator listIterator(int param) {
    3.97 +        lock(false);
    3.98          try {
    3.99 -            lock(false);
   3.100              return new AEIndexListIteratorWrapper(innerList.listIterator(param));
   3.101          } finally {
   3.102              unlock();
   3.103 @@ -248,8 +248,8 @@
   3.104          public void set(Object obj) {
   3.105              boolean fail = true;
   3.106              innerTC.checkType(obj);
   3.107 +            lock(true);
   3.108              try {
   3.109 -                lock(true);
   3.110                  if (storage.eventsEnabled()) {
   3.111                      AssociationEvent event = new AssociationEvent(
   3.112                      source,
   3.113 @@ -295,8 +295,8 @@
   3.114          public void add(Object obj) {
   3.115              boolean fail = true;
   3.116              innerTC.checkType(obj);
   3.117 +            lock(true);
   3.118              try {
   3.119 -                lock(true);
   3.120                  if (storage.eventsEnabled()) {
   3.121                      AssociationEvent event = new AssociationEvent(
   3.122                      source,
   3.123 @@ -327,8 +327,8 @@
   3.124          }
   3.125          
   3.126          public int previousIndex() {
   3.127 +            lock(false);
   3.128              try {
   3.129 -                lock(false);
   3.130                  return listIterator.previousIndex();
   3.131              } finally {
   3.132                  unlock();
   3.133 @@ -336,8 +336,8 @@
   3.134          }
   3.135          
   3.136          public int nextIndex() {
   3.137 +            lock(false);
   3.138              try {
   3.139 -                lock(false);
   3.140                  return listIterator.nextIndex();
   3.141              } finally {
   3.142                  unlock();
   3.143 @@ -345,8 +345,8 @@
   3.144          }
   3.145          
   3.146          public boolean hasPrevious() {
   3.147 +            lock(false);
   3.148              try {
   3.149 -                lock(false);
   3.150                  return listIterator.hasPrevious();
   3.151              } finally {
   3.152                  unlock();
   3.153 @@ -354,8 +354,8 @@
   3.154          }
   3.155          
   3.156          public Object previous() {
   3.157 +            lock(false);
   3.158              try {
   3.159 -                lock(false);
   3.160                  lastReadIndex = previousIndex();
   3.161                  return (lastRead = (RefObject) wrap(listIterator.previous()));
   3.162              } finally {
   3.163 @@ -364,8 +364,8 @@
   3.164          }
   3.165          
   3.166          public Object next() {
   3.167 +            lock(false);
   3.168              try {
   3.169 -                lock(false);
   3.170                  lastReadIndex = nextIndex();
   3.171                  return super.next();
   3.172              } finally {
   3.173 @@ -375,8 +375,8 @@
   3.174          
   3.175          public void remove() {
   3.176              boolean fail = true;
   3.177 +            lock(true);
   3.178              try {
   3.179 -                lock(true);
   3.180                  if (storage.eventsEnabled()) {
   3.181                      AssociationEvent event = new AssociationEvent(
   3.182                      source,
     4.1 --- a/mdr/src/org/netbeans/mdr/handlers/AttrCollWrapper.java	Tue May 11 22:21:38 2004 +0000
     4.2 +++ b/mdr/src/org/netbeans/mdr/handlers/AttrCollWrapper.java	Wed May 12 15:31:14 2004 +0000
     4.3 @@ -45,8 +45,8 @@
     4.4      }
     4.5      
     4.6      public final Iterator iterator() {
     4.7 +        lock(false);
     4.8          try {
     4.9 -            lock(false);
    4.10              return new AttrIteratorWrapper(getInnerCollection().iterator());
    4.11          } finally {
    4.12              unlock();
    4.13 @@ -55,8 +55,8 @@
    4.14      
    4.15      public final void clear() {
    4.16          boolean fail = true;
    4.17 +        lock(true);
    4.18          try {
    4.19 -            lock(true);
    4.20              Object elements[] = getInnerCollection().toArray();
    4.21              for (int i = 0; i < elements.length; i++) {
    4.22                  remove(elements[i]);
    4.23 @@ -69,8 +69,8 @@
    4.24      
    4.25      public final boolean addAll(Collection collection) {
    4.26          boolean fail = true;
    4.27 +        lock(true);
    4.28          try {
    4.29 -            lock(true);
    4.30              boolean result = false;
    4.31              for (Iterator it = collection.iterator(); it.hasNext();) {
    4.32                  result |= add(it.next());
    4.33 @@ -84,8 +84,8 @@
    4.34      
    4.35      public final boolean remove(Object obj) {
    4.36          boolean fail = true;
    4.37 +        lock(true);
    4.38          try {
    4.39 -            lock(true);
    4.40              if (storage.eventsEnabled()) {
    4.41                  AttributeEvent event = new AttributeEvent(
    4.42                      source, 
    4.43 @@ -105,8 +105,8 @@
    4.44      
    4.45      public final boolean add(Object obj) {
    4.46          boolean fail = true;
    4.47 +        lock(true);
    4.48          try {
    4.49 -            lock(true);
    4.50              if (storage.eventsEnabled()) {
    4.51                  AttributeEvent event = new AttributeEvent(
    4.52                      source, 
    4.53 @@ -126,9 +126,9 @@
    4.54      
    4.55      public boolean retainAll(Collection collection) {
    4.56          boolean fail = true;
    4.57 +        lock(true);
    4.58          try {
    4.59              boolean result = false;
    4.60 -            lock(true);
    4.61              Object elements[] = getInnerCollection().toArray();
    4.62              for (int i = 0; i < elements.length; i++) {
    4.63                  if (!collection.contains(elements[i])) {
    4.64 @@ -145,9 +145,9 @@
    4.65      
    4.66      public boolean removeAll(Collection collection) {
    4.67          boolean fail = true;
    4.68 +        lock(true);
    4.69          try {
    4.70              boolean result = false;
    4.71 -            lock(true);
    4.72              for (Iterator it = collection.iterator(); it.hasNext();) {
    4.73                  result |= remove(it.next());
    4.74              }
    4.75 @@ -171,8 +171,8 @@
    4.76          
    4.77          public void remove() {
    4.78              boolean fail = true;
    4.79 +            lock(true);
    4.80              try {
    4.81 -                lock(true);
    4.82                  if (storage.eventsEnabled()) {
    4.83                      AttributeEvent event = new AttributeEvent(
    4.84                          source, 
     5.1 --- a/mdr/src/org/netbeans/mdr/handlers/AttrImmutCollWrapper.java	Tue May 11 22:21:38 2004 +0000
     5.2 +++ b/mdr/src/org/netbeans/mdr/handlers/AttrImmutCollWrapper.java	Wed May 12 15:31:14 2004 +0000
     5.3 @@ -81,8 +81,8 @@
     5.4      }
     5.5  
     5.6      public final boolean contains(Object obj) {
     5.7 +        lock(false);
     5.8          try {
     5.9 -            lock(false);
    5.10              return getInnerCollection().contains(obj);
    5.11          } finally {
    5.12              unlock();
    5.13 @@ -90,8 +90,8 @@
    5.14      }
    5.15      
    5.16      public Iterator iterator() {
    5.17 +        lock(false);
    5.18          try {
    5.19 -            lock(false);
    5.20              return new AttrImmutIteratorWrapper(getInnerCollection().iterator());
    5.21          } finally {
    5.22              unlock();
    5.23 @@ -99,8 +99,8 @@
    5.24      }
    5.25      
    5.26      public final int size() {
    5.27 +        lock(false);
    5.28          try {
    5.29 -            lock(false);
    5.30              return getInnerCollection().size();
    5.31          } finally {
    5.32              unlock();
    5.33 @@ -108,8 +108,8 @@
    5.34      }
    5.35      
    5.36      public final boolean isEmpty() {
    5.37 +        lock(false);
    5.38          try {
    5.39 -            lock(false);
    5.40              return getInnerCollection().isEmpty();
    5.41          } finally {
    5.42              unlock();
    5.43 @@ -117,8 +117,8 @@
    5.44      }
    5.45      
    5.46      public final boolean containsAll(Collection collection) {
    5.47 +        lock(false);
    5.48          try {
    5.49 -            lock(false);
    5.50              return getInnerCollection().containsAll(collection);
    5.51          } finally {
    5.52              unlock();
    5.53 @@ -126,8 +126,8 @@
    5.54      }
    5.55      
    5.56      public final Object[] toArray(Object[] obj) {
    5.57 +        lock(false);
    5.58          try {
    5.59 -            lock(false);
    5.60              return getInnerCollection().toArray(obj);
    5.61          } finally {
    5.62              unlock();
    5.63 @@ -135,8 +135,8 @@
    5.64      }
    5.65      
    5.66      public final Object[] toArray() {
    5.67 +        lock(false);
    5.68          try {
    5.69 -            lock(false);
    5.70              return getInnerCollection().toArray();
    5.71          } finally {
    5.72              unlock();
    5.73 @@ -146,8 +146,8 @@
    5.74      public boolean equals(Object object) {
    5.75          if (object == this) return true;
    5.76          if (!(object instanceof Collection)) return false;
    5.77 +        lock(false);
    5.78          try {
    5.79 -            lock(false);
    5.80              Iterator it1 = iterator();
    5.81              Iterator it2 = ((Collection) object).iterator();
    5.82              while(it1.hasNext() && it2.hasNext()) {
    5.83 @@ -208,8 +208,8 @@
    5.84          }
    5.85          
    5.86          public final boolean hasNext() {
    5.87 +            lock(false);
    5.88              try {
    5.89 -                lock(false);
    5.90                  return innerIterator.hasNext();
    5.91              } finally {
    5.92                  unlock();
    5.93 @@ -217,8 +217,8 @@
    5.94          }
    5.95          
    5.96          public Object next() {
    5.97 +            lock(false);
    5.98              try {
    5.99 -                lock(false);
   5.100                  return innerIterator.next();
   5.101              } finally {
   5.102                  unlock();
     6.1 --- a/mdr/src/org/netbeans/mdr/handlers/AttrImmutListWrapper.java	Tue May 11 22:21:38 2004 +0000
     6.2 +++ b/mdr/src/org/netbeans/mdr/handlers/AttrImmutListWrapper.java	Wed May 12 15:31:14 2004 +0000
     6.3 @@ -43,8 +43,8 @@
     6.4      }
     6.5      
     6.6      public ListIterator listIterator(int param) {
     6.7 +        lock(false);
     6.8          try {
     6.9 -            lock(false);
    6.10              return new AttrImmutListIteratorWrapper(getInnerList().listIterator(param));
    6.11          } finally {
    6.12              unlock();
    6.13 @@ -56,8 +56,8 @@
    6.14      }
    6.15      
    6.16      public int indexOf(Object obj) {
    6.17 +        lock(false);
    6.18          try {
    6.19 -            lock(false);
    6.20              return getInnerList().indexOf(obj);
    6.21          } finally {
    6.22              unlock();
    6.23 @@ -65,8 +65,8 @@
    6.24      }
    6.25      
    6.26      public int lastIndexOf(Object obj) {
    6.27 +        lock(false);
    6.28          try {
    6.29 -            lock(false);
    6.30              return getInnerList().lastIndexOf(obj);
    6.31          } finally {
    6.32              unlock();
    6.33 @@ -74,8 +74,8 @@
    6.34      }
    6.35      
    6.36      public Object get(int param) {
    6.37 +        lock(false);
    6.38          try {
    6.39 -            lock(false);
    6.40              return getInnerList().get(param);
    6.41          } finally {
    6.42              unlock();
    6.43 @@ -91,8 +91,8 @@
    6.44      }
    6.45      
    6.46      public ListIterator listIterator() {
    6.47 +        lock(false);
    6.48          try {
    6.49 -            lock(false);
    6.50              return new AttrImmutListIteratorWrapper(getInnerList().listIterator());
    6.51          } finally {
    6.52              unlock();
    6.53 @@ -100,8 +100,8 @@
    6.54      }
    6.55      
    6.56      public List subList(int param, int param1) {
    6.57 +        lock(false);
    6.58          try {
    6.59 -            lock(false);
    6.60              return new AttrImmutListWrapper(storage, getInnerList().subList(param, param1));
    6.61          } finally {
    6.62              unlock();
    6.63 @@ -125,8 +125,8 @@
    6.64          }
    6.65          
    6.66          public int previousIndex() {
    6.67 +            lock(false);
    6.68              try {
    6.69 -                lock(false);
    6.70                  return innerListIterator.previousIndex();
    6.71              } finally {
    6.72                  unlock();
    6.73 @@ -138,8 +138,8 @@
    6.74          }
    6.75          
    6.76          public int nextIndex() {
    6.77 +            lock(false);
    6.78              try {
    6.79 -                lock(false);
    6.80                  return innerListIterator.nextIndex();
    6.81              } finally {
    6.82                  unlock();
    6.83 @@ -147,8 +147,8 @@
    6.84          }
    6.85          
    6.86          public boolean hasPrevious() {
    6.87 +            lock(false);
    6.88              try {
    6.89 -                lock(false);
    6.90                  return innerListIterator.hasPrevious();
    6.91              } finally {
    6.92                  unlock();
    6.93 @@ -160,8 +160,8 @@
    6.94          }
    6.95          
    6.96          public Object previous() {
    6.97 +            lock(false);
    6.98              try {
    6.99 -                lock(false);
   6.100                  return innerListIterator.previous();
   6.101              } finally {
   6.102                  unlock();
     7.1 --- a/mdr/src/org/netbeans/mdr/handlers/AttrListWrapper.java	Tue May 11 22:21:38 2004 +0000
     7.2 +++ b/mdr/src/org/netbeans/mdr/handlers/AttrListWrapper.java	Wed May 12 15:31:14 2004 +0000
     7.3 @@ -37,8 +37,8 @@
     7.4      
     7.5      public Object remove(int param) {
     7.6          boolean fail = true;
     7.7 +        lock(true);
     7.8          try {
     7.9 -            lock(true);
    7.10              if (storage.eventsEnabled()) {
    7.11                  AttributeEvent event = new AttributeEvent(
    7.12                      source, 
    7.13 @@ -57,8 +57,8 @@
    7.14      }
    7.15      
    7.16      public ListIterator listIterator(int param) {
    7.17 +        lock(false);
    7.18          try {
    7.19 -            lock(false);
    7.20              return new AttrListIteratorWrapper(getInnerList().listIterator(param));
    7.21          } finally {
    7.22              unlock();
    7.23 @@ -67,8 +67,8 @@
    7.24      
    7.25      public void add(int param, Object obj) {
    7.26          boolean fail = true;
    7.27 +        lock(true);
    7.28          try {
    7.29 -            lock(true);
    7.30              if (storage.eventsEnabled()) {
    7.31                  AttributeEvent event = new AttributeEvent(
    7.32                      source, 
    7.33 @@ -86,8 +86,8 @@
    7.34      }
    7.35      
    7.36      public int indexOf(Object obj) {
    7.37 +        lock(false);
    7.38          try {
    7.39 -            lock(false);
    7.40              return getInnerList().indexOf(obj);
    7.41          } finally {
    7.42              unlock();
    7.43 @@ -95,8 +95,8 @@
    7.44      }
    7.45      
    7.46      public int lastIndexOf(Object obj) {
    7.47 +        lock(false);
    7.48          try {
    7.49 -            lock(false);
    7.50              return getInnerList().lastIndexOf(obj);
    7.51          } finally {
    7.52              unlock();
    7.53 @@ -104,8 +104,8 @@
    7.54      }
    7.55      
    7.56      public Object get(int param) {
    7.57 +        lock(false);
    7.58          try {
    7.59 -            lock(false);
    7.60              return getInnerList().get(param);
    7.61          } finally {
    7.62              unlock();
    7.63 @@ -114,8 +114,8 @@
    7.64      
    7.65      public Object set(int param, Object obj) {
    7.66          boolean fail = true;
    7.67 +        lock(true);
    7.68          try {
    7.69 -            lock(true);
    7.70              if (storage.eventsEnabled()) {
    7.71                  AttributeEvent event = new AttributeEvent(
    7.72                      source, 
    7.73 @@ -135,8 +135,8 @@
    7.74      
    7.75      public boolean addAll(int param, Collection collection) {
    7.76          boolean fail = true;
    7.77 +        lock(true);
    7.78          try {
    7.79 -            lock(true);
    7.80              for (Iterator it = collection.iterator(); it.hasNext();) {
    7.81                  add(param++, it.next());
    7.82              }
    7.83 @@ -148,8 +148,8 @@
    7.84      }
    7.85      
    7.86      public ListIterator listIterator() {
    7.87 +        lock(false);
    7.88          try {
    7.89 -            lock(false);
    7.90              return new AttrListIteratorWrapper(getInnerList().listIterator());
    7.91          } finally {
    7.92              unlock();
    7.93 @@ -157,8 +157,8 @@
    7.94      }
    7.95      
    7.96      public List subList(int param, int param1) {
    7.97 +        lock(false);
    7.98          try {
    7.99 -            lock(false);
   7.100              AttrListWrapper result = new AttrListWrapper(source, getInnerList().subList(param, param1));
   7.101              result.setAttrName(attrName);
   7.102              return result;
   7.103 @@ -185,8 +185,8 @@
   7.104          }
   7.105          
   7.106          public int previousIndex() {
   7.107 +            lock(false);
   7.108              try {
   7.109 -                lock(false);
   7.110                  return innerListIterator.previousIndex();
   7.111              } finally {
   7.112                  unlock();
   7.113 @@ -195,8 +195,8 @@
   7.114          
   7.115          public void set(Object obj) {
   7.116              boolean fail = true;
   7.117 +            lock(true);
   7.118              try {
   7.119 -                lock(true);
   7.120                  if (storage.eventsEnabled()) {
   7.121                      AttributeEvent event = new AttributeEvent(
   7.122                          source, 
   7.123 @@ -214,8 +214,8 @@
   7.124          }
   7.125          
   7.126          public int nextIndex() {
   7.127 +            lock(false);
   7.128              try {
   7.129 -                lock(false);
   7.130                  return innerListIterator.nextIndex();
   7.131              } finally {
   7.132                  unlock();
   7.133 @@ -223,8 +223,8 @@
   7.134          }
   7.135          
   7.136          public boolean hasPrevious() {
   7.137 +            lock(false);
   7.138              try {
   7.139 -                lock(false);
   7.140                  return innerListIterator.hasPrevious();
   7.141              } finally {
   7.142                  unlock();
   7.143 @@ -233,8 +233,8 @@
   7.144          
   7.145          public void add(Object obj) {
   7.146              boolean fail = true;
   7.147 +            lock(true);
   7.148              try {
   7.149 -                lock(true);
   7.150                  if (storage.eventsEnabled()) {
   7.151                      AttributeEvent event = new AttributeEvent(
   7.152                          source, 
   7.153 @@ -253,8 +253,8 @@
   7.154          
   7.155          public final void remove() {
   7.156              boolean fail = true;
   7.157 +            lock(true);
   7.158              try {
   7.159 -                lock(true);
   7.160                  if (storage.eventsEnabled()) {
   7.161                      AttributeEvent event = new AttributeEvent(
   7.162                          source, 
   7.163 @@ -272,8 +272,8 @@
   7.164          }
   7.165  
   7.166          public Object previous() {
   7.167 +            lock(false);
   7.168              try {
   7.169 -                lock(false);
   7.170                  lastReadIndex = previousIndex();
   7.171                  return (lastRead = innerListIterator.previous());
   7.172              } finally {
   7.173 @@ -282,8 +282,8 @@
   7.174          }
   7.175          
   7.176          public Object next() {
   7.177 +            lock(false);
   7.178              try {
   7.179 -                lock(false);
   7.180                  lastReadIndex = nextIndex();
   7.181                  return super.next();
   7.182              } finally {
     8.1 --- a/mdr/src/org/netbeans/mdr/handlers/IndexSetWrapper.java	Tue May 11 22:21:38 2004 +0000
     8.2 +++ b/mdr/src/org/netbeans/mdr/handlers/IndexSetWrapper.java	Wed May 12 15:31:14 2004 +0000
     8.3 @@ -79,8 +79,8 @@
     8.4      }
     8.5      
     8.6      public boolean contains(Object obj) {
     8.7 +        lock(false);
     8.8          try {
     8.9 -            lock(false);
    8.10              return inner.contains(unwrap(obj));
    8.11          } finally {
    8.12              unlock();
    8.13 @@ -88,8 +88,8 @@
    8.14      }
    8.15      
    8.16      public Iterator iterator() {
    8.17 +        lock(false);
    8.18          try {
    8.19 -            lock(false);
    8.20              return new IndexIteratorWrapper(inner.iterator());
    8.21          } finally {
    8.22              unlock();
    8.23 @@ -106,8 +106,8 @@
    8.24      }
    8.25      
    8.26      public boolean isEmpty() {
    8.27 +        lock(false);
    8.28          try {
    8.29 -            lock(false);
    8.30              return inner.isEmpty();
    8.31          } finally {
    8.32              unlock();
    8.33 @@ -115,8 +115,8 @@
    8.34      }
    8.35      
    8.36      public boolean containsAll(Collection collection) {
    8.37 +        lock(false);
    8.38          try {
    8.39 -            lock(false);
    8.40              return inner.containsAll(new CollectionUnwrapper(collection));
    8.41          } finally {
    8.42              unlock();
    8.43 @@ -124,8 +124,8 @@
    8.44      }
    8.45      
    8.46      public Object[] toArray(Object[] obj) {
    8.47 +        lock(false);
    8.48          try {
    8.49 -            lock(false);
    8.50              Object[] value = wrapArray(inner.toArray());
    8.51              Object[] result = obj;
    8.52              if (value.length > result.length) {
    8.53 @@ -148,8 +148,8 @@
    8.54      public boolean equals(Object object) {
    8.55          if (object == this) return true;
    8.56          if (!(object instanceof Collection)) return false;
    8.57 +        lock(false);
    8.58          try {
    8.59 -            lock(false);
    8.60              Iterator it1 = iterator();
    8.61              Iterator it2 = ((Collection) object).iterator();
    8.62              while(it1.hasNext() && it2.hasNext()) {
    8.63 @@ -214,8 +214,8 @@
    8.64          }
    8.65          
    8.66          public boolean hasNext() {
    8.67 +            lock(false);
    8.68              try {
    8.69 -                lock(false);
    8.70                  return innerIterator.hasNext();
    8.71              } finally {
    8.72                  unlock();
    8.73 @@ -223,8 +223,8 @@
    8.74          }
    8.75          
    8.76          public Object next() {
    8.77 +            lock(false);
    8.78              try {
    8.79 -                lock(false);
    8.80                  return wrap(innerIterator.next());
    8.81              } finally {
    8.82                  unlock();
     9.1 --- a/mdr/src/org/netbeans/mdr/handlers/InstanceHandler.java	Tue May 11 22:21:38 2004 +0000
     9.2 +++ b/mdr/src/org/netbeans/mdr/handlers/InstanceHandler.java	Wed May 12 15:31:14 2004 +0000
     9.3 @@ -221,8 +221,8 @@
     9.4      /* -------------------------------------------------------------------- */
     9.5  
     9.6      public final RefFeatured refOutermostComposite() {
     9.7 +        _lock(false);
     9.8          try {
     9.9 -            _lock(false);
    9.10              return _outermostComposite();
    9.11          } finally {
    9.12              _unlock();
    9.13 @@ -238,8 +238,8 @@
    9.14      }
    9.15  
    9.16      public final RefFeatured refImmediateComposite() {
    9.17 +        _lock(false);
    9.18          try {
    9.19 -            _lock(false);
    9.20              return _immediateComposite();
    9.21          } finally {
    9.22              _unlock();
    9.23 @@ -255,8 +255,8 @@
    9.24      }
    9.25      
    9.26      public final boolean refIsInstanceOf(RefObject objType, boolean considerSubtypes) {
    9.27 +        _lock(false);
    9.28          try {
    9.29 -            _lock(false);
    9.30              return isInstanceOf((GeneralizableElement) refMetaObject(), objType, considerSubtypes);
    9.31          } finally {
    9.32              _unlock();
    9.33 @@ -278,8 +278,8 @@
    9.34      }
    9.35  
    9.36      public final RefClass refClass() {
    9.37 +        _lock(false);
    9.38          try {
    9.39 -            _lock(false);
    9.40              return (RefClass) _getRepository().getHandler(getInstanceDelegate().getClassProxy());
    9.41          } catch (StorageException e) {
    9.42              throw (DebugException) Logger.getDefault().annotate(new DebugException(), e);
    9.43 @@ -291,8 +291,8 @@
    9.44      public final void refDelete() {
    9.45          boolean fail = true;
    9.46          InstanceEvent event = null;
    9.47 +        _lock(true);
    9.48          try {
    9.49 -            _lock(true);
    9.50              if (_getMdrStorage().eventsEnabled()) {
    9.51                  event = new InstanceEvent(
    9.52                      this,
    9.53 @@ -320,8 +320,8 @@
    9.54      };
    9.55  
    9.56      public final void refSetValue(String featureName, java.lang.Object value) {
    9.57 +        _lock(true);
    9.58          try {
    9.59 -            _lock(true);
    9.60              if (_isReference(featureName)) {
    9.61                  _setReference(featureName, value);
    9.62              } else {
    9.63 @@ -336,8 +336,8 @@
    9.64          if (feature instanceof Attribute) {
    9.65              super.refSetValue(feature, value);
    9.66          } else {
    9.67 +            _lock(true);
    9.68              try {
    9.69 -                _lock(true);
    9.70                  StorableClass cls = getInstanceDelegate().getClassProxy();
    9.71                  try {
    9.72                      StorableClass.ReferenceDescriptor desc = cls.getReferenceDescriptor(((Reference) feature).getName());
    9.73 @@ -359,8 +359,8 @@
    9.74      }
    9.75  
    9.76      public final Object refGetValue(String featureName) {
    9.77 +        _lock(false);
    9.78          try {
    9.79 -            _lock(false);
    9.80              if (_isReference(featureName)) {
    9.81                  return _getReference(featureName);
    9.82              } else {
    9.83 @@ -375,8 +375,8 @@
    9.84          if (feature instanceof Attribute) {
    9.85              return super.refGetValue(feature);
    9.86          } else {
    9.87 +            _lock(false);
    9.88              try {
    9.89 -                _lock(false);
    9.90                  StorableClass cls = getInstanceDelegate().getClassProxy();
    9.91                  try {
    9.92                      StorableClass.ReferenceDescriptor desc = cls.getReferenceDescriptor(((Reference) feature).getName());
    9.93 @@ -437,8 +437,8 @@
    9.94      /* ---------------------------------------------------------------- */
    9.95  
    9.96      protected final Collection _recursiveVerify(Collection violations, Set visited) {
    9.97 +        _lock(false);
    9.98          try {
    9.99 -            _lock(false);
   9.100              _verify(violations);
   9.101              visited.add(this);
   9.102              // [PENDING] should verify all contained objects
   9.103 @@ -449,8 +449,8 @@
   9.104      }    
   9.105  
   9.106      protected Collection _verify(Collection violations) {
   9.107 +        _lock(false);
   9.108          try {
   9.109 -            _lock(false);
   9.110              getInstanceDelegate().verify(violations);
   9.111              return violations;
   9.112          } catch (StorageException e) {
    10.1 --- a/mdr/src/org/netbeans/mdr/handlers/PackageProxyHandler.java	Tue May 11 22:21:38 2004 +0000
    10.2 +++ b/mdr/src/org/netbeans/mdr/handlers/PackageProxyHandler.java	Wed May 12 15:31:14 2004 +0000
    10.3 @@ -157,8 +157,8 @@
    10.4      /* -------------------------------------------------------------------- */
    10.5  
    10.6      public final Collection refAllAssociations() {
    10.7 +        _lock(false);
    10.8          try {
    10.9 -            _lock(false);
   10.10              return new IndexSetWrapper(_getMdrStorage(), getPackageDelegate().getAllAssociations());
   10.11          } catch (StorageException e) {
   10.12              throw (DebugException) Logger.getDefault().annotate(new DebugException(), e);
   10.13 @@ -168,8 +168,8 @@
   10.14      }
   10.15  
   10.16      public final Collection refAllClasses() {
   10.17 +        _lock(false);
   10.18          try {
   10.19 -            _lock(false);
   10.20              return new IndexSetWrapper(_getMdrStorage(), getPackageDelegate().getAllClasses());
   10.21          } catch (StorageException e) {
   10.22              throw (DebugException) Logger.getDefault().annotate(new DebugException(), e);
   10.23 @@ -179,8 +179,8 @@
   10.24      }
   10.25  
   10.26      public final Collection refAllPackages() {
   10.27 +        _lock(false);
   10.28          try {
   10.29 -            _lock(false);
   10.30              return new IndexSetWrapper(_getMdrStorage(), getPackageDelegate().getAllPackages());
   10.31          } catch (StorageException e) {
   10.32              throw (DebugException) Logger.getDefault().annotate(new DebugException(), e);
   10.33 @@ -218,8 +218,8 @@
   10.34          } catch (ClassCastException e) {
   10.35              throw new InvalidCallException(this, nestedPackage, "Invalid package designator: " + nestedPackage);
   10.36          }
   10.37 +        _lock(false);
   10.38          try {
   10.39 -            _lock(false);
   10.40              checkClustered();
   10.41              String name = (String) clusteredPackages.get(pkg.refMofId());
   10.42          
   10.43 @@ -305,8 +305,8 @@
   10.44      public void refDelete() {
   10.45          ExtentEvent event = null;
   10.46          boolean fail = true;
   10.47 +        _lock(true);
   10.48          try {
   10.49 -            _lock(true);
   10.50              if (_getMdrStorage().eventsEnabled()) {
   10.51                  event = new ExtentEvent(
   10.52                      this, 
   10.53 @@ -372,14 +372,14 @@
   10.54      public void removeListener(MDRChangeListener listener, int mask) {
   10.55          _getMdrStorage().getEventNotifier().PACKAGE.removeListener(listener, mask, this);
   10.56      }
   10.57 -    
   10.58 +
   10.59      /* ---------------------------------------------------------------- */
   10.60      /* -- Implementation of abstract methods from BaseObjectHandler --- */
   10.61      /* ---------------------------------------------------------------- */
   10.62  
   10.63      protected final Collection _recursiveVerify(Collection violations, Set visited) {
   10.64 +        _lock(false);
   10.65          try {
   10.66 -            _lock(false);
   10.67              _verify(violations);
   10.68              visited.add(this);
   10.69              for (Iterator it = refAllPackages().iterator(); it.hasNext();) {