Fix all Eclipse warnings in java code, small cleanup

git-svn-id: http://svn.osgeo.org/postgis/trunk@2497 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Markus Schaber 2006-10-02 23:26:34 +00:00
parent 704a6f74fc
commit 1079ae91a0
6 changed files with 11 additions and 39 deletions

View 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

View 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);

View 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

View 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;

View file

@ -8,6 +8,6 @@ public class Aggregates {
public static void test() throws SQLException {
Session a = org.postgresql.pljava.SessionManager.current();
a.hashCode();
}
}

View 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();
return geom.geom.getNumPoints();
}
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();
}
public static int getHash(PLJGeometry p) {
return p.hashCode();
public static String getString(PLJGeometry geom) {
return geom.toString();
}
}