Problem with Embellishment

Vassal 3.1.5.

If there is a problem with Layer where it can’t read property, then it will try to report a problem, unfortunately BadDataReport wants to use piece name which depends on the Layer again, which tries to read property value again and this goes until a stack overflow happens:

... at VASSAL.counters.Decorator.getLocalizedName(Decorator.java:323) at VASSAL.build.BadDataReport.<init>(BadDataReport.java:68) at VASSAL.counters.Decorator.reportDataError(Decorator.java:365) at VASSAL.counters.Embellishment.checkPropertyLevel(Embellishment.java:419) at VASSAL.counters.Embellishment.getName(Embellishment.java:284) at VASSAL.counters.Embellishment.getLocalizedName(Embellishment.java:276) at VASSAL.counters.Decorator.getLocalizedName(Decorator.java:323) at VASSAL.build.BadDataReport.<init>(BadDataReport.java:68) at VASSAL.counters.Decorator.reportDataError(Decorator.java:365) at VASSAL.counters.Embellishment.checkPropertyLevel(Embellishment.java:419) at VASSAL.counters.Embellishment.getName(Embellishment.java:284) at VASSAL.counters.Embellishment.getLocalizedName(Embellishment.java:276) at VASSAL.counters.Decorator.getLocalizedName(Decorator.java:323) at VASSAL.build.BadDataReport.<init>(BadDataReport.java:68) at VASSAL.counters.Decorator.reportDataError(Decorator.java:365) at VASSAL.counters.Embellishment.checkPropertyLevel(Embellishment.java:419) at VASSAL.counters.Embellishment.getName(Embellishment.java:284) at VASSAL.counters.Embellishment.getLocalizedName(Embellishment.java:276) at VASSAL.counters.Decorator.getLocalizedName(Decorator.java:323) ...

This is especially a big problem when in module editor - it can’t read properties derived from prototypes, therefore a lot of pieces is now not accessible, but they do work in the game.

Also, I think this code in VASSAL.counters.Embellishment.checkPropertyLevel is a bit limiting:

final String val = (String) Decorator.getOutermost(this).getProperty(propertyName);

I can’t return other types from my custom properties if I want Embellishment to work. I suggest using:

final String val = String.valueOf(Decorator.getOutermost(this).getProperty(propertyName));
…since getProperty is returning Object, why to assume it will be always a String?

This is a known problem that has been fixed for 3.1.6, as reported in this forum several times in the last week.

Hmmm, reasonable suggestion, your Objects toString() must still return something that parses as an integer.

Joel…Fix committed to swampwallaby-3.1@5672.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Yeah, they returned int (propably boxed to Integer) so it was quite funny/annoying that Embellishment was unable to parse that…

Thus spake “Brent Easton”:

Merged to 3.1@5674, trunk@5675.

I’m uploading a new candidate for 3.1.6 now. (Nobody replied about the
previous one I uploaded.)


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)