Author: tabish
Date: Tue Mar 23 15:35:12 2010
New Revision: 926626

URL: http://svn.apache.org/viewvc?rev=926626&view=rev
Log:
Refactored the command generators to init member data in Constructor 
initialization lists instead of in the constructor body.  This reduces the 
numer of method calls to initialize member data from two to one in most cases 
speeding up construction time.

Modified:
    
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandHeaderGenerator.java
    
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandSourceGenerator.java
    
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdSourceGenerator.java
    
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdHeaderGenerator.java
    
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdSourceGenerator.java
    
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java
    
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java
    
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdSourceGenerator.java
    
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdSourceGenerator.java
    
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java

Modified: 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandHeaderGenerator.java
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandHeaderGenerator.java?rev=926626&r1=926625&r2=926626&view=diff
==============================================================================
--- 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandHeaderGenerator.java
 (original)
+++ 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandHeaderGenerator.java
 Tue Mar 23 15:35:12 2010
@@ -66,7 +66,7 @@ public class CommandHeaderGenerator exte
         if( !isAssignable() ) {
             out.println("    protected:");
             out.println("");
-            out.println("        "+getClassName()+"( const "+getClassName()+"& 
) : " + getBaseClassName() + "() {};");
+            out.println("        "+getClassName()+"( const "+getClassName()+"& 
);");
             out.println("        "+getClassName()+"& operator= ( const 
"+getClassName()+"& ) { return *this; };");
             out.println("");
         }

Modified: 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandSourceGenerator.java
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandSourceGenerator.java?rev=926626&r1=926625&r2=926626&view=diff
==============================================================================
--- 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandSourceGenerator.java
 (original)
+++ 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandSourceGenerator.java
 Tue Mar 23 15:35:12 2010
@@ -53,18 +53,19 @@ public class CommandSourceGenerator exte
         out.println(" */");
         out.println("");
         
out.println("////////////////////////////////////////////////////////////////////////////////");
-        out.println(""+getClassName()+"::"+getClassName()+"() : " + 
getBaseClassName() + "() {");
+        out.println(""+getClassName()+"::"+getClassName()+"() " );
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
         out.println("");
         generateDefaultConstructorBody(out);
         out.println("}");
         out.println("");
-        if( isAssignable() ) {
-            
out.println("////////////////////////////////////////////////////////////////////////////////");
-            out.println(""+getClassName()+"::"+getClassName()+"( const 
"+getClassName()+"& other ) : " + getBaseClassName() + "() {");
-            out.println("    this->copyDataStructure( &other );");
-            out.println("}");
-            out.println("");
-        }
+        
out.println("////////////////////////////////////////////////////////////////////////////////");
+        out.println(""+getClassName()+"::"+getClassName()+"( const 
"+getClassName()+"& other )");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
+        out.println("");
+        out.println("    this->copyDataStructure( &other );");
+        out.println("}");
+        out.println("");
         generateAdditionalConstructors(out);
         
out.println("////////////////////////////////////////////////////////////////////////////////");
         out.println(""+getClassName()+"::~"+getClassName()+"() {");
@@ -196,18 +197,47 @@ public class CommandSourceGenerator exte
     }
 
     protected void generateDefaultConstructorBody( PrintWriter out ) {
+//        for( JProperty property : getProperties() ) {
+//            String type = toCppType(property.getType());
+//            String value = toCppDefaultValue(property.getType());
+//            String propertyName = property.getSimpleName();
+//            String parameterName = decapitalize(propertyName);
+//
+//            if( property.getType().isPrimitiveType() ||
+//                type.startsWith("std::string") ) {
+//
+//                out.println("    this->"+parameterName+" = "+value+";");
+//            }
+//        }
+    }
+
+    protected String generateInitializerList(String current) {
+
+        StringBuilder result = new StringBuilder();
+        int lastLineEnds = 0;
+
+        if( current != null ) {
+            result.append(current);
+        }
+
         for( JProperty property : getProperties() ) {
             String type = toCppType(property.getType());
             String value = toCppDefaultValue(property.getType());
             String propertyName = property.getSimpleName();
             String parameterName = decapitalize(propertyName);
 
-            if( property.getType().isPrimitiveType() ||
-                type.startsWith("std::string") ) {
+            result.append(", ");
 
-                out.println("    this->"+parameterName+" = "+value+";");
+            int currentLength = result.toString().length();
+            if( ( currentLength - lastLineEnds ) >= 120 ) {
+                lastLineEnds = currentLength;
+                result.append("\n");
+                result.append("      ");
             }
+            result.append(parameterName + "(" + value + ")" );
         }
+
+        return result.toString();
     }
 
     protected void generateDestructorBody( PrintWriter out ) {

Modified: 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdSourceGenerator.java
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdSourceGenerator.java?rev=926626&r1=926625&r2=926626&view=diff
==============================================================================
--- 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdSourceGenerator.java
 (original)
+++ 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConnectionIdSourceGenerator.java
 Tue Mar 23 15:35:12 2010
@@ -32,17 +32,23 @@ public class ConnectionIdSourceGenerator
 
     protected void generateAdditionalConstructors( PrintWriter out ) {
         
out.println("////////////////////////////////////////////////////////////////////////////////");
-        out.println("ConnectionId::ConnectionId( const SessionId* sessionId ) 
{");
+        out.println("ConnectionId::ConnectionId( const SessionId* sessionId 
)");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
+        out.println("");
         out.println("    this->value = sessionId->getConnectionId();");
         out.println("}");
         out.println("");
         
out.println("////////////////////////////////////////////////////////////////////////////////");
-        out.println("ConnectionId::ConnectionId( const ProducerId* producerId 
) {");
+        out.println("ConnectionId::ConnectionId( const ProducerId* producerId 
)");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
+        out.println("");
         out.println("    this->value = producerId->getConnectionId();");
         out.println("}");
         out.println("");
         
out.println("////////////////////////////////////////////////////////////////////////////////");
-        out.println("ConnectionId::ConnectionId( const ConsumerId* consumerId 
) {");
+        out.println("ConnectionId::ConnectionId( const ConsumerId* consumerId 
)");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
+        out.println("");
         out.println("    this->value = consumerId->getConnectionId();");
         out.println("}");
         out.println("");

Modified: 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdHeaderGenerator.java
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdHeaderGenerator.java?rev=926626&r1=926625&r2=926626&view=diff
==============================================================================
--- 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdHeaderGenerator.java
 (original)
+++ 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdHeaderGenerator.java
 Tue Mar 23 15:35:12 2010
@@ -29,11 +29,7 @@ public class ConsumerIdHeaderGenerator e
     }
 
     protected void generateAdditionalConstructors( PrintWriter out ) {
-        out.println("        "+getClassName()+"( const SessionId& sessionId, 
long long consumerIdd ) {");
-        out.println("            this->connectionId = 
sessionId.getConnectionId();");
-        out.println("            this->sessionId = sessionId.getValue();");
-        out.println("            this->value = consumerIdd;");
-        out.println("        }");
+        out.println("        "+getClassName()+"( const SessionId& sessionId, 
long long consumerIdd );");
         out.println("");
 
         super.generateAdditionalConstructors(out);

Modified: 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdSourceGenerator.java
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdSourceGenerator.java?rev=926626&r1=926625&r2=926626&view=diff
==============================================================================
--- 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdSourceGenerator.java
 (original)
+++ 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ConsumerIdSourceGenerator.java
 Tue Mar 23 15:35:12 2010
@@ -21,6 +21,32 @@ import java.util.Set;
 
 public class ConsumerIdSourceGenerator extends CommandSourceGenerator {
 
+    protected void generateAdditionalConstructors( PrintWriter out ) {
+
+        
out.println("////////////////////////////////////////////////////////////////////////////////");
+        out.println("ConsumerId::ConsumerId( const SessionId& sessionId, long 
long consumerIdd )");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
+        out.println("");
+        out.println("    this->connectionId = sessionId.getConnectionId();");
+        out.println("    this->sessionId = sessionId.getValue();");
+        out.println("    this->value = consumerIdd;");
+        out.println("}");
+        out.println("");
+
+        super.generateAdditionalConstructors(out);
+    }
+
+    protected String generateInitializerList(String current) {
+        StringBuilder result = new StringBuilder();
+
+        if( current != null ){
+            result.append(current);
+        }
+        result.append(", parentId()");
+
+        return super.generateInitializerList(result.toString());
+    }
+
     protected void generateAdditionalMethods( PrintWriter out ) {
         
out.println("////////////////////////////////////////////////////////////////////////////////");
         out.println("const Pointer<SessionId>& ConsumerId::getParentId() const 
{");

Modified: 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java?rev=926626&r1=926625&r2=926626&view=diff
==============================================================================
--- 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java
 (original)
+++ 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java
 Tue Mar 23 15:35:12 2010
@@ -24,24 +24,32 @@ public class MessageIdSourceGenerator ex
     protected void generateAdditionalConstructors( PrintWriter out ) {
 
         
out.println("////////////////////////////////////////////////////////////////////////////////");
-        out.println("MessageId::MessageId( const std::string& messageKey ) {");
+        out.println("MessageId::MessageId( const std::string& messageKey )");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
+        out.println("");
         out.println("    this->setValue( messageKey );");
         out.println("}");
         out.println("");
         
out.println("////////////////////////////////////////////////////////////////////////////////");
-        out.println("MessageId::MessageId( const Pointer<ProducerInfo>& 
producerInfo, long long producerSequenceId ) {");
+        out.println("MessageId::MessageId( const Pointer<ProducerInfo>& 
producerInfo, long long producerSequenceId )");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
+        out.println("");
         out.println("    this->producerId = producerInfo->getProducerId();");
         out.println("    this->producerSequenceId = producerSequenceId;");
         out.println("}");
         out.println("");
         
out.println("////////////////////////////////////////////////////////////////////////////////");
-        out.println("MessageId::MessageId( const Pointer<ProducerId>& 
producerId, long long producerSequenceId ) {");
+        out.println("MessageId::MessageId( const Pointer<ProducerId>& 
producerId, long long producerSequenceId )");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
+        out.println("");
         out.println("    this->producerId = producerId;");
         out.println("    this->producerSequenceId = producerSequenceId;");
         out.println("}");
         out.println("");
         
out.println("////////////////////////////////////////////////////////////////////////////////");
-        out.println("MessageId::MessageId( const std::string& producerId, long 
long producerSequenceId ) {");
+        out.println("MessageId::MessageId( const std::string& producerId, long 
long producerSequenceId )");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
+        out.println("");
         out.println("    this->producerId.reset( new ProducerId( producerId ) 
);");
         out.println("    this->producerSequenceId = producerSequenceId;");
         out.println("}");
@@ -50,6 +58,17 @@ public class MessageIdSourceGenerator ex
         super.generateAdditionalConstructors(out);
     }
 
+    protected String generateInitializerList(String current) {
+        StringBuilder result = new StringBuilder();
+
+        if( current != null ){
+            result.append(current);
+        }
+        result.append(", key(\"\")");
+
+        return super.generateInitializerList(result.toString());
+    }
+
     protected void generateAdditionalMethods( PrintWriter out ) {
         
out.println("////////////////////////////////////////////////////////////////////////////////");
         out.println("void MessageId::setValue( const std::string& key ) {");

Modified: 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java?rev=926626&r1=926625&r2=926626&view=diff
==============================================================================
--- 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java
 (original)
+++ 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java
 Tue Mar 23 15:35:12 2010
@@ -31,13 +31,19 @@ public class MessageSourceGenerator exte
         includes.add("<decaf/lang/System.h>");
     }
 
-    protected void generateDefaultConstructorBody( PrintWriter out ) {
+    protected String generateInitializerList(String current) {
+        StringBuilder result = new StringBuilder();
 
-        out.println("    this->readOnlyBody = false;");
-        out.println("    this->readOnlyProperties = false;");
-        out.println("    this->connection = NULL;");
+        if( current != null ){
+            result.append(current);
+        }
+        result.append(", ackHandler(NULL)");
+        result.append(", properties()");
+        result.append(", readOnlyProperties(false)");
+        result.append(", readOnlyBody(false)");
+        result.append(", connection(NULL)");
 
-        super.generateDefaultConstructorBody(out);
+        return super.generateInitializerList(result.toString());
     }
 
     protected void generateCopyDataStructureBody( PrintWriter out ) {

Modified: 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdSourceGenerator.java
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdSourceGenerator.java?rev=926626&r1=926625&r2=926626&view=diff
==============================================================================
--- 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdSourceGenerator.java
 (original)
+++ 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ProducerIdSourceGenerator.java
 Tue Mar 23 15:35:12 2010
@@ -24,14 +24,17 @@ public class ProducerIdSourceGenerator e
     protected void generateAdditionalConstructors( PrintWriter out ) {
 
         
out.println("////////////////////////////////////////////////////////////////////////////////");
-        out.println("ProducerId::ProducerId( const SessionId& sessionId, long 
long consumerId ) {");
+        out.println("ProducerId::ProducerId( const SessionId& sessionId, long 
long consumerId )");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
+        out.println("");
         out.println("    this->connectionId = sessionId.getConnectionId();");
         out.println("    this->sessionId = sessionId.getValue();");
         out.println("    this->value = consumerId;");
         out.println("}");
         out.println("");
         
out.println("////////////////////////////////////////////////////////////////////////////////");
-        out.println("ProducerId::ProducerId( std::string producerKey ) {");
+        out.println("ProducerId::ProducerId( std::string producerKey )");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
         out.println("");
         out.println("    // Parse off the producerId");
         out.println("    std::size_t p = producerKey.rfind( ':' );");
@@ -48,6 +51,17 @@ public class ProducerIdSourceGenerator e
         super.generateAdditionalConstructors(out);
     }
 
+    protected String generateInitializerList(String current) {
+        StringBuilder result = new StringBuilder();
+
+        if( current != null ){
+            result.append(current);
+        }
+        result.append(", parentId()");
+
+        return super.generateInitializerList(result.toString());
+    }
+
     protected void generateAdditionalMethods( PrintWriter out ) {
         
out.println("////////////////////////////////////////////////////////////////////////////////");
         out.println("const Pointer<SessionId>& ProducerId::getParentId() const 
{");

Modified: 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdSourceGenerator.java
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdSourceGenerator.java?rev=926626&r1=926625&r2=926626&view=diff
==============================================================================
--- 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdSourceGenerator.java
 (original)
+++ 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionIdSourceGenerator.java
 Tue Mar 23 15:35:12 2010
@@ -39,22 +39,39 @@ public class SessionIdSourceGenerator ex
         out.println("    return stream.str();");
     }
 
+    protected String generateInitializerList(String current) {
+        StringBuilder result = new StringBuilder();
+
+        if( current != null ){
+            result.append(current);
+        }
+        result.append(", parentId()");
+
+        return super.generateInitializerList(result.toString());
+    }
+
     protected void generateAdditionalConstructors( PrintWriter out ) {
 
         
out.println("////////////////////////////////////////////////////////////////////////////////");
-        out.println("SessionId::SessionId( const ConnectionId* connectionId, 
long long sessionId ) {");
+        out.println("SessionId::SessionId( const ConnectionId* connectionId, 
long long sessionId )");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
+        out.println("");
         out.println("    this->connectionId = connectionId->getValue();");
         out.println("    this->value = sessionId;");
         out.println("}");
         out.println("");
         
out.println("////////////////////////////////////////////////////////////////////////////////");
-        out.println("SessionId::SessionId( const ProducerId* producerId ) {");
+        out.println("SessionId::SessionId( const ProducerId* producerId )");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
+        out.println("");
         out.println("    this->connectionId = producerId->getConnectionId();");
         out.println("    this->value = producerId->getSessionId();");
         out.println("}");
         out.println("");
         
out.println("////////////////////////////////////////////////////////////////////////////////");
-        out.println("SessionId::SessionId( const ConsumerId* consumerId ) {");
+        out.println("SessionId::SessionId( const ConsumerId* consumerId )");
+        out.println("    : " + generateInitializerList(getBaseClassName() + 
"()") + " {");
+        out.println("");
         out.println("    this->connectionId = consumerId->getConnectionId();");
         out.println("    this->value = consumerId->getSessionId();");
         out.println("}");

Modified: 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java?rev=926626&r1=926625&r2=926626&view=diff
==============================================================================
--- 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java
 (original)
+++ 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java
 Tue Mar 23 15:35:12 2010
@@ -29,10 +29,15 @@ public class SessionInfoSourceGenerator 
         super.populateIncludeFilesSet();
     }
 
-    protected void generateDefaultConstructorBody( PrintWriter out ) {
+    protected String generateInitializerList(String current) {
+        StringBuilder result = new StringBuilder();
 
-        out.println( "    this->ackMode = (unsigned 
int)cms::Session::AUTO_ACKNOWLEDGE;" );
-        super.generateDefaultConstructorBody(out);
+        if( current != null ){
+            result.append(current);
+        }
+        result.append(", ackMode((unsigned 
int)cms::Session::AUTO_ACKNOWLEDGE)");
+
+        return super.generateInitializerList(result.toString());
     }
 
     protected void generateAdditionalMethods( PrintWriter out ) {


Reply via email to