]> granicus.if.org Git - postgis/commitdiff
Fix all Eclipse warnings in java code, small cleanup
authorMarkus Schaber <markus@schabi.de>
Mon, 2 Oct 2006 23:26:34 +0000 (23:26 +0000)
committerMarkus Schaber <markus@schabi.de>
Mon, 2 Oct 2006 23:26:34 +0000 (23:26 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2497 b70326c6-7e19-0410-871a-916f4a2858ee

java/jdbc/jtssrc/org/postgis/jts/JtsBinaryWriter.java
java/jdbc/src/examples/TestAutoregister.java
java/jdbc/src/org/postgis/binary/BinaryWriter.java
java/pljava/functions.sql
java/pljava/src/org/postgis/pljava/Aggregates.java
java/pljava/src/org/postgis/pljava/HelloWorld.java

index 3157e0da2937352733f1e6ce31be9a0a36c78f5b..6fb82fb7dbaf45b5354e6323b4d70198468b6f7d 100644 (file)
@@ -191,9 +191,6 @@ public class JtsBinaryWriter {
     /**
      * Write a Coordinatesequence, part of LinearRing and Linestring, but not
      * MultiPoint!
-     * 
-     * @param haveZ
-     * @param haveM
      */
     private void writeCoordinates(CoordinateSequence seq, int dims, ValueSetter dest) {
         for (int i = 0; i < seq.size(); i++) {
@@ -306,9 +303,6 @@ public class JtsBinaryWriter {
     /**
      * Estimate an Array of "slim" Points (without endianness and type, part of
      * LinearRing and Linestring, but not MultiPoint!
-     * 
-     * @param haveZ
-     * @param haveM
      */
     private int estimatePointArray(int length, Point example) {
         // number of points
index f92a9fc19fe63f86f779f5ed61727c8b30dc04d8..9f378e1c081435526a00259f42a0382b5b8082b2 100644 (file)
@@ -88,6 +88,8 @@ public class TestAutoregister {
             System.err.println("Connection initialization failed, aborting.");
             e.printStackTrace();
             System.exit(1);
+            // signal the compiler that code flow ends here:
+            throw new AssertionError();
         }
 
         int postgisServerMajor = 0;
@@ -96,8 +98,9 @@ public class TestAutoregister {
         } catch (SQLException e) {
             System.err.println("Error fetching PostGIS version: " + e.getMessage());
             System.err.println("Is PostGIS really installed in the database?");
-            // Signal the compiler that code flow ends here.
-            System.exit(1);
+             System.exit(1);
+            // signal the compiler that code flow ends here:
+            throw new AssertionError();
         }
 
         System.out.println("PostGIS Version: " + postgisServerMajor);
index 60a2aac866593ae72fc9b2c4293db75d2a100c56..cf136b6bed31bd21d07bfbf36209fe3d0eda1906 100644 (file)
@@ -190,9 +190,6 @@ public class BinaryWriter {
     /**
      * Write an Array of "slim" Points (without endianness, srid and type, part
      * of LinearRing and Linestring, but not MultiPoint!
-     * 
-     * @param haveZ
-     * @param haveM
      */
     private void writePointArray(Point[] geom, ValueSetter dest) {
         // number of points
@@ -304,9 +301,6 @@ public class BinaryWriter {
     /**
      * Write an Array of "slim" Points (without endianness and type, part of
      * LinearRing and Linestring, but not MultiPoint!
-     * 
-     * @param haveZ
-     * @param haveM
      */
     private int estimatePointArray(Point[] geom) {
         // number of points
index dbfd9ed2bca3a2903285dc8e237d0a8d0842c52e..9fe6f1fd020606b54ae1bc902d26c7632544b740 100644 (file)
@@ -14,13 +14,8 @@ CREATE OR REPLACE FUNCTION public.getSize(geometry)
     'org.postgis.pljava.HelloWorld.getSize'
   LANGUAGE 'java' IMMUTABLE STRICT;  
 
-CREATE OR REPLACE FUNCTION public.getHex(geometry)
+CREATE OR REPLACE FUNCTION public.getString(geometry)
   RETURNS "text" AS
-    'org.postgis.pljava.HelloWorld.getHex'
-  LANGUAGE 'java' IMMUTABLE STRICT;  
-
-  CREATE OR REPLACE FUNCTION public.getPoint()
-  RETURNS "geometry" AS
-    'org.postgis.pljava.HelloWorld.getPoint'
+    'org.postgis.pljava.HelloWorld.getString'
   LANGUAGE 'java' IMMUTABLE STRICT;  
   
\ No newline at end of file
index 756719a3a57fdf4866e4636e5fac805b6814904b..644ba90191fb00416d2d504f55dbf179b4a7fade 100644 (file)
@@ -8,6 +8,6 @@ public class Aggregates {
     public static void test() throws SQLException {
         Session a = org.postgresql.pljava.SessionManager.current();
         
-        
+        a.hashCode();
     }
 }
index 0f78ddfb6de22fd64a131e1a3baab074e5f4ef45..77a37b033577e6486ea831f169e43880855c9024 100644 (file)
@@ -1,29 +1,15 @@
 package org.postgis.pljava;
 
-import org.postgresql.pljava.example.Point;
-
 public class HelloWorld {
     public static String helloWorld() {
         return "Hello Postgis-World";
     }
     
     public static int getSize(PLJGeometry geom) {
-        return geom.rep.length();
-    }
-    
-    public static String getHex(PLJGeometry geom) {
-        return geom.rep.toString();
-    }
-
-    public static PLJGeometry getPoint() {
-        return new PLJGeometry();
-    }
-    
-    public static int getHash(Point p) {
-        return p.hashCode();
+        return geom.geom.getNumPoints();
     }
     
-    public static int getHash(PLJGeometry p) {
-        return p.hashCode();
+    public static String getString(PLJGeometry geom) {
+        return geom.toString();
     }
 }