This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
This bug was originally marked as duplicate of bug 252618, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related. Build: NetBeans IDE Dev (Build 201509170002) VM: Java HotSpot(TM) 64-Bit Server VM, 25.60-b23, Java(TM) SE Runtime Environment, 1.8.0_60-b27 OS: Windows 7 User Comments: MackSix: Looking at History tab of a Java file and this happened. Stacktrace: java.lang.IllegalArgumentException: java.lang.ClassCastException@6ac08f22 at sun.reflect.GeneratedMethodAccessor152.invoke(GeneratedMethodAccessor152.java:0) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.openide.util.WeakListenerImpl$ListenerReference.run(WeakListenerImpl.java:638) at org.openide.util.lookup.implspi.ActiveQueue$Daemon.run(ActiveQueue.java:192)
Created attachment 156252 [details] stacktrace
Created attachment 156274 [details] Log file This is also throwing these, but when the exception reporter pops up for them, it sends the report to a "RESOLVED INVALID" bug report here: https://netbeans.org/bugzilla/show_bug.cgi?id=205028 See attached log file. java.lang.IllegalArgumentException: object is not an instance of declaring class at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) [catch] at org.openide.util.WeakListenerImpl$ListenerReference.run(WeakListenerImpl.java:638) at org.openide.util.lookup.implspi.ActiveQueue$Daemon.run(ActiveQueue.java:192)
-> Utilities / Diff Seems like the fix of issue 252618 did not help.
Martine, your changes in #244307f75984 to WeakListenerImpl seem to be a bit problematic. Even after my last fix when i register the listener this way: jEditorPane1.getEditorPane().addPropertyChangeListener("font", WeakListeners.propertyChange(list, "font", jEditorPane1.getEditorPane())); //NOI18N it still does not work, WeakListenerImpl tries to call: org.netbeans.editor.BaseCaret.removeChangeListener(javax.swing.event.ChangeListener) for the following input: org.netbeans.modules.diff.builtin.visualizer.editable.DecoratedEditorPane / removePropertyChangeListener which is clearly wrong. Seems there is a problem in caching last used methods, can you look at it? I can live with the old way of registration (without the named property) but if it does not work in general, the changes in WeakListeners should be removed or fixed.
I was able to write a test on WeakListenerImpl, which fails. Working on a fix...
Fixed by changeset: 292346:ff8d3c10a365 http://hg.netbeans.org/core-main/rev/ff8d3c10a365
Integrated into 'main-silver', will be available in build *201509230002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/ff8d3c10a365 User: mentlicher@netbeans.org Log: #255371: Correcting the last cache for named listeners.