-
Notifications
You must be signed in to change notification settings - Fork 227
Code cleanup in AnnotationModel, AnnotationMap, Javadoc inherit adjustment #3399
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
Code cleanup in AnnotationModel, AnnotationMap, Javadoc inherit adjustment #3399
Conversation
@laeubi @iloveeclipse this is the first split of the original PR. |
Mehmet, please don't hesitate to link to original tickets or PR's. It is always an extra work to find out what is related. |
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.
I miss a reasoning why we can change the API contract of these methods, it looks like a API breaking change.
Also commit message should clearly state that e.g.
Require non null LockObject in IAnnotationMap
- describe the reasoning here -
this is obviously not a cleanup / javadoc only thing!
bundles/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java
Show resolved
Hide resolved
bundles/org.eclipse.text/src/org/eclipse/jface/text/source/IAnnotationMap.java
Show resolved
Hide resolved
bundles/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationMap.java
Outdated
Show resolved
Hide resolved
88572d3
to
82ccd1e
Compare
In general I'm not sure it pays of to change anything here. Even if I can see that removing some dead code might be a good thing I wonder if it is worth the hassle here if it is "really dead". In contrast we introduce some asymmetry here to other places that use the ISycnronizer API... so I'm not totally against this but would propose to simply leave it as is. |
The point is: for the reader of the So this PR clarifies that mess and helps the reader of next one (#3397) to assume we are always working with non null lock object. |
Is there anything in this PRT to be changed? If yes, please point which exact changes are needed so we can continue. Otherwise remove the negative review, because from our understanding this PR makes sense in the context of the next one. |
This is I think what is mainly a confusing of different levels of code and it is claimed without a proof. e.g. I have checked that all public access to This is completely common way and I do not see why implementation details need to show up in the public API ... so this is my primary concern. |
Why that? |
bundles/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationMap.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationMap.java
Show resolved
Hide resolved
bundles/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java
Show resolved
Hide resolved
It's package-visible only. |
public class AnnotationModel |
My bad, I had (mis)read AnnotationMap... |
The proof is the current code in the
You have most likely checked
It is API and it should do null checks on OK, I will push a PR update that will:
|
82ccd1e
to
8050bb4
Compare
@laeubi , @mickaelistria : could you please re-review? |
Ping. |
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.
Give the limited scope of this it looks "safe" to do, I added some style comments that might or might not be considered.
bundles/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java
Show resolved
Hide resolved
bundles/org.eclipse.text/src/org/eclipse/jface/text/source/IAnnotationMap.java
Outdated
Show resolved
Hide resolved
- Clarified contract of IAnnotationMap.getLockObject() and setLockObject(). - Clarified contract of AnnotationModel.getLockObject() and setLockObject(). - Added warning in AnnotationMap.setLockObject() if the lock is changed - Removed dead code in AnnotationModel.cleanup because mapLock can't be null. Co-authored-by: Andrey Loskutov <[email protected]>
8050bb4
to
67ea81a
Compare
Uh oh!
There was an error while loading. Please reload this page.