From: Robert L. <rle...@us...> - 2007-03-21 12:21:09
|
Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv9451/src/ccmtools/generator/java/templates Modified Files: UsesDefReceptacleConnectMethodAdapterLocalTemplate.java Log Message: bug fix: wrong return value with multiple receptacles Index: UsesDefReceptacleConnectMethodAdapterLocalTemplate.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/UsesDefReceptacleConnectMethodAdapterLocalTemplate.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UsesDefReceptacleConnectMethodAdapterLocalTemplate.java 20 Mar 2007 10:56:02 -0000 1.5 --- UsesDefReceptacleConnectMethodAdapterLocalTemplate.java 21 Mar 2007 12:21:05 -0000 1.6 *************** *** 16,23 **** protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; protected final String TEXT_1 = " else if(name.equals(\""; ! protected final String TEXT_2 = "\"))" + NL + " {" + NL + " connect_"; ! protected final String TEXT_3 = "(("; ! protected final String TEXT_4 = ") obj);" + NL + " return new Components.CookieImpl();" + NL + " }"; ! protected final String TEXT_5 = NL; public String generate(Object argument) --- 16,28 ---- protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; protected final String TEXT_1 = " else if(name.equals(\""; ! protected final String TEXT_2 = "\"))" + NL + " {"; ! protected final String TEXT_3 = NL + " return connect_"; ! protected final String TEXT_4 = "(("; ! protected final String TEXT_5 = ") obj);"; ! protected final String TEXT_6 = NL + " connect_"; ! protected final String TEXT_7 = "(("; ! protected final String TEXT_8 = ") obj);" + NL + " return new Components.CookieImpl();"; ! protected final String TEXT_9 = NL + " }"; ! protected final String TEXT_10 = NL; public String generate(Object argument) *************** *** 28,36 **** stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_2); ! stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_3); ! stringBuffer.append(uses.getInterface().generateAbsoluteJavaName()); stringBuffer.append(TEXT_4); stringBuffer.append(TEXT_5); return stringBuffer.toString(); } --- 33,51 ---- stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_2); ! if(uses.isMultiple()) { stringBuffer.append(TEXT_3); ! stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_4); + stringBuffer.append(uses.getInterface().generateAbsoluteJavaName()); stringBuffer.append(TEXT_5); + } else { + stringBuffer.append(TEXT_6); + stringBuffer.append(uses.getIdentifier()); + stringBuffer.append(TEXT_7); + stringBuffer.append(uses.getInterface().generateAbsoluteJavaName()); + stringBuffer.append(TEXT_8); + } + stringBuffer.append(TEXT_9); + stringBuffer.append(TEXT_10); return stringBuffer.toString(); } |