Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential error in OpenImmo_1_2_7b.java upgrade method #17

Open
JayJayBinks opened this issue Sep 13, 2022 · 2 comments
Open

Potential error in OpenImmo_1_2_7b.java upgrade method #17

JayJayBinks opened this issue Sep 13, 2022 · 2 comments

Comments

@JayJayBinks
Copy link

JayJayBinks commented Sep 13, 2022

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.

@pinhead84
Copy link
Contributor

Thanks for pointing this out. Can you send me a short example XML to reproduce this problem?

@JayJayBinks
Copy link
Author

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>

@Test

void 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants