felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1079744 - /felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java
Date Wed, 09 Mar 2011 11:03:24 GMT
Author: cziegeler
Date: Wed Mar  9 11:03:24 2011
New Revision: 1079744

URL: http://svn.apache.org/viewvc?rev=1079744&view=rev
Log:
FELIX-2876 : <reference> element not generated when name is missing

Modified:
    felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java

Modified: felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java?rev=1079744&r1=1079743&r2=1079744&view=diff
==============================================================================
--- felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java
(original)
+++ felix/trunk/scrplugin/generator/src/main/java/org/apache/felix/scrplugin/om/Reference.java
Wed Mar  9 11:03:24 2011
@@ -248,7 +248,7 @@ public class Reference extends AbstractO
         final JavaMethod method = this.findMethod(specVersion, methodName);
         if (method == null) {
             if ( !componentIsAbstract ) {
-                this.logError( iLog, "Missing method " + methodName + " for reference " +
this.getName() );
+                this.logError( iLog, "Missing method " + methodName + " for reference " +
(this.getName() == null ? "" : this.getName()));
             }
             return null;
         }
@@ -287,8 +287,15 @@ public class Reference extends AbstractO
 
         // append reference name with service interface and ServiceReference
         if (method == null) {
-            realMethodName = methodName + Character.toUpperCase(this.name.charAt(0))
-            + this.name.substring(1);
+            final String info;
+            if (StringUtils.isEmpty(this.name)) {
+                final String interfaceName = this.getInterfacename();
+                final int pos = interfaceName.lastIndexOf('.');
+                info = interfaceName.substring(pos + 1);
+            } else {
+                info = this.name;
+            }
+            realMethodName = methodName + Character.toUpperCase(info.charAt(0)) + info.substring(1);
 
             method = this.javaClassDescription.getMethodBySignature(realMethodName, sig);
         }



Mime
View raw message