My first bug fix

This is the first VASSAL bug I’ve tried to fix, so I want to ensure I’m following the proper process.

I have assigned bug #2490 to myself.

I’ll do a big more investigation before finalizing a fix, but I suspect all that needs to change is sprinkling some hasMoreTokens() calls in Decorator.mergeState(). As currently written, Decorator.mergeState() is violating the SequenceEncoder.Decoder contract.

What is the process for reviewing my fix once it’s coded?

-K

Thus spake fil512:

This is the first VASSAL bug I’ve tried to fix, so I want to ensure I’m
following the proper process.

I have assigned bug #2490 to myself.

I’ll do a big more investigation before finalizing a fix, but I suspect
all that needs to change is sprinkling some hasMoreTokens() calls in
Decorator.mergeState(). As currently written, Decorator.mergeState() is
violating the SequenceEncoder.Decoder contract.

What is the process for reviewing my fix once it’s coded?

Normally I’d review these, but since this is part of trait serialization,
it’s not really my area of expertise, so it would be good if Brent had
a look, too. (He’s more likely to catch problems with these things than
I am.)


J.

I’ll do a big more investigation before finalizing a fix, but I suspect
all that needs to change is sprinkling some hasMoreTokens() calls in
Decorator.mergeState(). As currently written, Decorator.mergeState() is
violating the SequenceEncoder.Decoder contract.

Yes, but why?

The actual problem is in the ChangePiece command that is generating the call to mergeState(). The ChangePiece command being executed has come from someone else’s client. What generated it? Impossible to tell unless you have enough information to reproduce this.

Essentially, we are getting a command from someone else’s client to change the state of a particular piece, however, the piece he is changing and our copy of the same piece have a different number of traits.

The best you can do in Decorator.mergeState() is to detect the problem and fail more gracefully.

B.

Nope, nothing to do with trait serialization. This is just me trying to help fix bugs.

Thus spake fil512:

Nope, nothing to do with trait serialization. This is just me trying to
help fix bugs.

For traits in general, Brent will know more than I do.


J.

What do you mean by “someone else’s client”?

Good to hear; sounds like I’m on the right path then…

-K