[Lada-commits] [PATCH 3 of 3] Fixed or supressed warnings

Wald Commits scm-commit at wald.intevation.org
Fri May 29 13:10:43 CEST 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1432897830 -7200
# Node ID 3118fbbe62924163307ecfa2665a94e67e22a53c
# Parent  98d79aa9d9961d13b7b341a796e12189c6b13035
Fixed or supressed warnings.

diff -r 98d79aa9d996 -r 3118fbbe6292 src/main/java/de/intevation/lada/factory/ProbeFactory.java
--- a/src/main/java/de/intevation/lada/factory/ProbeFactory.java	Fri May 29 13:09:37 2015 +0200
+++ b/src/main/java/de/intevation/lada/factory/ProbeFactory.java	Fri May 29 13:10:30 2015 +0200
@@ -38,6 +38,7 @@
                     Messprogramm.class);
         builder.and("id", id);
         Response response = repository.filter(builder.getQuery(), "land");
+        @SuppressWarnings("unchecked")
         List<Messprogramm> messprogramme =
             (List<Messprogramm>)response.getData();
         if (messprogramme == null || messprogramme.isEmpty()) {
@@ -142,6 +143,7 @@
                     MessprogrammMmt.class);
         builder.and("messprogrammId", messprogramm.getId());
         Response response = repository.filter(builder.getQuery(), "land");
+        @SuppressWarnings("unchecked")
         List<MessprogrammMmt> mmts = (List<MessprogrammMmt>)response.getData();
         for (MessprogrammMmt mmt : mmts) {
             LMessung messung = new LMessung();
@@ -173,6 +175,7 @@
                 repository.entityManager("stamm"), SOrt.class);
             ortBuilder.and("verwaltungseinheitId", messprogramm.getGemId());
             Response ortResponse = repository.filter(ortBuilder.getQuery(), "stamm");
+            @SuppressWarnings("unchecked")
             List<SOrt> orte = (List<SOrt>) ortResponse.getData();
             if (orte != null && !orte.isEmpty()) {
                 ort.setOrt(BigInteger.valueOf(orte.get(0).getId()));
diff -r 98d79aa9d996 -r 3118fbbe6292 src/main/java/de/intevation/lada/importer/laf/LafWriter.java
--- a/src/main/java/de/intevation/lada/importer/laf/LafWriter.java	Fri May 29 13:09:37 2015 +0200
+++ b/src/main/java/de/intevation/lada/importer/laf/LafWriter.java	Fri May 29 13:10:30 2015 +0200
@@ -134,10 +134,6 @@
      * @return success
      */
     public boolean writeOrte(UserInfo userInfo, List<SOrt> orte) {
-        for (SOrt ort :orte) {
-            //TODO create the SOrt!!!
-            //repository.create(ort, "land");
-        }
         return true;
     }
 
diff -r 98d79aa9d996 -r 3118fbbe6292 src/main/java/de/intevation/lada/importer/laf/OrtCreator.java
--- a/src/main/java/de/intevation/lada/importer/laf/OrtCreator.java	Fri May 29 13:09:37 2015 +0200
+++ b/src/main/java/de/intevation/lada/importer/laf/OrtCreator.java	Fri May 29 13:10:30 2015 +0200
@@ -468,6 +468,7 @@
                     repository.entityManager("stamm"),
                     Verwaltungseinheit.class);
             builder.and("id", ort.getVerwaltungseinheitId());
+            @SuppressWarnings("unchecked")
             List<Verwaltungseinheit> einheit =
                 (List<Verwaltungseinheit>)repository.filter(
                     builder.getQuery(),
@@ -499,6 +500,7 @@
                 repository.entityManager("stamm"),
                 Staat.class);
         builder.and("staat", this.landLang);
+        @SuppressWarnings("unchecked")
         List<Staat> staat =
             (List<Staat>)repository.filter(
                 builder.getQuery(),
@@ -530,6 +532,7 @@
                 repository.entityManager("stamm"),
                 Staat.class);
         builder.and("staatKurz", this.landKurz);
+        @SuppressWarnings("unchecked")
         List<Staat> staat =
             (List<Staat>)repository.filter(
                 builder.getQuery(),
@@ -563,6 +566,7 @@
                     repository.entityManager("stamm"),
                     Staat.class);
             builder.and("id", this.landS);
+            @SuppressWarnings("unchecked")
             List<Staat> staat =
                 (List<Staat>)repository.filter(
                     builder.getQuery(),
@@ -594,6 +598,7 @@
                 repository.entityManager("stamm"),
                 Verwaltungseinheit.class);
         builder.and("bezeichnung", this.gemName);
+        @SuppressWarnings("unchecked")
         List<Verwaltungseinheit> einheit=
             (List<Verwaltungseinheit>)repository.filter(
                 builder.getQuery(),
@@ -626,6 +631,7 @@
                     repository.entityManager("stamm"),
                     Verwaltungseinheit.class);
             builder.and("bezeichnung", this.gemName);
+            @SuppressWarnings("unchecked")
             List<Verwaltungseinheit> einheit=
                 (List<Verwaltungseinheit>)repository.filter(
                     builder.getQuery(),
@@ -679,6 +685,7 @@
         }
         ort.setKoordXExtern(x);
         ort.setKoordYExtern(y);
+        ort.setKoordinatenartId(Integer.valueOf(art));
         return ort;
     }
 
@@ -723,6 +730,7 @@
         ort.setLongitude(Double.valueOf(x));
         ort.setKoordYExtern(y);
         ort.setLatitude(Double.valueOf(y));
+        ort.setKoordinatenartId(Integer.valueOf(art));
         return ort;
     }
 
@@ -743,6 +751,7 @@
                     repository.entityManager("stamm"),
                     SOrt.class);
             builder.and("bezeichnung", this.ortCode);
+            @SuppressWarnings("unchecked")
             List<SOrt> orte=
                 (List<SOrt>)repository.filter(
                     builder.getQuery(),
diff -r 98d79aa9d996 -r 3118fbbe6292 src/main/java/de/intevation/lada/rest/MessungService.java
--- a/src/main/java/de/intevation/lada/rest/MessungService.java	Fri May 29 13:09:37 2015 +0200
+++ b/src/main/java/de/intevation/lada/rest/MessungService.java	Fri May 29 13:10:30 2015 +0200
@@ -326,6 +326,7 @@
      *
      * @return Response object.
      */
+    @SuppressWarnings("unchecked")
     @DELETE
     @Path("/{id}")
     @Produces(MediaType.APPLICATION_JSON)
@@ -384,7 +385,6 @@
                 defaultRepo.entityManager("land"), MessungTranslation.class);
         builder.and("messungs", messungObj.getId());
         Response messungTrans = defaultRepo.filter(builder.getQuery(), "land");
-        @SuppressWarnings("unchecked")
         MessungTranslation messungTransObj = ((List<MessungTranslation>)messungTrans.getData()).get(0);
         /* Delete the messung translation object*/
         defaultRepo.delete(messungTransObj, "land");
diff -r 98d79aa9d996 -r 3118fbbe6292 src/main/java/de/intevation/lada/util/data/LadaPostgisDialect.java
--- a/src/main/java/de/intevation/lada/util/data/LadaPostgisDialect.java	Fri May 29 13:09:37 2015 +0200
+++ b/src/main/java/de/intevation/lada/util/data/LadaPostgisDialect.java	Fri May 29 13:10:30 2015 +0200
@@ -5,6 +5,8 @@
 import org.hibernate.spatial.dialect.postgis.PostgisDialect;
 
 public class LadaPostgisDialect extends PostgisDialect {
+    private static final long serialVersionUID = 1L;
+
     public LadaPostgisDialect() {
         super();
         this.registerColumnType(Types.ARRAY, "integer[]");
diff -r 98d79aa9d996 -r 3118fbbe6292 src/main/java/de/intevation/lada/validation/rules/messung/HasPflichtmessgroessen.java
--- a/src/main/java/de/intevation/lada/validation/rules/messung/HasPflichtmessgroessen.java	Fri May 29 13:09:37 2015 +0200
+++ b/src/main/java/de/intevation/lada/validation/rules/messung/HasPflichtmessgroessen.java	Fri May 29 13:10:30 2015 +0200
@@ -32,6 +32,7 @@
                 PflichtMessgroesse.class);
         builder.and("mmtId", messung.getMmtId());
         Response response = repository.filter(builder.getQuery(), "stamm");
+        @SuppressWarnings("unchecked")
         List<PflichtMessgroesse> pflicht =
             (List<PflichtMessgroesse>)response.getData();
 
@@ -41,6 +42,7 @@
         wertBuilder.and("messungsId", messung.getId());
         Response wertResponse =
             repository.filter(wertBuilder.getQuery(), "land");
+        @SuppressWarnings("unchecked")
         List<LMesswert> messwerte = (List<LMesswert>)wertResponse.getData();
         Violation violation = new Violation();
         boolean missing = false;
diff -r 98d79aa9d996 -r 3118fbbe6292 src/main/java/de/intevation/lada/validation/rules/messung/MessgroesseToMessmethode.java
--- a/src/main/java/de/intevation/lada/validation/rules/messung/MessgroesseToMessmethode.java	Fri May 29 13:09:37 2015 +0200
+++ b/src/main/java/de/intevation/lada/validation/rules/messung/MessgroesseToMessmethode.java	Fri May 29 13:10:30 2015 +0200
@@ -38,6 +38,7 @@
                 repository.entityManager("land"), LMesswert.class);
         builder.and("messungsId", messung.getId());
         Response response = repository.filter(builder.getQuery(), "land");
+        @SuppressWarnings("unchecked")
         List<LMesswert> messwerte = (List<LMesswert>)response.getData();
 
         QueryBuilder<MmtMessgroesse> mmtBuilder =
@@ -46,6 +47,7 @@
 
         Response results =
             repository.filter(mmtBuilder.getQuery(), "stamm");
+        @SuppressWarnings("unchecked")
         List<MmtMessgroesse> messgroessen =
             (List<MmtMessgroesse>)results.getData();
         List<MmtMessgroesse> found = new ArrayList<MmtMessgroesse>();
diff -r 98d79aa9d996 -r 3118fbbe6292 src/main/java/de/intevation/lada/validation/rules/ort/CoordinatesInVE.java
--- a/src/main/java/de/intevation/lada/validation/rules/ort/CoordinatesInVE.java	Fri May 29 13:09:37 2015 +0200
+++ b/src/main/java/de/intevation/lada/validation/rules/ort/CoordinatesInVE.java	Fri May 29 13:10:30 2015 +0200
@@ -29,6 +29,7 @@
     @RepositoryConfig(type=RepositoryType.RO)
     private Repository repository;
 
+    @SuppressWarnings("unchecked")
     @Override
     public Violation execute(Object object) {
         LOrt ort = (LOrt)object;
diff -r 98d79aa9d996 -r 3118fbbe6292 src/main/java/de/intevation/lada/validation/rules/probe/Deskriptor.java
--- a/src/main/java/de/intevation/lada/validation/rules/probe/Deskriptor.java	Fri May 29 13:09:37 2015 +0200
+++ b/src/main/java/de/intevation/lada/validation/rules/probe/Deskriptor.java	Fri May 29 13:10:30 2015 +0200
@@ -59,6 +59,7 @@
             builder.and("sn", mediaDesk[i]);
             builder.and("ebene", i - 1);
             Response response = repository.filter(builder.getQuery(), "stamm");
+            @SuppressWarnings("unchecked")
             List<Deskriptoren> data = (List<Deskriptoren>)response.getData();
             if (data.isEmpty()) {
                 Violation violation = new Violation();
diff -r 98d79aa9d996 -r 3118fbbe6292 src/main/java/de/intevation/lada/validation/rules/probe/DeskriptorToUmwelt.java
--- a/src/main/java/de/intevation/lada/validation/rules/probe/DeskriptorToUmwelt.java	Fri May 29 13:09:37 2015 +0200
+++ b/src/main/java/de/intevation/lada/validation/rules/probe/DeskriptorToUmwelt.java	Fri May 29 13:10:30 2015 +0200
@@ -60,6 +60,7 @@
             builder.and("sn", mediaDesk[i]);
             builder.and("ebene", i - 1);
             Response response = repository.filter(builder.getQuery(), "stamm");
+            @SuppressWarnings("unchecked")
             List<Deskriptoren> data = (List<Deskriptoren>)response.getData();
             if (data.isEmpty()) {
                 Violation violation = new Violation();
@@ -85,6 +86,7 @@
             builder.and(field, media.get(i));
         }
         Response response = repository.filter(builder.getQuery(), "stamm");
+        @SuppressWarnings("unchecked")
         List<DeskriptorUmwelt> data = (List<DeskriptorUmwelt>)response.getData();
         if (data.isEmpty() || !data.get(0).getUmwId().equals(probe.getUmwId())) {
             Violation violation = new Violation();


More information about the Lada-commits mailing list