JDK-8026262 : NPE in SystemFlavorMap.getAllNativesForType - regression in jdk8 b110 by fix of #JDK-8024987
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-10-10
  • Updated: 2013-11-13
  • Resolved: 2013-10-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b115Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
Regression in JDK 8 b110 caused by the fix of issue #JDK-8024987

NPE:

java.lang.NullPointerException
   at java.awt.datatransfer.SystemFlavorMap.getAllNativesForType(SystemFlavorMap.java:1327)
   at java.awt.datatransfer.SystemFlavorMap.getNativesForFlavor(SystemFlavorMap.java:702)
   at sun.awt.datatransfer.DataTransferer.getFlavorsForFormats(DataTransferer.java:851)
   at sun.awt.dnd.SunDropTargetContextPeer.isDataFlavorSupported(SunDropTargetContextPeer.java:211)
   at sun.awt.datatransfer.TransferableProxy.isDataFlavorSupported(TransferableProxy.java:68)
   at java.awt.dnd.DropTargetContext$TransferableProxy.isDataFlavorSupported(DropTargetContext.java:355)
   at ...

Related NetBeans bug for reference:
https://netbeans.org/bugzilla/show_bug.cgi?id=236827

Comments
Verified by functional test. Ubuntu 12.04, b115
13-11-2013

There's an existing JCK test which is failing because of this issue. See JDK-8026322
11-10-2013

This fix is on the review. The cause is a forgotten null check in the JDK-8024987 fix. When we try to find all known natives for a type the flavour cache could not contain some dataflavours yet, so we are getting a null as a list of corresponding mime-types. It's a valid situation, so a simple null check fixes the problem. The fix was tested with the case described in a netbeans bug: without the fix I fail to DnD a file from Krusader file manager, with a fix I can drag it successfully.
11-10-2013