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.

Bug 255371 - IllegalArgumentException: java.lang.ClassCastException@6ac08f22
Summary: IllegalArgumentException: java.lang.ClassCastException@6ac08f22
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.1
Hardware: All All
: P1 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-17 14:29 UTC by MackSix
Modified: 2015-09-23 01:24 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 219998


Attachments
stacktrace (480 bytes, text/plain)
2015-09-17 14:29 UTC, MackSix
Details
Log file (324.38 KB, text/plain)
2015-09-18 05:06 UTC, MackSix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2015-09-17 14:29:53 UTC
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)
Comment 1 MackSix 2015-09-17 14:29:54 UTC
Created attachment 156252 [details]
stacktrace
Comment 2 MackSix 2015-09-18 05:06:37 UTC
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)
Comment 3 Antonin Nebuzelsky 2015-09-18 10:54:31 UTC
-> Utilities / Diff

Seems like the fix of issue 252618 did not help.
Comment 4 Ondrej Vrabec 2015-09-19 11:54:23 UTC
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.
Comment 5 Martin Entlicher 2015-09-21 12:14:34 UTC
I was able to write a test on WeakListenerImpl, which fails.
Working on a fix...
Comment 6 Martin Entlicher 2015-09-21 12:36:47 UTC
Fixed by changeset:   292346:ff8d3c10a365
http://hg.netbeans.org/core-main/rev/ff8d3c10a365
Comment 7 Quality Engineering 2015-09-23 01:24:55 UTC
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.