From: Chad B. <cwb...@us...> - 2006-12-29 14:52:20
|
User: cwbrandon Date: 06/12/29 06:52:21 Modified: andromda-spring/src/java/org/andromda/cartridges/spring/metafacades Tag: V3_x_HEAD SpringServiceOperationLogicImpl.java andromda-spring/src/test/expected Tag: V3_x_HEAD cartridge-output.zip andromda-spring/src/templates/spring Tag: V3_x_HEAD SpringServiceBase.vsl Log: fix a bug that occurs when modeling messages being received that don't have return types Revision Changes Path No revision No revision 1.17.4.3 +18 -10 cartridges/andromda-spring/src/java/org/andromda/cartridges/spring/metafacades/SpringServiceOperationLogicImpl.java Index: SpringServiceOperationLogicImpl.java =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-spring/src/java/org/andromda/cartridges/spring/metafacades/SpringServiceOperationLogicImpl.java,v retrieving revision 1.17.4.2 retrieving revision 1.17.4.3 diff -u -w -r1.17.4.2 -r1.17.4.3 --- SpringServiceOperationLogicImpl.java 24 Dec 2006 21:29:39 -0000 1.17.4.2 +++ SpringServiceOperationLogicImpl.java 29 Dec 2006 14:52:08 -0000 1.17.4.3 @@ -162,15 +162,19 @@ */ protected String handleGetOutgoingMessageImplementationCall() { - return this.getOutgoingMessageImplementationCall("session"); + return this.getMessageImplementationCall("session"); } - private String getOutgoingMessageImplementationCall(String firstArgument) + private String getMessageImplementationCall(String firstArgument) { final StringBuffer buffer = new StringBuffer(); buffer.append(StringUtils.capitalize(this.getName())); - buffer.append("(" + firstArgument + ", "); - buffer.append(this.getArgumentNames()); + buffer.append("(" + firstArgument); + final String argumentNames = this.getArgumentNames(); + if (StringUtils.isNotBlank(argumentNames)) + { + buffer.append(", ").append(argumentNames); + } buffer.append(")"); return this.getImplementationOperationName(buffer.toString()); } @@ -186,11 +190,15 @@ private String getMessagingImplementationSignature(final String firstArgument) { final StringBuffer signature = new StringBuffer(this.getImplementationName()); - signature.append("(" + firstArgument + ", "); - signature.append(MetafacadeUtils.getTypedArgumentList( + signature.append("(" + firstArgument); + final String arguments = MetafacadeUtils.getTypedArgumentList( this.getArguments(), true, - null)); + null); + if (StringUtils.isNotBlank(arguments)) + { + signature.append(", ").append(arguments); + } signature.append(")"); return signature.toString(); } @@ -200,7 +208,7 @@ */ protected String handleGetIncomingMessageImplementationCall() { - return this.getOutgoingMessageImplementationCall("message"); + return this.getMessageImplementationCall("message"); } /** No revision No revision 1.269.2.82 +286 -287 cartridges/andromda-spring/src/test/expected/cartridge-output.zip <<Binary file>> No revision No revision 1.31.4.16 +4 -0 cartridges/andromda-spring/src/templates/spring/SpringServiceBase.vsl Index: SpringServiceBase.vsl =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-spring/src/templates/spring/SpringServiceBase.vsl,v retrieving revision 1.31.4.15 retrieving revision 1.31.4.16 diff -u -w -r1.31.4.15 -r1.31.4.16 --- SpringServiceBase.vsl 24 Dec 2006 21:29:48 -0000 1.31.4.15 +++ SpringServiceBase.vsl 29 Dec 2006 14:52:21 -0000 1.31.4.16 @@ -161,7 +161,11 @@ }); #elseif ($operation.incomingMessageOperation) final javax.jms.Message message = ${operation.incomingDestination.templateBeanName}.receive(); +#if ($operation.returnTypePresent) return this.${operation.incomingMessageImplementationCall}; +#else + this.${operation.incomingMessageImplementationCall}; +#end #end } #foreach($exception in $operation.exceptions) |