[ 
https://issues.apache.org/jira/browse/ARIES-1623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15542654#comment-15542654
 ] 

David Norris edited comment on ARIES-1623 at 10/3/16 5:32 PM:
--------------------------------------------------------------

What happens at the class level is easily illustrated:

{code:title=JShell Session|borderStyle=solid}
jshell> class FilterHelper {
   ...>     private static final String OBJECTCLASS_EXPRESSION = ".*\\(" + 
"objectClass" + "=([^)]+)\\).*";
   ...>     private static final Pattern OBJECTCLASS_PATTERN = 
Pattern.compile(OBJECTCLASS_EXPRESSION);
   ...> 
   ...>     private FilterHelper() {
   ...>         // prevent instantiation
   ...>     }
   ...> 
   ...>     public static String getObjectClass(String filter) {
   ...>         if (filter != null) {
   ...>             Matcher matcher = OBJECTCLASS_PATTERN.matcher(filter);
   ...>             if (matcher.matches() && matcher.groupCount() >= 1) {
   ...>                 return matcher.group(1);
   ...>             }
   ...>         }
   ...>         return null;
   ...>     }
   ...> }
jshell> 
FilterHelper.getObjectClass("com.stackleader.training.grpc.helloworld.api.GreeterGrpc$Greeter")
$4 ==> null
{code}

The net result is the topology manager import ignores inner classes because it 
interprets a null return from the getObjectClass method as a signal to exclude 
the import.  Its noteworthy the inner class is exported and visible to the 
importer.  There is no exception, only a silent failure. 

If this will be unsupported, an error would be appropriate, but as suggested in 
the initial description its not clear to me this should be excluded since I can 
find no exclusion in the specification.


was (Author: dcnorris):
What happens at the class level is easily illustrated:

{code:title=JShell Session|borderStyle=solid}
jshell> class FilterHelper {
   ...>     private static final String OBJECTCLASS_EXPRESSION = ".*\\(" + 
"objectClass" + "=([^)]+)\\).*";
   ...>     private static final Pattern OBJECTCLASS_PATTERN = 
Pattern.compile(OBJECTCLASS_EXPRESSION);
   ...> 
   ...>     private FilterHelper() {
   ...>         // prevent instantiation
   ...>     }
   ...> 
   ...>     public static String getObjectClass(String filter) {
   ...>         if (filter != null) {
   ...>             Matcher matcher = OBJECTCLASS_PATTERN.matcher(filter);
   ...>             if (matcher.matches() && matcher.groupCount() >= 1) {
   ...>                 return matcher.group(1);
   ...>             }
   ...>         }
   ...>         return null;
   ...>     }
   ...> }
jshell> 
FilterHelper.getObjectClass("com.stackleader.training.grpc.helloworld.api.GreeterGrpc$Greeter")
$4 ==> null
{code}

The net result is the topology manager import ignores inner classes because it 
interprets a null return from the getObjectClass method a signal to exclude the 
import.  Its noteworthy the inner class is exported and visible to the 
importer.  There is no exception, only a silent failure. 

If this will be unsupported, an error would be appropriate, but as suggested in 
the initial description its not clear to me this should be excluded since I can 
find no exclusion in the specification.

> FilterHelper OBJECTCLASS_EXPRESSION excludes inner classes
> ----------------------------------------------------------
>
>                 Key: ARIES-1623
>                 URL: https://issues.apache.org/jira/browse/ARIES-1623
>             Project: Aries
>          Issue Type: Bug
>          Components: Remote Service Admin
>            Reporter: David Norris
>
> The existing OBJECTCLASS_EXPRESSION in the FilterHelper class filters out 
> inner classes.  Its not clear to me this is a desired behavior since I can 
> find nothing in the remote service admin specification stating it is 
> unacceptable to publish a service using an inner class interface. Many code 
> generation tools choose to nest many classes into a single java file, so I 
> think there are some valid use cases for supporting this if it is not 
> excluded in the specification.
> I have submitted a patch https://github.com/apache/aries-rsa/pull/12 for 
> consideration; however, I realize this is a mirror and someone will likely 
> need to manage its merge to the official repository.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to