mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-24 09:02:37 +00:00
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:
parent
704a6f74fc
commit
1079ae91a0
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
@ -8,6 +8,6 @@ public class Aggregates {
|
|||
public static void test() throws SQLException {
|
||||
Session a = org.postgresql.pljava.SessionManager.current();
|
||||
|
||||
|
||||
a.hashCode();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue