-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
Feature(CtPackage): Implement null object for CtPackage #3705
Comments
Excellent idea. |
Hello sir, I'm not sure about the above approach but if you could help me out with this. |
I am interested in working on this issue. Can someone please tell me a little more about the scope of this task? |
This would be a perfect starting point.
All three tasks can be done in multiple pull requests . |
Thank you @MartinWitt ! |
I am currently working on implementing this null object. I need some help with the following topics:
|
Just return false because technical it is not a shadow object.
Create, for example, a class( |
Thank you for your advice!
I'd like to know what is meant by 'behaving the same' here. |
I made a WIP pull request for this issue. |
Problem
Sometimes code elements have no package and
getPackage
return nulls. This introduces null checks and surprises for new developers. 84c84e1 as seen here, package can be null.Solution
A null object[0],[1] could improve code quality. A comparable implementation is NoSourcePosition.
NoSourcePosition
removed all null checks for positions and improves the code quality.Your task
Design a null object and refactor old code. Find a solution for
getSimpleName()
as the empty String is reserved for default package.The PR should include:
It's a good starter issue, feel free to give it a try and ping if you need help for some design decisions.
Literatur/Links
[0] https://en.wikipedia.org/wiki/Null_object_pattern
[1] https://www.baeldung.com/java-null-object-pattern
The text was updated successfully, but these errors were encountered: