Lesson #1: InvalidDnDOperationException Ruins Sanity

A friend with whom I am currently working on a programming contract called me today to tell me that the latest build wasn’t working. At all.

This irritated and confused me, as I hadn’t worked on that particular project for a week or so, and couldn’t remember having any issues with it.

I booted into Windows (I use Linux mostly), downloaded Eclipse and imported the project.

Sure enough:

java.awt.dnd.InvalidDnDOperationException: Drag and drop in progress
	at sun.awt.dnd.SunDragSourceContextPeer.setDragDropInProgress(Unknown Source)
	at java.awt.dnd.DragSource.startDrag(Unknown Source)

This error had attacked me before, but a quick investigation revealed that the issue was different this time. Joyous news.

I poked about in the (too many) classes that make up this project, but discovered nothing of use.

After some fruitless Googling, it occurred to me that during the great Refactoring Storm of August, I may have changed some of the DragGestureRecognizers’ DnDConstants to ACTION_COPY instead of ACTION_COPY_OR_MOVE.

A short, smaller storm of refactoring esued, during which all ACTION_COPY_OR_MOVE DnDConstants were changed to ACTION_COPY.

Why was this an issue at all? I was using evt.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); to accept the drops, which I guess I must have assumed would accept an ACTION_COPY drop. Seemed to in Ubuntu, anyway. Maybe the Windows JRE is more strict (re: mental)?

Why this issue hid itself until now, I don’t know. Perhaps Ubuntu just likes me more.

Lesson: test software on the target system BEFORE giving it to your team-members.

Like this post? Move it on along with:

email Email | delicious delicious | digg Digg | Tweet this post Tweet | reddit Reddit | newsvine Newsvine | furl Furl | google Google | StumbleUpon Stumble | Hao Hao HaoHao


Trackback:

Comments: 0 | Comments Feed


Scroll to top

Related posts:

  1. Drag and Drop Reordering of NSTableView’s Rows Scroll to comments I just had to re-implement drag-and-drop-reordering of Slider cells. I was lucky enough to find my post on the Cocoa-dev list – I just had to copy-paste the code. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28...
  2. Installing JDownloader in Ubuntu Scroll to comments JDownloader is an excellent download manager. When I had a Mac I used Speed Downloader, but when the free trial period ran out I switched back to DownThemAll, a download manager plugin for Firefox. The only thing I missed about Speed Downloader was its ability to store my Rapidshare Password: a [...]...
  3. Oops… So I installed a plugin, ported my project over into the new plugin, and *bang* it stopped working....
  4. Write Your Own Listener Interface (you know you want to) This tutorial was all I needed to quickly implement my listener: Listeners in Java It's clear, succinct and comprehensive. When you need to implement your custom listener interface, check it out. ...
  5. Quaqua, OS X Application Bundle – Maven – Netbeans 6.1 Scroll to comments To skip the introduction and scroll straight to the tutorial, click here. [Edit 2009: turns out I couldn't use Java for this program, it's on hold for now. I'll have to rewrite what I've done in ObjC so I can use Apple's libraries. Tutorial below still valid, however.] I’m currently developing a program [...]...

No commentsTrackback

Comments are closed.