Changeset 36203 in osm for applications
- Timestamp:
- 2024-01-14T20:52:54+01:00 (12 months ago)
- Location:
- applications/editors/josm/plugins/pointInfo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pointInfo/build.xml
r36170 r36203 3 3 4 4 <!-- enter the SVN commit message --> 5 <property name="commit.message" value="PointInfo: Fix NPE issue"/> 5 <property name="commit.message" value="PointInfo: Fix yet another NPE issue with empty strings"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 7 <property name="plugin.main.version" value="18723"/> -
applications/editors/josm/plugins/pointInfo/src/org/openstreetmap/josm/plugins/pointinfo/ruian/RuianRecord.java
r36122 r36203 216 216 217 217 try { 218 mObjektRuianId = Long.parseLong(stavebniObjekt.getString("ruian_id", null));218 mObjektRuianId = Long.parseLong(stavebniObjekt.getString("ruian_id", "")); 219 219 } catch (NumberFormatException e) { 220 220 Logging.log(Level.WARNING, "stavebni_objekt.ruian_id:", e); … … 222 222 223 223 try { 224 mObjektPodlazi = Integer.parseInt(stavebniObjekt.getString("pocet_podlazi", null));224 mObjektPodlazi = Integer.parseInt(stavebniObjekt.getString("pocet_podlazi", "")); 225 225 } catch (NumberFormatException e) { 226 226 Logging.log(Level.WARNING, "stavebni_objekt.pocet_podlazi:", e); … … 228 228 229 229 try { 230 mObjektByty = Integer.parseInt(stavebniObjekt.getString("pocet_bytu", null));230 mObjektByty = Integer.parseInt(stavebniObjekt.getString("pocet_bytu", "")); 231 231 } catch (NumberFormatException e) { 232 232 Logging.log(Level.WARNING, "stavebni_objekt.pocet_bytu:", e); 233 233 } 234 234 235 mObjektZpusobVyuziti = stavebniObjekt.getString("zpusob_vyuziti", null);236 237 mObjektZpusobVyuzitiKod = stavebniObjekt.getString("zpusob_vyuziti_kod", null);238 239 mObjektZpusobVyuzitiKey = stavebniObjekt.getString("zpusob_vyuziti_key", null);240 241 mObjektZpusobVyuzitiVal = stavebniObjekt.getString("zpusob_vyuziti_val", null);242 243 mObjektPlatiOd = stavebniObjekt.getString("plati_od", null);244 245 mObjektDokonceni = stavebniObjekt.getString("dokonceni", null);235 mObjektZpusobVyuziti = stavebniObjekt.getString("zpusob_vyuziti", ""); 236 237 mObjektZpusobVyuzitiKod = stavebniObjekt.getString("zpusob_vyuziti_kod", ""); 238 239 mObjektZpusobVyuzitiKey = stavebniObjekt.getString("zpusob_vyuziti_key", ""); 240 241 mObjektZpusobVyuzitiVal = stavebniObjekt.getString("zpusob_vyuziti_val", ""); 242 243 mObjektPlatiOd = stavebniObjekt.getString("plati_od", ""); 244 245 mObjektDokonceni = stavebniObjekt.getString("dokonceni", ""); 246 246 247 247 } catch (IllegalArgumentException e) { … … 254 254 JsonObject errObjekt = getSafeJsonObject(obj, "nahlaseny_problem"); 255 255 256 mErrUser = errObjekt.getString("uzivatel", null);257 258 mErrDate = errObjekt.getString("datum", null);259 260 mErrType = errObjekt.getString("duvod", null);261 262 mErrNote = errObjekt.getString("poznamka", null);256 mErrUser = errObjekt.getString("uzivatel", ""); 257 258 mErrDate = errObjekt.getString("datum", ""); 259 260 mErrType = errObjekt.getString("duvod", ""); 261 262 mErrNote = errObjekt.getString("poznamka", ""); 263 263 264 264 } catch (IllegalArgumentException e) { … … 276 276 277 277 try { 278 so.setRuianID(Long.parseLong(soBezGeom.getString("ruian_id", null)));278 so.setRuianID(Long.parseLong(soBezGeom.getString("ruian_id", ""))); 279 279 } catch (NumberFormatException e) { 280 280 Logging.log(Level.WARNING, "so_bez_geometrie.ruian_id:", e); … … 282 282 283 283 try { 284 so.setPodlazi(Integer.parseInt(soBezGeom.getString("pocet_podlazi", null)));284 so.setPodlazi(Integer.parseInt(soBezGeom.getString("pocet_podlazi", ""))); 285 285 } catch (NumberFormatException e) { 286 286 Logging.log(Level.WARNING, "so_bez_geometrie.pocet_podlazi:", e); … … 288 288 289 289 try { 290 so.setByty(Integer.parseInt(soBezGeom.getString("pocet_bytu", null)));290 so.setByty(Integer.parseInt(soBezGeom.getString("pocet_bytu", ""))); 291 291 } catch (NumberFormatException e) { 292 292 Logging.log(Level.WARNING, "so_bez_geometrie.pocet_bytu:", e); 293 293 } 294 294 295 so.setZpusobVyuziti(soBezGeom.getString("zpusob_vyuziti", null));296 297 so.setZpusobVyuzitiKod(soBezGeom.getString("zpusob_vyuziti_kod", null));298 299 so.setZpusobVyuzitiKey(soBezGeom.getString("zpusob_vyuziti_key", null));300 301 so.setZpusobVyuzitiVal(soBezGeom.getString("zpusob_vyuziti_val", null));302 303 so.setDokonceni(soBezGeom.getString("dokonceni", null));304 305 so.setPlatiOd(soBezGeom.getString("plati_od", null));306 307 try { 308 so.setVzdalenost(Float.parseFloat(soBezGeom.getString("vzdalenost", null)));295 so.setZpusobVyuziti(soBezGeom.getString("zpusob_vyuziti", "")); 296 297 so.setZpusobVyuzitiKod(soBezGeom.getString("zpusob_vyuziti_kod", "")); 298 299 so.setZpusobVyuzitiKey(soBezGeom.getString("zpusob_vyuziti_key", "")); 300 301 so.setZpusobVyuzitiVal(soBezGeom.getString("zpusob_vyuziti_val", "")); 302 303 so.setDokonceni(soBezGeom.getString("dokonceni", "")); 304 305 so.setPlatiOd(soBezGeom.getString("plati_od", "")); 306 307 try { 308 so.setVzdalenost(Float.parseFloat(soBezGeom.getString("vzdalenost", ""))); 309 309 } catch (NumberFormatException e) { 310 310 Logging.warn("so_bez_geometrie.vzdalenost: {0}", e); … … 327 327 328 328 try { 329 am.setRuianID(Long.parseLong(adresniMisto.getString("ruian_id", null)));329 am.setRuianID(Long.parseLong(adresniMisto.getString("ruian_id", ""))); 330 330 } catch (NumberFormatException e) { 331 331 Logging.log(Level.WARNING, "adresni_mista.ruian_id:", e); … … 345 345 346 346 try { 347 am.setBudovaID(Long.parseLong(adresniMisto.getString("budova_kod", null)));347 am.setBudovaID(Long.parseLong(adresniMisto.getString("budova_kod", ""))); 348 348 } catch (NumberFormatException e) { 349 349 Logging.log(Level.WARNING, "adresni_mista.budova_kod:", e); 350 350 } 351 351 352 am.setCisloTyp(adresniMisto.getString("cislo_typ", null));353 354 am.setCisloDomovni(adresniMisto.getString("cislo_domovni", null));355 356 am.setCisloOrientacni(adresniMisto.getString("cislo_orientacni", null));357 358 try { 359 am.setUliceID(Long.parseLong(adresniMisto.getString("ulice_kod", null)));352 am.setCisloTyp(adresniMisto.getString("cislo_typ", "")); 353 354 am.setCisloDomovni(adresniMisto.getString("cislo_domovni", "")); 355 356 am.setCisloOrientacni(adresniMisto.getString("cislo_orientacni", "")); 357 358 try { 359 am.setUliceID(Long.parseLong(adresniMisto.getString("ulice_kod", ""))); 360 360 } catch (NumberFormatException e) { 361 361 Logging.log(Level.WARNING, "adresni_mista.ulice_kod:", e); 362 362 } 363 363 364 am.setUlice(adresniMisto.getString("ulice", null));365 366 try { 367 am.setCastObceID(Long.parseLong(adresniMisto.getString("cast_obce_kod", null)));364 am.setUlice(adresniMisto.getString("ulice", "")); 365 366 try { 367 am.setCastObceID(Long.parseLong(adresniMisto.getString("cast_obce_kod", ""))); 368 368 } catch (NumberFormatException e) { 369 369 Logging.log(Level.WARNING, "adresni_mista.cast_obce_kod:", e); 370 370 } 371 371 372 am.setCastObce(adresniMisto.getString("cast_obce", null));373 374 try { 375 am.setMestskaCastID(Long.parseLong(adresniMisto.getString("mestska_cast_kod", null)));372 am.setCastObce(adresniMisto.getString("cast_obce", "")); 373 374 try { 375 am.setMestskaCastID(Long.parseLong(adresniMisto.getString("mestska_cast_kod", ""))); 376 376 } catch (NumberFormatException e) { 377 377 Logging.log(Level.WARNING, "adresni_mista.mestska_cast_kod:", e); 378 378 } 379 379 380 am.setMestskaCast(adresniMisto.getString("mestska_cast", null));381 382 try { 383 am.setObecID(Long.parseLong(adresniMisto.getString("obec_kod", null)));380 am.setMestskaCast(adresniMisto.getString("mestska_cast", "")); 381 382 try { 383 am.setObecID(Long.parseLong(adresniMisto.getString("obec_kod", ""))); 384 384 } catch (NumberFormatException e) { 385 385 Logging.log(Level.WARNING, "adresni_mista.obec_kod:", e); 386 386 } 387 387 388 am.setObec(adresniMisto.getString("obec", null));389 390 try { 391 am.setOkresID(Long.parseLong(adresniMisto.getString("okres_kod", null)));388 am.setObec(adresniMisto.getString("obec", "")); 389 390 try { 391 am.setOkresID(Long.parseLong(adresniMisto.getString("okres_kod", ""))); 392 392 } catch (NumberFormatException e) { 393 393 Logging.log(Level.WARNING, "adresni_mista.okres_kod:", e); 394 394 } 395 395 396 am.setOkres(adresniMisto.getString("okres", null));397 398 try { 399 am.setKrajID(Long.parseLong(adresniMisto.getString("kraj_kod", null)));396 am.setOkres(adresniMisto.getString("okres", "")); 397 398 try { 399 am.setKrajID(Long.parseLong(adresniMisto.getString("kraj_kod", ""))); 400 400 } catch (NumberFormatException e) { 401 401 Logging.log(Level.WARNING, "adresni_mista.kraj_kod:", e); 402 402 } 403 403 404 am.setKraj(adresniMisto.getString("kraj", null));405 406 am.setPsc(adresniMisto.getString("psc", null));407 408 try { 409 am.setVzdalenost(Float.parseFloat(adresniMisto.getString("vzdalenost", null)));404 am.setKraj(adresniMisto.getString("kraj", "")); 405 406 am.setPsc(adresniMisto.getString("psc", "")); 407 408 try { 409 am.setVzdalenost(Float.parseFloat(adresniMisto.getString("vzdalenost", ""))); 410 410 } catch (NumberFormatException e) { 411 411 Logging.log(Level.WARNING, "adresni_mista.vzdalenost:", e); … … 424 424 425 425 try { 426 mParcelaRuianId = Long.parseLong(parcela.getString("ruian_id", null));426 mParcelaRuianId = Long.parseLong(parcela.getString("ruian_id", "")); 427 427 } catch (NumberFormatException e) { 428 428 Logging.log(Level.WARNING, "parcela.ruian_id:", e); 429 429 } 430 430 431 mParcelaDruhPozemku = parcela.getString("druh_pozemku", null);432 433 mParcelaZpusobVyuziti = parcela.getString("zpusob_vyuziti", null);434 435 mParcelaPlatiOd = parcela.getString("plati_od", null);431 mParcelaDruhPozemku = parcela.getString("druh_pozemku", ""); 432 433 mParcelaZpusobVyuziti = parcela.getString("zpusob_vyuziti", ""); 434 435 mParcelaPlatiOd = parcela.getString("plati_od", ""); 436 436 } catch (InvalidArgumentException e) { 437 437 Logging.log(Level.WARNING, "parcela:", e); … … 444 444 445 445 try { 446 mUliceRuianId = Long.parseLong(ulice.getString("ruian_id", null));446 mUliceRuianId = Long.parseLong(ulice.getString("ruian_id", "")); 447 447 } catch (NumberFormatException e) { 448 448 Logging.log(Level.WARNING, "ulice.ruian_id:", e); 449 449 } 450 450 451 mUliceJmeno = ulice.getString("jmeno", null);451 mUliceJmeno = ulice.getString("jmeno", ""); 452 452 453 453 } catch (IllegalArgumentException e) { … … 461 461 462 462 try { 463 mKatastrRuianId = Long.parseLong(katastr.getString("ruian_id", null));463 mKatastrRuianId = Long.parseLong(katastr.getString("ruian_id", "")); 464 464 } catch (NumberFormatException e) { 465 465 Logging.log(Level.WARNING, "katastr.ruian_id:", e); 466 466 } 467 467 468 mKatastrNazev = katastr.getString("nazev", null);469 470 try { 471 mKatastrObecKod = Long.parseLong(katastr.getString("obec_kod", null));468 mKatastrNazev = katastr.getString("nazev", ""); 469 470 try { 471 mKatastrObecKod = Long.parseLong(katastr.getString("obec_kod", "")); 472 472 } catch (NumberFormatException e) { 473 473 Logging.log(Level.WARNING, "katastr.obec_kod:", e); 474 474 } 475 475 476 mKatastrObec = katastr.getString("obec", null);477 478 try { 479 mKatastrOkresKod = Long.parseLong(katastr.getString("okres_kod", null));476 mKatastrObec = katastr.getString("obec", ""); 477 478 try { 479 mKatastrOkresKod = Long.parseLong(katastr.getString("okres_kod", "")); 480 480 } catch (NumberFormatException e) { 481 481 Logging.log(Level.WARNING, "katastr.okres_kod:", e); 482 482 } 483 483 484 mKatastrOkres = katastr.getString("okres", null);485 486 try { 487 mKatastrKrajKod = Long.parseLong(katastr.getString("kraj_kod", null));484 mKatastrOkres = katastr.getString("okres", ""); 485 486 try { 487 mKatastrKrajKod = Long.parseLong(katastr.getString("kraj_kod", "")); 488 488 } catch (NumberFormatException e) { 489 489 Logging.log(Level.WARNING, "katastr.kraj_kod:", e); 490 490 } 491 491 492 mKatastrKraj = katastr.getString("kraj", null);492 mKatastrKraj = katastr.getString("kraj", ""); 493 493 494 494 } catch (IllegalArgumentException e) {
Note:
See TracChangeset
for help on using the changeset viewer.