Commit cef96270 authored by Lionel Seinturier's avatar Lionel Seinturier
Browse files

Use service type simple name when the service name in missing in the @Service...

Use service type simple name when the service name in missing in the @Service annotation. No need to lower case the 1st character according to the spec.
parent c14cc289
......@@ -158,8 +158,8 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf {
/*
* Retrieve provided services declared by the @Service annotation.
* Naming convention for service names: if the names parameter is not
* not specified, the name is infered from the name of the type with a
* lower case first letter.
* not specified, the service name is the simple name of the service
* type.
*
* TODO iterate on inherited classes to retrieve @Service annotations
* TODO iterate on implemented interfaces to retrieve @Service annotations
......@@ -175,16 +175,10 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf {
// Fill the service map
for (int i = 0; i < services.length; i++) {
String name = null;
if( i < servicenames.length ) {
name = servicenames[i];
}
else {
String s = services[i].getSimpleName();
String head = s.substring(0,1).toLowerCase();
String tail = s.substring(1);
name = head + tail;
}
String name =
i < servicenames.length ?
servicenames[i] :
services[i].getSimpleName();
if( servicemap.containsKey(name) ) {
String msg = "Duplicate service name "+name+" in "+adl;
throw new IOException(msg);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment