[kepler-dev] [Bug 4478] - Configuring ports

bugzilla-daemon at ecoinformatics.org bugzilla-daemon at ecoinformatics.org
Wed Oct 21 11:54:45 PDT 2009


http://bugzilla.ecoinformatics.org/show_bug.cgi?id=4478





------- Comment #6 from cxh at eecs.berkeley.edu  2009-10-21 11:54 -------
I was able to reproduce this once, but now I can't.

The problem here is that swapping the name of two ports (or any two objects
that
extend NamedObj) require renaming one to a temporary name first.
So, to swap A and B.
1. Rename A to C
2. Click Apply
3. Rename B to A
4. Click Apply
5. Rename C to B
6. Click Commit.

When I use the port configuration dialog to just swap two names:
1. Rename A to B
2. Rename B to A
3. Click Apply

I get a name duplication exception, which is as expected.  What happens
here is that the table is processed by row and any change requests are
added to StringBuffer of change requests.  When all the rows are done, 
all the change requests are executed.  So, when swapping two names,
the first change request tries to change the name of A to B, but there
is already a B, so we get a name duplication exception.  Then, the
second change request occurs, which is to swap B to A, but A still
exists, so we get a second name duplication exception.  This is as expected.

One strange thing is that the error is reported to stderr instead of being
popped up in a dialog.  This is because the error occurs in the Swing Event
Thread.
I modified the code so that it calls MessageHandler.error() so that the
an error dialog will appear.

PortConfigurerDialog checks to see if there are duplicate names, checking
for swapped names seems rather tricky and error prone.  To do this would
require doing a bunch of the name duplication checks that we do anyway.
So, unless we get a more compelling and reproducible test case that brings
up the stack trace, I'm tempted to leave this one as is with the error
message coming up in a dialog and the error message giving a hint about
how to swap names.


More information about the Kepler-dev mailing list