activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: Some code cleanups
Date Tue, 17 Sep 2013 22:23:52 GMT
Updated Branches:
  refs/heads/trunk 599ae6a66 -> 3b2f87e1d


Some code cleanups

Project: http://git-wip-us.apache.org/repos/asf/activemq-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-cpp/commit/3b2f87e1
Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/3b2f87e1
Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/3b2f87e1

Branch: refs/heads/trunk
Commit: 3b2f87e1d5cd64f99953bd34aae037d4f784df00
Parents: 599ae6a
Author: Timothy Bish <tabish121@gmai.com>
Authored: Tue Sep 17 18:23:49 2013 -0400
Committer: Timothy Bish <tabish121@gmai.com>
Committed: Tue Sep 17 18:23:49 2013 -0400

----------------------------------------------------------------------
 .../src/main/decaf/util/AbstractCollection.h    | 94 ++++++++++----------
 activemq-cpp/src/main/decaf/util/AbstractList.h | 52 +++++------
 activemq-cpp/src/main/decaf/util/AbstractMap.h  | 17 ++--
 .../src/main/decaf/util/AbstractQueue.h         | 10 +--
 .../main/decaf/util/AbstractSequentialList.h    | 59 ++++++------
 activemq-cpp/src/main/decaf/util/AbstractSet.h  | 31 ++++---
 6 files changed, 126 insertions(+), 137 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/3b2f87e1/activemq-cpp/src/main/decaf/util/AbstractCollection.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/util/AbstractCollection.h b/activemq-cpp/src/main/decaf/util/AbstractCollection.h
index 0cdd447..847f5b4 100644
--- a/activemq-cpp/src/main/decaf/util/AbstractCollection.h
+++ b/activemq-cpp/src/main/decaf/util/AbstractCollection.h
@@ -73,12 +73,12 @@ namespace util {
          * @param collection - the collection to copy
          * @return a reference to this collection
          */
-        AbstractCollection<E>& operator= ( const AbstractCollection<E>&
collection ) {
+        AbstractCollection<E>& operator= (const AbstractCollection<E>&
collection) {
             this->clear();
 
-            std::auto_ptr< Iterator<E> > iter( collection.iterator() );
-            while( iter->hasNext() ) {
-                this->add( iter->next() );
+            std::auto_ptr<Iterator<E> > iter(collection.iterator());
+            while (iter->hasNext()) {
+                this->add(iter->next());
             }
 
             return *this;
@@ -100,9 +100,8 @@ namespace util {
          *        if the clear operation is not supported by this collection
          */
         virtual void clear() {
-
-            std::auto_ptr< Iterator<E> > iter( this->iterator() );
-            while( iter->hasNext() ) {
+            std::auto_ptr<Iterator<E> > iter(this->iterator());
+            while (iter->hasNext()) {
                 iter->next();
                 iter->remove();
             }
@@ -114,12 +113,11 @@ namespace util {
          * This implementation iterates over the elements in the collection, checking each
          * element in turn for equality with the specified element.
          */
-        virtual bool contains( const E& value ) const {
-
+        virtual bool contains(const E& value) const {
             bool result = false;
-            std::auto_ptr< Iterator<E> > iter( this->iterator() );
-            while( iter->hasNext() ) {
-                if( iter->next() == value ) {
+            std::auto_ptr<Iterator<E> > iter(this->iterator());
+            while (iter->hasNext()) {
+                if (iter->next() == value) {
                     result = true;
                 }
             }
@@ -134,11 +132,11 @@ namespace util {
          * returned by the iterator in turn to see if it's contained in this collection.
If
          * all elements are so contained true is returned, otherwise false.
          */
-        virtual bool containsAll( const Collection<E>& collection ) const {
+        virtual bool containsAll(const Collection<E>& collection) const {
 
-            std::auto_ptr< Iterator<E> > iter( collection.iterator() );
-            while( iter->hasNext() ) {
-                if( !this->contains( iter->next() ) ) {
+            std::auto_ptr<Iterator<E> > iter(collection.iterator());
+            while (iter->hasNext()) {
+                if (!this->contains(iter->next())) {
                     return false;
                 }
             }
@@ -155,13 +153,13 @@ namespace util {
          *
          * @return true if this Collection is equal to the one given.
          */
-        virtual bool equals( const Collection<E>& collection ) const {
+        virtual bool equals(const Collection<E>& collection) const {
 
-            if( this == &collection ) {
+            if (this == &collection) {
                 return true;
             }
 
-            if( this->size() == collection.size() && this->containsAll( collection
) ) {
+            if (this->size() == collection.size() && this->containsAll(collection))
{
                 return true;
             }
 
@@ -181,12 +179,12 @@ namespace util {
          * @throws IllegalStateException if the elements cannot be added at this time due
          *         to insertion restrictions.
          */
-        virtual void copy( const Collection<E>& collection ) {
+        virtual void copy(const Collection<E>& collection) {
             this->clear();
 
-            std::auto_ptr< Iterator<E> > iter( collection.iterator() );
-            while( iter->hasNext() ) {
-                this->add( iter->next() );
+            std::auto_ptr<Iterator<E> > iter(collection.iterator());
+            while (iter->hasNext()) {
+                this->add(iter->next());
             }
         }
 
@@ -206,7 +204,7 @@ namespace util {
          *
          * This implementation always throws an UnsupportedOperationException.
          */
-        virtual bool add( const E& value DECAF_UNUSED ) {
+        virtual bool add(const E& value DECAF_UNUSED) {
             throw decaf::lang::exceptions::UnsupportedOperationException(
                 __FILE__, __LINE__, "AbstractCollection add is not implemented.");
         }
@@ -220,12 +218,12 @@ namespace util {
          * Note that this implementation will throw an UnsupportedOperationException unless
add
          * is overridden (assuming the specified collection is non-empty).
          */
-        virtual bool addAll( const Collection<E>& collection ) {
+        virtual bool addAll(const Collection<E>& collection) {
 
             bool result = false;
-            std::auto_ptr< Iterator<E> > iter( collection.iterator() );
-            while( iter->hasNext() ) {
-                result = this->add( iter->next() ) || result;
+            std::auto_ptr<Iterator<E> > iter(collection.iterator());
+            while (iter->hasNext()) {
+                result = this->add(iter->next()) || result;
             }
 
             return result;
@@ -242,11 +240,11 @@ namespace util {
          * returned by this collection's iterator method does not implement the remove method
and
          * this collection contains the specified object.
          */
-        virtual bool remove( const E& value ) {
+        virtual bool remove(const E& value) {
 
-            std::auto_ptr< Iterator<E> > iter( this->iterator() );
-            while( iter->hasNext() ) {
-                if( value == iter->next() ) {
+            std::auto_ptr<Iterator<E> > iter(this->iterator());
+            while (iter->hasNext()) {
+                if (value == iter->next()) {
                     iter->remove();
                     return true;
                 }
@@ -266,12 +264,12 @@ namespace util {
          * iterator returned by the iterator method does not implement the remove method
and this
          * collection contains one or more elements in common with the specified collection.
          */
-        virtual bool removeAll( const Collection<E>& collection ) {
+        virtual bool removeAll(const Collection<E>& collection) {
 
             bool result = false;
-            std::auto_ptr< Iterator<E> > iter( this->iterator() );
-            while( iter->hasNext() ) {
-                if( collection.contains( iter->next() ) ) {
+            std::auto_ptr<Iterator<E> > iter(this->iterator());
+            while (iter->hasNext()) {
+                if (collection.contains(iter->next())) {
                     iter->remove();
                     result = true;
                 }
@@ -291,12 +289,12 @@ namespace util {
          * iterator returned by the iterator method does not implement the remove method
and this
          * collection contains one or more elements not present in the specified collection.
          */
-        virtual bool retainAll( const Collection<E>& collection ) {
+        virtual bool retainAll(const Collection<E>& collection) {
 
             bool result = false;
-            std::auto_ptr< Iterator<E> > iter( this->iterator() );
-            while( iter->hasNext() ) {
-                if( !collection.contains( iter->next() ) ) {
+            std::auto_ptr<Iterator<E> > iter(this->iterator());
+            while (iter->hasNext()) {
+                if (!collection.contains(iter->next())) {
                     iter->remove();
                     result = true;
                 }
@@ -315,11 +313,11 @@ namespace util {
          */
         virtual std::vector<E> toArray() const {
             std::vector<E> valueArray;
-            valueArray.reserve( this->size() );
+            valueArray.reserve(this->size());
 
-            std::auto_ptr< Iterator<E> > iter( this->iterator() );
-            while( iter->hasNext() ) {
-                valueArray.push_back( iter->next() );
+            std::auto_ptr<Iterator<E> > iter(this->iterator());
+            while (iter->hasNext()) {
+                valueArray.push_back(iter->next());
             }
 
             return valueArray;
@@ -343,12 +341,12 @@ namespace util {
             mutex.wait();
         }
 
-        virtual void wait( long long millisecs ) {
-            mutex.wait( millisecs );
+        virtual void wait(long long millisecs) {
+            mutex.wait(millisecs);
         }
 
-        virtual void wait( long long millisecs, int nanos ) {
-            mutex.wait( millisecs, nanos );
+        virtual void wait(long long millisecs, int nanos) {
+            mutex.wait(millisecs, nanos);
         }
 
         virtual void notify() {

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/3b2f87e1/activemq-cpp/src/main/decaf/util/AbstractList.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/util/AbstractList.h b/activemq-cpp/src/main/decaf/util/AbstractList.h
index 0ea3c7f..cdd00b5 100644
--- a/activemq-cpp/src/main/decaf/util/AbstractList.h
+++ b/activemq-cpp/src/main/decaf/util/AbstractList.h
@@ -90,12 +90,12 @@ namespace util {
 
                 if (parent == NULL) {
                     throw decaf::lang::exceptions::NullPointerException(
-                        __FILE__, __LINE__, "List Iterator constructed with NULL parent"
);
+                        __FILE__, __LINE__, "List Iterator constructed with NULL parent");
                 }
 
                 if (start < 0 || start > parent->size()) {
                     throw decaf::lang::exceptions::IndexOutOfBoundsException(
-                         __FILE__, __LINE__, "start index passed was negative or greater
than size()" );
+                         __FILE__, __LINE__, "start index passed was negative or greater
than size()");
                 }
 
                 this->numLeft = parent->size() - start;
@@ -113,7 +113,7 @@ namespace util {
 
                 if (this->expectedModCount != this->parent->modCount) {
                     throw ConcurrentModificationException(
-                        __FILE__, __LINE__, "Concurrent Modification of Parent List detected."
);
+                        __FILE__, __LINE__, "Concurrent Modification of Parent List detected.");
                 }
 
                 try {
@@ -126,7 +126,7 @@ namespace util {
                     return result;
                 } catch (decaf::lang::exceptions::IndexOutOfBoundsException& e) {
                     throw decaf::util::NoSuchElementException(
-                        __FILE__, __LINE__, "Next called without a next element to process."
);
+                        __FILE__, __LINE__, "Next called without a next element to process.");
                 }
             }
 
@@ -134,12 +134,12 @@ namespace util {
 
                 if (this->lastPosition == -1) {
                     throw decaf::lang::exceptions::IllegalStateException(
-                        __FILE__, __LINE__, "Remove called before next() was called." );
+                        __FILE__, __LINE__, "Remove called before next() was called.");
                 }
 
                 if (this->expectedModCount != this->parent->modCount) {
                     throw ConcurrentModificationException(
-                        __FILE__, __LINE__, "Concurrent Modification of Parent List detected."
);
+                        __FILE__, __LINE__, "Concurrent Modification of Parent List detected.");
                 }
 
                 try {
@@ -152,18 +152,18 @@ namespace util {
 
                 } catch (decaf::lang::exceptions::IndexOutOfBoundsException& e) {
                     throw ConcurrentModificationException(
-                        __FILE__, __LINE__, "Concurrent Modification detected." );
+                        __FILE__, __LINE__, "Concurrent Modification detected.");
                 }
 
                 this->expectedModCount = this->parent->modCount;
                 this->lastPosition = -1;
             }
 
-            virtual void add( const E& value ) {
+            virtual void add(const E& value) {
 
                 if (this->expectedModCount != this->parent->modCount) {
                     throw ConcurrentModificationException(
-                        __FILE__, __LINE__, "Concurrent Modification of Parent List detected."
);
+                        __FILE__, __LINE__, "Concurrent Modification of Parent List detected.");
                 }
 
                 try {
@@ -172,7 +172,7 @@ namespace util {
                     this->lastPosition = -1;
                 } catch (decaf::lang::exceptions::IndexOutOfBoundsException& e) {
                     throw decaf::util::NoSuchElementException(
-                        __FILE__, __LINE__, "Add called without a next element to process."
);
+                        __FILE__, __LINE__, "Add called without a next element to process.");
                 }
             }
 
@@ -188,7 +188,7 @@ namespace util {
 
                 if (this->expectedModCount != this->parent->modCount) {
                     throw ConcurrentModificationException(
-                        __FILE__, __LINE__, "Concurrent Modification detected." );
+                        __FILE__, __LINE__, "Concurrent Modification detected.");
                 }
 
                 try {
@@ -201,7 +201,7 @@ namespace util {
                     return result;
                 } catch( decaf::lang::exceptions::IndexOutOfBoundsException& e ) {
                     throw decaf::util::NoSuchElementException(
-                        __FILE__, __LINE__, "No previous element exists." );
+                        __FILE__, __LINE__, "No previous element exists.");
                 }
             }
 
@@ -209,11 +209,11 @@ namespace util {
                 return this->parent->size() - this->numLeft - 1;
             }
 
-            virtual void set( const E& value ) {
+            virtual void set(const E& value) {
 
                 if (this->expectedModCount != this->parent->modCount) {
                     throw ConcurrentModificationException(
-                        __FILE__, __LINE__, "Concurrent Modification detected." );
+                        __FILE__, __LINE__, "Concurrent Modification detected.");
                 }
 
                 try {
@@ -244,12 +244,12 @@ namespace util {
 
                 if (parent == NULL) {
                     throw decaf::lang::exceptions::NullPointerException(
-                        __FILE__, __LINE__, "List Iterator constructed with NULL parent"
);
+                        __FILE__, __LINE__, "List Iterator constructed with NULL parent");
                 }
 
                 if (start < 0 || start > parent->size()) {
                     throw decaf::lang::exceptions::IndexOutOfBoundsException(
-                         __FILE__, __LINE__, "start index passed was negative or greater
than size()" );
+                         __FILE__, __LINE__, "start index passed was negative or greater
than size()");
                 }
 
                 this->numLeft = parent->size() - start;
@@ -267,7 +267,7 @@ namespace util {
 
                 if (this->expectedModCount != this->parent->modCount) {
                     throw ConcurrentModificationException(
-                        __FILE__, __LINE__, "Concurrent Modification of Parent List detected."
);
+                        __FILE__, __LINE__, "Concurrent Modification of Parent List detected.");
                 }
 
                 try {
@@ -280,20 +280,20 @@ namespace util {
                     return result;
                 } catch (decaf::lang::exceptions::IndexOutOfBoundsException& e) {
                     throw decaf::util::NoSuchElementException(
-                        __FILE__, __LINE__, "Next called without a next element to process."
);
+                        __FILE__, __LINE__, "Next called without a next element to process.");
                 }
             }
 
             virtual void remove() {
                 throw lang::exceptions::UnsupportedOperationException(
                     __FILE__, __LINE__,
-                    "AbstractList::Iterator::remove - Const Iterator." );
+                    "AbstractList::Iterator::remove - Const Iterator.");
             }
 
             virtual void add(const E& value DECAF_UNUSED) {
                 throw lang::exceptions::UnsupportedOperationException(
                     __FILE__, __LINE__,
-                    "AbstractList::ListIterator::radd - Const Iterator." );
+                    "AbstractList::ListIterator::radd - Const Iterator.");
             }
 
             virtual bool hasPrevious() const {
@@ -308,7 +308,7 @@ namespace util {
 
                 if (this->expectedModCount != this->parent->modCount) {
                     throw ConcurrentModificationException(
-                        __FILE__, __LINE__, "Concurrent Modification detected." );
+                        __FILE__, __LINE__, "Concurrent Modification detected.");
                 }
 
                 try {
@@ -321,7 +321,7 @@ namespace util {
                     return result;
                 } catch (decaf::lang::exceptions::IndexOutOfBoundsException& e) {
                     throw decaf::util::NoSuchElementException(
-                        __FILE__, __LINE__, "No previous element exists." );
+                        __FILE__, __LINE__, "No previous element exists.");
                 }
             }
 
@@ -332,7 +332,7 @@ namespace util {
             virtual void set(const E& value DECAF_UNUSED) {
                 throw lang::exceptions::UnsupportedOperationException(
                     __FILE__, __LINE__,
-                    "AbstractList::ListIterator::set - Const Iterator." );
+                    "AbstractList::ListIterator::set - Const Iterator.");
             }
         };
 
@@ -374,7 +374,7 @@ namespace util {
 
         virtual void add(int index DECAF_UNUSED, const E& element DECAF_UNUSED) {
             throw decaf::lang::exceptions::UnsupportedOperationException(
-                __FILE__, __LINE__, "Abstract list does not implement the add method." );
+                __FILE__, __LINE__, "Abstract list does not implement the add method.");
         }
 
         // Use this method since our own addAll will hide the base class version.
@@ -391,12 +391,12 @@ namespace util {
 
         virtual E removeAt(int index DECAF_UNUSED) {
             throw decaf::lang::exceptions::UnsupportedOperationException(
-                __FILE__, __LINE__, "Abstract list does not implement the removeAt method."
);
+                __FILE__, __LINE__, "Abstract list does not implement the removeAt method.");
         }
 
         virtual E set(int index DECAF_UNUSED, const E& element DECAF_UNUSED) {
             throw decaf::lang::exceptions::UnsupportedOperationException(
-                __FILE__, __LINE__, "Abstract list does not implement the set method." );
+                __FILE__, __LINE__, "Abstract list does not implement the set method.");
         }
 
         virtual int indexOf(const E& value) const {

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/3b2f87e1/activemq-cpp/src/main/decaf/util/AbstractMap.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/util/AbstractMap.h b/activemq-cpp/src/main/decaf/util/AbstractMap.h
index 5e8edde..407d207 100644
--- a/activemq-cpp/src/main/decaf/util/AbstractMap.h
+++ b/activemq-cpp/src/main/decaf/util/AbstractMap.h
@@ -63,14 +63,11 @@ namespace util {
 
     public:
 
-        AbstractMap() : Map<K, V>(), mutex() {
-        }
+        AbstractMap() : Map<K, V>(), mutex() {}
 
-        AbstractMap(const Map<K, V>& map) : Map<K, V>(), mutex() {
-        }
+        AbstractMap(const Map<K, V>& map) : Map<K, V>(), mutex() {}
 
-        AbstractMap(const AbstractMap<K, V>& map) : Map<K, V>(), mutex()
{
-        }
+        AbstractMap(const AbstractMap<K, V>& map) : Map<K, V>(), mutex()
{}
 
         virtual ~AbstractMap() {}
 
@@ -92,12 +89,12 @@ namespace util {
             mutex.wait();
         }
 
-        virtual void wait( long long millisecs ) {
-            mutex.wait( millisecs );
+        virtual void wait(long long millisecs) {
+            mutex.wait(millisecs);
         }
 
-        virtual void wait( long long millisecs, int nanos ) {
-            mutex.wait( millisecs, nanos );
+        virtual void wait(long long millisecs, int nanos) {
+            mutex.wait(millisecs, nanos);
         }
 
         virtual void notify() {

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/3b2f87e1/activemq-cpp/src/main/decaf/util/AbstractQueue.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/util/AbstractQueue.h b/activemq-cpp/src/main/decaf/util/AbstractQueue.h
index f5ec9b7..85ad765 100644
--- a/activemq-cpp/src/main/decaf/util/AbstractQueue.h
+++ b/activemq-cpp/src/main/decaf/util/AbstractQueue.h
@@ -60,12 +60,12 @@ namespace util {
          */
         virtual bool add(const E& value) {
 
-            if (this->offer(value )) {
+            if (this->offer(value)) {
                 return true;
             }
 
             throw decaf::lang::exceptions::IllegalStateException(
-                __FILE__, __LINE__, "Unable to add specified element to the Queue." );
+                __FILE__, __LINE__, "Unable to add specified element to the Queue.");
         }
 
         /**
@@ -100,7 +100,7 @@ namespace util {
             }
 
             throw decaf::util::NoSuchElementException(
-                __FILE__, __LINE__, "Unable to remove specified element from the Queue."
);
+                __FILE__, __LINE__, "Unable to remove specified element from the Queue.");
         }
 
         /**
@@ -112,12 +112,12 @@ namespace util {
         virtual E element() const {
 
             E result;
-            if (this->peek( result ) == true) {
+            if (this->peek(result) == true) {
                 return result;
             }
 
             throw decaf::util::NoSuchElementException(
-                __FILE__, __LINE__, "Unable to remove specified element from the Queue."
);
+                __FILE__, __LINE__, "Unable to remove specified element from the Queue.");
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/3b2f87e1/activemq-cpp/src/main/decaf/util/AbstractSequentialList.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/util/AbstractSequentialList.h b/activemq-cpp/src/main/decaf/util/AbstractSequentialList.h
index 7b8cab7..4fbcab0 100644
--- a/activemq-cpp/src/main/decaf/util/AbstractSequentialList.h
+++ b/activemq-cpp/src/main/decaf/util/AbstractSequentialList.h
@@ -80,13 +80,13 @@ namespace util {
             return this->listIterator( 0 );
         }
 
-        virtual ListIterator<E>* listIterator( int index DECAF_UNUSED ) {
+        virtual ListIterator<E>* listIterator(int index DECAF_UNUSED) {
             throw decaf::lang::exceptions::UnsupportedOperationException(
-                __FILE__, __LINE__, "Abstract sequential list does not implement the listIterator."
);
+                __FILE__, __LINE__, "Abstract sequential list does not implement the listIterator.");
         }
-        virtual ListIterator<E>* listIterator( int index DECAF_UNUSED ) const {
+        virtual ListIterator<E>* listIterator(int index DECAF_UNUSED) const {
             throw decaf::lang::exceptions::UnsupportedOperationException(
-                __FILE__, __LINE__, "Abstract sequential list does not implement the listIterator."
);
+                __FILE__, __LINE__, "Abstract sequential list does not implement the listIterator.");
         }
 
         /**
@@ -96,14 +96,13 @@ namespace util {
          * element (with listIterator(index)). Then, it gets the element using
          * ListIterator.next and returns it.
          */
-        virtual E get( int index ) const {
-
+        virtual E get(int index) const {
             try {
-                std::auto_ptr< ListIterator<E> > iter( this->listIterator(
index ) );
+                std::auto_ptr<ListIterator<E> > iter(this->listIterator(index));
                 return iter->next();
-            } catch( decaf::util::NoSuchElementException& ex ) {
+            } catch (decaf::util::NoSuchElementException& ex) {
                 throw decaf::lang::exceptions::IndexOutOfBoundsException(
-                    __FILE__, __LINE__, "get called with invalid index." );
+                    __FILE__, __LINE__, "get called with invalid index.");
             }
         }
 
@@ -114,16 +113,15 @@ namespace util {
          * (with listIterator(index)). Then, it gets the current element using
          * ListIterator.next and replaces it with ListIterator.set.
          */
-        virtual E set( int index, const E& element ) {
-
+        virtual E set(int index, const E& element) {
             try {
-                std::auto_ptr< ListIterator<E> > iter( this->listIterator(
index ) );
+                std::auto_ptr<ListIterator<E> > iter(this->listIterator(index));
                 E result = iter->next();
-                iter->set( element );
+                iter->set(element);
                 return result;
-            } catch( decaf::util::NoSuchElementException& ex ) {
+            } catch (decaf::util::NoSuchElementException& ex) {
                 throw decaf::lang::exceptions::IndexOutOfBoundsException(
-                    __FILE__, __LINE__, "set called with invalid index." );
+                    __FILE__, __LINE__, "set called with invalid index.");
             }
         }
 
@@ -134,14 +132,13 @@ namespace util {
          * (with listIterator(index)). Then, it inserts the specified element with
          * ListIterator.add.
          */
-        virtual void add( int index, const E& element ) {
-
+        virtual void add(int index, const E& element) {
             try {
-                std::auto_ptr< ListIterator<E> > iter( this->listIterator(
index ) );
-                iter->add( element );
-            } catch( decaf::util::NoSuchElementException& ex ) {
+                std::auto_ptr<ListIterator<E> > iter(this->listIterator(index));
+                iter->add(element);
+            } catch (decaf::util::NoSuchElementException& ex) {
                 throw decaf::lang::exceptions::IndexOutOfBoundsException(
-                    __FILE__, __LINE__, "add called with invalid index." );
+                    __FILE__, __LINE__, "add called with invalid index.");
             }
         }
 
@@ -154,13 +151,12 @@ namespace util {
          * from the iterator into this list, one at a time, using ListIterator.add
          * (to skip over the added element).
          */
-        virtual bool addAll( int index, const Collection<E>& source ) {
-
-            std::auto_ptr< ListIterator<E> > iter( this->listIterator( index
) );
-            std::auto_ptr< Iterator<E> > srcIter( source.iterator() );
+        virtual bool addAll(int index, const Collection<E>& source) {
+            std::auto_ptr<ListIterator<E> > iter(this->listIterator(index));
+            std::auto_ptr<Iterator<E> > srcIter(source.iterator());
             int next = iter->nextIndex();
-            while( srcIter->hasNext() ) {
-                iter->add( srcIter->next() );
+            while (srcIter->hasNext()) {
+                iter->add(srcIter->next());
             }
             return next != iter->nextIndex();
         }
@@ -171,16 +167,15 @@ namespace util {
          * This implementation first gets a list iterator pointing to the indexed element
          * (with listIterator(index)). Then, it removes the element with ListIterator.remove.
          */
-        virtual E removeAt( int index ) {
-
+        virtual E removeAt(int index) {
             try {
-                std::auto_ptr< ListIterator<E> > iter( this->listIterator(
index ) );
+                std::auto_ptr<ListIterator<E> > iter(this->listIterator(index));
                 E result = iter->next();
                 iter->remove();
                 return result;
-            } catch( decaf::util::NoSuchElementException& ex ) {
+            } catch (decaf::util::NoSuchElementException& ex) {
                 throw decaf::lang::exceptions::IndexOutOfBoundsException(
-                    __FILE__, __LINE__, "set called with invalid index." );
+                    __FILE__, __LINE__, "set called with invalid index.");
             }
         }
 

http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/3b2f87e1/activemq-cpp/src/main/decaf/util/AbstractSet.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/decaf/util/AbstractSet.h b/activemq-cpp/src/main/decaf/util/AbstractSet.h
index 1900106..e90024a 100644
--- a/activemq-cpp/src/main/decaf/util/AbstractSet.h
+++ b/activemq-cpp/src/main/decaf/util/AbstractSet.h
@@ -64,30 +64,29 @@ namespace util {
          * Note that this implementation will throw an UnsupportedOperationException if the
          * iterator returned by the iterator method does not implement the remove method.
          */
-            virtual bool removeAll(const Collection<E>& collection) {
+        virtual bool removeAll(const Collection<E>& collection) {
 
-                bool result = false;
-                if (this->size() <= collection.size()) {
+            bool result = false;
+            if (this->size() <= collection.size()) {
 
-                    std::auto_ptr<Iterator<E> > iter(this->iterator());
-                    while (iter->hasNext()) {
-                        if (collection.contains(iter->next())) {
-                            iter->remove();
-                            result = true;
-                        }
+                std::auto_ptr<Iterator<E> > iter(this->iterator());
+                while (iter->hasNext()) {
+                    if (collection.contains(iter->next())) {
+                        iter->remove();
+                        result = true;
                     }
+                }
 
-                } else {
+            } else {
 
-                    std::auto_ptr<Iterator<E> > iter(collection.iterator());
-                    while (iter->hasNext()) {
-                        result = this->remove(iter->next()) || result;
-                    }
+                std::auto_ptr<Iterator<E> > iter(collection.iterator());
+                while (iter->hasNext()) {
+                    result = this->remove(iter->next()) || result;
                 }
-
-                return result;
             }
 
+            return result;
+        }
     };
 
 }}


Mime
View raw message