-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring around WebBundleDescriptor and EjbBundleDescriptor #24337
Refactoring around WebBundleDescriptor and EjbBundleDescriptor #24337
Conversation
36579eb
to
0b1245f
Compare
360cda6
to
39c7e7b
Compare
- Target: make unit tests possible Signed-off-by: David Matějček <[email protected]>
Signed-off-by: David Matějček <[email protected]>
- originally it required an exact match of the parameter's type - now it first tries the exact match, when no such method exists it tries to find any compatible method of the same name. Signed-off-by: David Matějček <[email protected]>
- instead of abstract methods moving their implementation as a default impl - It is quite complicated work affecting many places, so I will do rather smaller steps. - about generics - the coverage is not perfect because of cyclic dependencies Signed-off-by: David Matějček <[email protected]>
- all classes used the same method. Signed-off-by: David Matějček <[email protected]>
- broke connectors in tests; maybe it wouldn't be an issue for user, but I am not sure with that. I will find safer path. Signed-off-by: David Matějček <[email protected]>
- default implementations - EjbApplicationExceptionInfo Signed-off-by: David Matějček <[email protected]>
- Issue: I tried to use mocking, but I have found that it doesn't work well and even if, it would not cover too much of the implementation. - dol and ejb-container have too many relations, in fact the abstraction was unusable and worthless (and even undocumented). - I can create mocks for interfaces but I can't use them for validator. - I can create half-initialized mock of the abstract class, but it throws exceptions which take too much time to investigate and finally I find that the issue is the mock, not the code I wanted to test. - Same would apply for custom implementations (like is the only one, ejb-container) - too much details matter. - In practice: dol should have much better API, OR all descriptors and nodes whould move to DOL. They can be extended and used in ejb-container, but must have some basic consistent meaningful implementation. - So I do some basic steps forward now. - Final result: test covering bug we have noticed in logs + the fix not breaking anything else. Side effect result: easier future changes. Signed-off-by: David Matějček <[email protected]>
- it was already checked for null Signed-off-by: David Matějček <[email protected]>
- This is safe as there is only one child of this abstract class Signed-off-by: David Matějček <[email protected]>
- Unused methods removed - Used methods documented (at least minimal notes) - Deprecated XML nodes from GF 3.1 marked as deprecated and removed code which used them but was worthless. Now they should be just tolerated. Signed-off-by: David Matějček <[email protected]>
Signed-off-by: David Matějček <[email protected]>
…tion - one of intermediate steps - moving methods Signed-off-by: David Matějček <[email protected]>
- validators cover possible issues just partially - better break deploy asap with more helpful info, especially when it is about glassfish issues. Signed-off-by: David Matějček <[email protected]>
- broken in recent commit of the same PR - also fixed some logs and formatting Signed-off-by: David Matějček <[email protected]>
- most of issues were more visible when I caused some inconsistency - the commit is unfortunately huge, but necessary - the architecture of the DOL is broken, always was - depends on reflection across modules and packages Signed-off-by: David Matějček <[email protected]>
- Fixes the issue when DOL used nulls because singletons weren't found in HK2 - Affected appclient, tests, validations, processing descriptors, etc. Signed-off-by: David Matějček <[email protected]>
Signed-off-by: David Matějček <[email protected]>
Signed-off-by: David Matějček <[email protected]>
- seen when deploying broken CargoTracker Signed-off-by: David Matějček <[email protected]>
Signed-off-by: David Matějček <[email protected]>
39c7e7b
to
224fb08
Compare
- foreach, avoiding for-keys-find-value, Vector replaced by ArrayList - formatting, generics, javadocs Signed-off-by: David Matějček <[email protected]>
This is a large broad set of changes touching a number of subsystems and 212 files. Not sure I can review it tbh. I'd have to assume it is correct. |
This will take me a little time to work through, but I agree with the general direction. |
@@ -268,7 +160,7 @@ private ConnectionFactoryDefinitionDescriptor createDescriptor(ConnectionFactory | |||
desc.setMaxPoolSize(defn.maxPoolSize()); | |||
desc.setMinPoolSize(defn.minPoolSize()); | |||
|
|||
if (defn.description() != null && !defn.description().equals("")) { | |||
if (defn.description() != null && !defn.description().isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also use the GF utility method for this;
com.sun.enterprise.util.Utility.isEmpty(String)
I completely agree that it is horrible, but I have no idea how to move from "swamps of DOL" by a different way. I could make a PR after every safe point, but even then it would not help too much. Everything is fragile, in previous iterations I learned some "rules" how to avoid breaking things. Also in the first iteration it took a whole day to find out where I did the bad step, this time it was much faster. There are overlapping interfaces and methods, removing one can break deployment or related things despite it compiles. Many reflections used to set attributes or just call methods; when they are just setters or "adders", it is easy, but sometimes they depend on the order of execution, which is fragile, fragile, fragile ... That leads to some "stack" and "routine" in refactoring. And also thinking about next iterations. Reviewing it by reading code is nearly worthless (except well visible mistakes I really could make), that's why I always run the TCK and why we were helping the TCK (so we can run it against GF PR), in last two years we also (partially) fixed the "Zombie Army" (Ant tests, I'm often checking if the count of passing tests did not decrease), now I'm trying to make friends of GF and CargoTracker (the last issue: derby pool). Good thing is that in the future it should converge to some more ideal state and those PRs should be smaller and smaller. I believe that creating them is still more painful than reading them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it passed the TCK, so we could say it meets the minimum quality requirements. although incompatibilities should be carefully checked afterwards, I'd welcome modifications that would make GlassFish more testable.
Context:
So, here we go.
Fixed issues:
Tests:
Breaking changes: