Cut & Paste in Module Editor not working for custom subclass

When using a custom subclass of PieceSlot (in order to override piece dragging to display number of hexes dragged) I found I was unable to paste a piece after cutting or copying it.

Investigating the error is due to the custom class not being recognised as a valid class of configurable at the location where it is to be pasted, even though it is a subclass of a valid class.

The error is in VASSAL.configure.ConfigureTree at line 839:

should be

if (c[i].isAssignableFrom(child.getClass())) {

instead of

if (c[i] == child.getClass()) {

so that subclasses can be substituted for the standard class.

Thus spake george973:

When using a custom subclass of PieceSlot (in order to override piece
dragging to display number of hexes dragged) I found I was unable to
paste a piece after cutting or copying it.

Investigating the error is due to the custom class not being recognised
as a valid class of configurable at the location where it is to be
pasted, even though it is a subclass of a valid class.

The error is in VASSAL.configure.ConfigureTree at line 839:

should be

if (c[i].isAssignableFrom(child.getClass())) {

instead of

if (c[i] == child.getClass()) {

so that subclasses can be substituted for the standard class.

Would you file a bug for that, so that we remember to fix it for 3.1.16?


J.

Thus spake george973:

When using a custom subclass of PieceSlot (in order to override piece
dragging to display number of hexes dragged) I found I was unable to
paste a piece after cutting or copying it.

Investigating the error is due to the custom class not being recognised
as a valid class of configurable at the location where it is to be
pasted, even though it is a subclass of a valid class.

The error is in VASSAL.configure.ConfigureTree at line 839:

should be

if (c[i].isAssignableFrom(child.getClass())) {

instead of

if (c[i] == child.getClass()) {

so that subclasses can be substituted for the standard class.

Fixed in 3.1@7663.


J.