Closed AmitRoushan closed 5 years ago
@quinton-hoole @VenuReddy2103 @sungwook-moon @maheshrajus Please have a look.
I don't think that this PR is correct. All it does is avoid generating any methods in the stub for static methods in the app. That is not what's required. Please reread #57 . Static methods need to be exposed as static methods in the generated stubs, and passed through to the server for execution.
Do not merge this PR until you get an LGTM from me please.
Following #57 comments:
I think we actually have 3 completely unrelated things being discussed in this thread:
1. Whether DM's can have static methods - today they can't and we need to fix that. That's the original topic.
2. Whether SO always export all their methods (Terry's response) - I think they should export all public methods. Just leave it at that. I think that's what happens today.
3. Whether inherited methods can be invoked on SO's. My comment, based on a misunderstanding of the above. I think they should be.
Please let me know if i missed something here.
Yes. Please reread the original description of #57. You have not done that.
Yes we can modify compiler code to maintain static methods in App stub or policy stubs but here are my opinion for not doing it:
IMHO, adding static methods in App stub or Policy stub may not be good idea.
@AmitRoushan please discuss with @VenuReddy2103 . He and I have similar opinions on the matter.
@quinton-hoole Sure, i will discuss with him.
Closing this PR as issue #57 need more discussion.
This PR handles issue raised in #57. Currently if Application, Group policy or Server policy code includes any static method, gradle build fails because generated stub contains method signature of static methods as instance method. This is not allowed in Java.
This PR added checks in stub generation for static methods for App stub, Group policy and Server policy stub.
Build Report :![image](https://user-images.githubusercontent.com/9818606/60168805-22678e00-9823-11e9-9d42-7a14a73aeb05.png)
Note Some code modifications are related to Java formatting.