-
Notifications
You must be signed in to change notification settings - Fork 822
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
Cleanup raw type warnings related to WeakReference. #3923
Cleanup raw type warnings related to WeakReference. #3923
Conversation
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.
looks good
This work is done project wide.
thumbs up :)
There are 3 remaining warnings that I was unable to get resolved.
public API or some other reason? maybe we can solve this together?
I would certainly welcome the help. I just don't want to distract you from such "mundane work".. I could not figure out how to make the following API generic..
If there was some way to fix this, I would welcome the help.. Maybe @jtulach might have a suggestion since he wrote this originally. |
@BradWalker would this work? diff --git a/platform/openide.compat/src/org/openide/util/WeakListener.java b/platform/openide.compat/src/org/openide/util/WeakListener.java
index 39f5210..ac5f3f3 100644
--- a/platform/openide.compat/src/org/openide/util/WeakListener.java
+++ b/platform/openide.compat/src/org/openide/util/WeakListener.java
@@ -918,14 +918,14 @@
/** Reference that also holds ref to WeakListener.
*/
- private static final class ListenerReference extends WeakReference implements Runnable {
+ private static final class ListenerReference<T> extends WeakReference<T> implements Runnable {
private static Class lastClass;
private static String lastMethodName;
private static Method lastRemove;
private static Object LOCK = new Object();
final WeakListener weakListener;
- public ListenerReference(Object ref, WeakListener weakListener) {
+ public ListenerReference(T ref, WeakListener weakListener) {
super(ref, Utilities.activeReferenceQueue());
this.weakListener = weakListener;
}
|
[repeat] /home/bwalker/src/netbeans/platform/openide.compat/src/org/openide/util/WeakListener.java:921: warning: [rawtypes] found raw type: WeakReference [repeat] private static final class ListenerReference extends WeakReference implements Runnable { [repeat] ^ [repeat] missing type arguments for generic class WeakReference<T> [repeat] where T is a type-variable: [repeat] T extends Object declared in class WeakReference [repeat] /home/bwalker/src/netbeans/platform/openide.compat/src/org/openide/util/WeakListener.java:922: warning: [rawtypes] found raw type: Class [repeat] private static Class lastClass; [repeat] ^ [repeat] missing type arguments for generic class Class<T> [repeat] where T is a type-variable: [repeat] T extends Object declared in class Class This work is done project wide. There are 3 remaining warnings that I was unable to get resolved. They will have to wait until later.
449f18f
to
8d823d0
Compare
Hey @mbien , it did and provided the inspiration to nail down the stragglers. All references to raw type WeakReference are now cleaned up.. |
Cleanup raw type warnings related to WeakReference.
[repeat] /home/bwalker/src/netbeans/platform/openide.compat/src/org/openide/util/WeakListener.java:921: warning: [rawtypes] found raw type: WeakReference
[repeat] private static final class ListenerReference extends WeakReference implements Runnable {
[repeat] ^
[repeat] missing type arguments for generic class WeakReference
[repeat] where T is a type-variable:
[repeat] T extends Object declared in class WeakReference
[repeat] /home/bwalker/src/netbeans/platform/openide.compat/src/org/openide/util/WeakListener.java:922: warning: [rawtypes] found raw type: Class
[repeat] private static Class lastClass;
[repeat] ^
[repeat] missing type arguments for generic class Class
[repeat] where T is a type-variable:
[repeat] T extends Object declared in class Class
This work is done project wide. There are 3 remaining warnings that I was unable to get resolved. They will have to wait until later.
^Add meaningful description above
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
Please make sure (eg.
git log
) that all commits have a valid name and email address for you in the Author field.If you're a first time contributor, see the Contributing guidelines for more information.