openjump-gis / openjump

OpenJUMP, the Open Source GIS with more than one trick in its kangaroo pocket, takes the leap from svn to git. join the effort!
http://openjump.org
GNU General Public License v2.0
28 stars 14 forks source link

[WARN] 13:03:02.329 Expected 'interior' attribute but found none. #37

Closed edeso closed 2 years ago

edeso commented 2 years ago

hey Mike,

are these warning really necessary?


[WARN] 13:03:02.329 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.331 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.334 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.336 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.339 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.341 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.343 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.345 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.347 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.348 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.350 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="4"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.352 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="4"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.354 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="4"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.356 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="4"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.358 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="4"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.362 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="4"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.365 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.367 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.369 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.371 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.373 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.375 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.377 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.379 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="1"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.381 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="2"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.384 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="2"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.386 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="2"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
[WARN] 13:03:02.388 Expected 'interior' attribute but found none. Tag = line; Attributes = [Attribute: enabled="true"], [Attribute: width="2"] at com.vividsolutions.jump.util.java2xml.XML2Java$1.attributeSpecFound(XML2Java.java:147)
mukoki commented 2 years ago

Hi Ede,Not very interesting, I give you that. I think it should be solved by an improvement of XML2java rather than just eliminating the warning though.There is a ticket for that :#518 Java2xml framework : no default default valueThere maybe another way. I think warnings are systematically emitted because there are some predefined symbology stored somewhere in the code and not using the new 'interior' tag. It should be possible to upgrade these predefined symbols so that they do not emit warnings anymore. Michaël

edeso commented 2 years ago

@mukoki can you be a bit more specific?

  1. why exactly is this warning printed anyway, if the attribute seems not to be needed anyway?
  2. what are the mentioned hacks "to assure backward compatibility" in https://sourceforge.net/p/jump-pilot/bugs/518/
mukoki commented 2 years ago

Ede, Currently, the XML2Java framework does not accept "optional" attributes. If an attribute is defined in the java2xml config file, it must be there or it throws an exception. To avoid the exception in the case of "interior" attribute (and some others), there are hacks in the code which hide exceptions for these specific attributes. It works and it makes these attributes optional, but the solution is not clean (not extendable) and my idea was to introduce the capability of having optional attributes (or elements ?) in the config files (java2xml). Anyway, we can keep or remove the message. I don't pretend it is interesting for the user. It is just a reminder that there is something to improve in the java2xml framework to fully accept this kind of attribute and maintain backward compatibility.

Michaël    

edeso commented 2 years ago

Mike,

quickly debugged into it and the Warning seems to come from reading AbstractPalettePanel.xml creating a BasicStyleList, but can't figure out how the values are mapped to java members, as the names seem not to be reflected in BasicStyle. can you give me a lil more background?

..ede

mukoki commented 2 years ago

Hi Ede,AbstractPalettePanel.xml defines a list of BasicStyle.The mapping of this list to a java object is defined in AbstractPalettePanel$BasicStyleList.java2xmlThe corresponding java object is an internal class of AbstractPalettePanel.The value of each BasicStyle attribute is converted to a java member by BasicStyle.java2xmlNot sure I answer your question though. Let me know.I realize that there are many other attributes missing from BasicStyle definitions in AbstractPalettePanel.xml not only interior. I don't remember why I added a special escape for interior and why it does not make problem for other attributes like width, enabled or pattern.

edeso commented 2 years ago

@mukoki needs to be thoroughly debugged it seems. i'm pretty sure we can decorate members or add some other way to a class to mark voluntary attributes.