Potential error in OpenImmo_1_2_7b.java upgrade method
Hello,
when upgrading OpenImmo from 1.2.7 to 1.2.7b in OpenImmo_1_2_7b.java there seems to be a part missing: in 1.2.7 for XML name="flaechen" > name="anzahl_stellplaetze" there is no type specified. And the software i am using is putting a decimal number, which is technically correct. However, in 1.2.7b the field is specified as positive integer.
When trying to load this XML following error occurs for this field: o.o.io.core.XmlValidationHandler : > java.lang.IllegalArgumentException: Can't parse integer value '1.0'! For input string: "1.0"
Obviously the decimal is not converted to BigInteger. The field "anzahlStellplaetze" is null in the resulting object.
Thanks for pointing this out. Can you send me a short example XML to reproduce this problem?
Thanks for the reply. Following case reporduces the problem:
<?xml version="1.0" ?> <openimmo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=""> <uebertragung art="ONLINE" umfang="TEIL" version="1.2.7" sendersoftware="Immomio" senderversion="1.0"></uebertragung> <anbieter> <anbieternr>XXX</anbieternr> <firma>XXX</firma> <openimmo_anid>XXX</openimmo_anid> <immobilie> <objektkategorie> <nutzungsart WOHNEN="true" GEWERBE="false"></nutzungsart> <vermarktungsart KAUF="false" MIETE_PACHT="true"></vermarktungsart> </objektkategorie> <geo> </geo> <kontaktperson> </kontaktperson> <preise> <kaltmiete>600.00</kaltmiete> <nebenkosten>165.00</nebenkosten> <heizkosten_enthalten>false</heizkosten_enthalten> <heizkosten>140.00</heizkosten> <gesamtmietebrutto>905.00</gesamtmietebrutto> <courtage_hinweis>Keine</courtage_hinweis> </preise> <flaechen> <wohnflaeche>65.0</wohnflaeche> <anzahl_zimmer>3.0</anzahl_zimmer> <anzahl_schlafzimmer>1.0</anzahl_schlafzimmer> <anzahl_badezimmer>1.0</anzahl_badezimmer> <anzahl_balkone>1.0</anzahl_balkone> <anzahl_terrassen>0.0</anzahl_terrassen> <anzahl_stellplaetze>1.0</anzahl_stellplaetze> </flaechen> <verwaltung_objekt> <objektadresse_freigeben>true</objektadresse_freigeben> <verfuegbar_ab>01.07.2022</verfuegbar_ab> <wbs_sozialwohnung>false</wbs_sozialwohnung> </verwaltung_objekt> </immobilie> </anbieter> </openimmo>
@Testvoid anzahl_stellplaetze() throws URISyntaxException, JAXBException, IOException, ParserConfigurationException, SAXException { File file = new File(getClass().getClassLoader().getResource("openImmoFiles/anzahl_stellplaetze.xml").toURI()); Immobilie immobilie = OpenImmoImporter.read(file).toObject().getAnbieter().get(0).getImmobilie().get(0); assert(BigInteger.ONE).equals(immobilie.getFlaechen().getAnzahlStellplaetze()); }
Output:
11:19:07.310 [main] WARN org.openestate.io.core.XmlValidationHandler - validation error 11:19:07.310 [main] WARN org.openestate.io.core.XmlValidationHandler - > java.lang.IllegalArgumentException: Can't parse integer value '1.0'! For input string: "1.0" java.lang.AssertionError