changeset 685:3118fbbe6292

Fixed or supressed warnings.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 29 May 2015 13:10:30 +0200
parents 98d79aa9d996
children 6dd008066756
files src/main/java/de/intevation/lada/factory/ProbeFactory.java src/main/java/de/intevation/lada/importer/laf/LafWriter.java src/main/java/de/intevation/lada/importer/laf/OrtCreator.java src/main/java/de/intevation/lada/rest/MessungService.java src/main/java/de/intevation/lada/util/data/LadaPostgisDialect.java src/main/java/de/intevation/lada/validation/rules/messung/HasPflichtmessgroessen.java src/main/java/de/intevation/lada/validation/rules/messung/MessgroesseToMessmethode.java src/main/java/de/intevation/lada/validation/rules/ort/CoordinatesInVE.java src/main/java/de/intevation/lada/validation/rules/probe/Deskriptor.java src/main/java/de/intevation/lada/validation/rules/probe/DeskriptorToUmwelt.java
diffstat 10 files changed, 23 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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()));
--- 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;
     }
 
--- 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(),
--- 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");
--- 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[]");
--- 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;
--- 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>();
--- 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;
--- 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();
--- 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();
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)