Fix compile warnings (#881)

This commit is contained in:
Emux 2021-10-10 17:42:35 +03:00 committed by GitHub
parent bb03b40075
commit f076544993
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 16 additions and 28 deletions

View File

@ -35,12 +35,12 @@ package org.oscim.gdx;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.opengl.GLES30; import android.opengl.GLES30;
import org.oscim.backend.GL30; import org.oscim.backend.GL30;
/** /**
* See https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGL30.java * See https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGL30.java
*/ */
@SuppressWarnings("deprecation")
@SuppressLint("NewApi") @SuppressLint("NewApi")
public class AndroidGL30 extends AndroidGL implements GL30 { public class AndroidGL30 extends AndroidGL implements GL30 {
@Override @Override

View File

@ -92,6 +92,7 @@ public class MapView extends GLSurfaceView {
this(context, null); this(context, null);
} }
@SuppressWarnings("deprecation")
public MapView(Context context, AttributeSet attributeSet) { public MapView(Context context, AttributeSet attributeSet) {
super(context, attributeSet); super(context, attributeSet);

View File

@ -107,6 +107,9 @@ public final class AndroidGraphics extends CanvasAdapter {
return new AndroidBitmap(bitmap); return new AndroidBitmap(bitmap);
} }
/**
* @deprecated
*/
public static Bitmap drawableToBitmap(Resources res, int resId) { public static Bitmap drawableToBitmap(Resources res, int resId) {
return drawableToBitmap(res.getDrawable(resId)); return drawableToBitmap(res.getDrawable(resId));
} }

View File

@ -35,12 +35,12 @@ package org.oscim.android.gl;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.opengl.GLES30; import android.opengl.GLES30;
import org.oscim.backend.GL30; import org.oscim.backend.GL30;
/** /**
* See https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGL30.java * See https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGL30.java
*/ */
@SuppressWarnings("deprecation")
@SuppressLint("NewApi") @SuppressLint("NewApi")
public class AndroidGL30 extends AndroidGL implements GL30 { public class AndroidGL30 extends AndroidGL implements GL30 {
@Override @Override

View File

@ -24,6 +24,7 @@ import java.nio.*;
/** /**
* See https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglGL30.java * See https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglGL30.java
*/ */
@SuppressWarnings("deprecation")
public class LwjglGL30 extends LwjglGL20 implements org.oscim.backend.GL30 { public class LwjglGL30 extends LwjglGL20 implements org.oscim.backend.GL30 {
@Override @Override
public void readBuffer(int mode) { public void readBuffer(int mode) {

View File

@ -24,6 +24,7 @@ import java.nio.*;
/** /**
* See https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3GL30.java * See https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-lwjgl3/src/com/badlogic/gdx/backends/lwjgl3/Lwjgl3GL30.java
*/ */
@SuppressWarnings("deprecation")
public class Lwjgl3GL30 extends Lwjgl3GL20 implements org.oscim.backend.GL30 { public class Lwjgl3GL30 extends Lwjgl3GL20 implements org.oscim.backend.GL30 {
@Override @Override
public void readBuffer(int mode) { public void readBuffer(int mode) {

View File

@ -15,7 +15,6 @@
package org.oscim.ios.backend; package org.oscim.ios.backend;
import com.badlogic.gdx.backends.iosrobovm.IOSGLES30; import com.badlogic.gdx.backends.iosrobovm.IOSGLES30;
import org.oscim.backend.GL30; import org.oscim.backend.GL30;
import java.nio.Buffer; import java.nio.Buffer;
@ -26,6 +25,7 @@ import java.nio.LongBuffer;
/** /**
* iOS specific implementation of {@link GL30}. * iOS specific implementation of {@link GL30}.
*/ */
@SuppressWarnings("deprecation")
public class IosGL30 extends IosGL implements GL30 { public class IosGL30 extends IosGL implements GL30 {
private static final IOSGLES30 iOSGL = new IOSGLES30(); private static final IOSGLES30 iOSGL = new IOSGLES30();

View File

@ -23,8 +23,7 @@ public class SVGParser extends NSObject {
public SVGParser() { public SVGParser() {
} }
; @SuppressWarnings("deprecation")
protected SVGParser(long handle) { protected SVGParser(long handle) {
super(handle); super(handle);
} }

View File

@ -14,18 +14,7 @@
*/ */
package org.oscim.utils.geom; package org.oscim.utils.geom;
import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.*;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryCollection;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.LineString;
import org.locationtech.jts.geom.LinearRing;
import org.locationtech.jts.geom.MultiLineString;
import org.locationtech.jts.geom.MultiPoint;
import org.locationtech.jts.geom.MultiPolygon;
import org.locationtech.jts.geom.Point;
import org.locationtech.jts.geom.Polygon;
import org.locationtech.jts.geom.PrecisionModel;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.util.ArrayDeque; import java.util.ArrayDeque;
@ -204,7 +193,7 @@ public class GeomBuilder {
*/ */
public GeomBuilder multiPoint() { public GeomBuilder multiPoint() {
if (!cstack.isEmpty()) { if (!cstack.isEmpty()) {
gstack.push(factory.createMultiPoint(cpopAll())); gstack.push(factory.createMultiPointFromCoords(cpopAll()));
} else { } else {
gstack.push(factory.createMultiPoint(gpopAll(Point.class))); gstack.push(factory.createMultiPoint(gpopAll(Point.class)));
} }

View File

@ -22,16 +22,7 @@ import com.wdtinc.mapbox_vector_tile.adapt.jts.MvtReader;
import com.wdtinc.mapbox_vector_tile.adapt.jts.TagKeyValueMapConverter; import com.wdtinc.mapbox_vector_tile.adapt.jts.TagKeyValueMapConverter;
import com.wdtinc.mapbox_vector_tile.adapt.jts.model.JtsLayer; import com.wdtinc.mapbox_vector_tile.adapt.jts.model.JtsLayer;
import com.wdtinc.mapbox_vector_tile.adapt.jts.model.JtsMvt; import com.wdtinc.mapbox_vector_tile.adapt.jts.model.JtsMvt;
import org.locationtech.jts.geom.*;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.LineString;
import org.locationtech.jts.geom.MultiLineString;
import org.locationtech.jts.geom.MultiPoint;
import org.locationtech.jts.geom.MultiPolygon;
import org.locationtech.jts.geom.Point;
import org.locationtech.jts.geom.Polygon;
import org.oscim.core.MapElement; import org.oscim.core.MapElement;
import org.oscim.core.Tag; import org.oscim.core.Tag;
import org.oscim.core.Tile; import org.oscim.core.Tile;
@ -63,6 +54,7 @@ public class TileDecoder implements ITileDecoder {
mMapElement.layer = 5; mMapElement.layer = 5;
} }
@SuppressWarnings("unchecked")
@Override @Override
public boolean decode(Tile tile, ITileDataSink sink, InputStream is) public boolean decode(Tile tile, ITileDataSink sink, InputStream is)
throws IOException { throws IOException {

View File

@ -31,6 +31,7 @@ import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.dom.client.Touch; import com.google.gwt.dom.client.Touch;
import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyCodes;
@SuppressWarnings("deprecation")
public class GwtInput implements Input { public class GwtInput implements Input {
static final int MAX_TOUCHES = 20; static final int MAX_TOUCHES = 20;
boolean justTouched = false; boolean justTouched = false;

View File

@ -395,6 +395,7 @@ public class RTree<T> implements SpatialIndex<T>, Iterable<T> {
/** /**
* See https://github.com/mourner/rbush-knn/blob/master/index.js * See https://github.com/mourner/rbush-knn/blob/master/index.js
*/ */
@SuppressWarnings("unchecked")
@Override @Override
public List<T> searchKNearestNeighbors(Point center, int k, double maxDistance, List<T> results) { public List<T> searchKNearestNeighbors(Point center, int k, double maxDistance, List<T> results) {
if (results == null) if (results == null)