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 271462

Summary: URLDisplayer is casted to NbURLDisplayer without any check
Product: utilities Reporter: scanti <scanti>
Component: URLAssignee: Jaroslav Havlin <jhavlin>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description scanti 2017-09-12 09:37:08 UTC
Inside o.n.core/src/org/netbeans/core/NbURLDisplayer.java at line 213 there is this code: 

((NbURLDisplayer) URLDisplayer.getDefault()).htmlViewer = null;

In our RCP application, we had to implement our own URLDisplayer, then a user of ours reported a ClassCastException because of the aforementioned code. 

I think you should add a method like reset() to URLDisplayer instead of doing the cast.