Review fixes

This commit is contained in:
r.kuznetsov 2017-06-13 13:58:37 +03:00
parent bd48ca3ad0
commit 7e512a3d62
3 changed files with 10 additions and 19 deletions

View file

@ -1154,7 +1154,7 @@ Java_com_mapswithme_maps_Framework_nativeGetBestRouter(JNIEnv * env, jclass,
void ExtractRoutePointInfo(JNIEnv * env, jobject routePointInfo,
RouteMarkType & markType, int8_t & intermediateIndex)
{
jclass const clazz = env->GetObjectClass(routePointInfo);
static jclass const clazz = env->GetObjectClass(routePointInfo);
ASSERT(clazz, ());
static jfieldID const markTypeField = env->GetFieldID(clazz, "mMarkType", "I");
ASSERT(markTypeField, ());
@ -1199,7 +1199,7 @@ Java_com_mapswithme_maps_Framework_nativeCouldAddIntermediatePoint(JNIEnv * env,
JNIEXPORT jobjectArray JNICALL
Java_com_mapswithme_maps_Framework_nativeGetRoutePoints(JNIEnv * env, jclass)
{
std::vector<m2::PointD> const points = frm()->GetRoutingManager().GetRoutePoints();
auto const points = frm()->GetRoutingManager().GetRoutePoints();
static jclass const pointClazz = jni::GetGlobalClassRef(env, "com/mapswithme/maps/api/RoutePoint");
// Java signature : RoutePoint(double lat, double lon, String name)

View file

@ -277,6 +277,7 @@ public class Framework
@NonNull RoutePointInfo routePointInfo);
public static native void nativeRemoveRoutePoint(@NonNull RoutePointInfo routePointInfo);
public static native boolean nativeCouldAddIntermediatePoint();
@NonNull
public static native RoutePoint[] nativeGetRoutePoints();
/**

View file

@ -10,18 +10,18 @@ import java.lang.annotation.RetentionPolicy;
public class RoutePointInfo implements Parcelable
{
@Retention(RetentionPolicy.SOURCE)
@IntDef({ROUTE_MARK_START, ROUTE_MARK_INTERMEDIATE, ROUTE_MARK_FINISH})
public @interface RouteMarkType {}
public static final int ROUTE_MARK_START = 0;
public static final int ROUTE_MARK_INTERMEDIATE = 1;
public static final int ROUTE_MARK_FINISH = 2;
@Retention(RetentionPolicy.SOURCE)
@IntDef({ ROUTE_MARK_START, ROUTE_MARK_INTERMEDIATE, ROUTE_MARK_FINISH })
public @interface RouteMarkType {}
@RouteMarkType
private final int mMarkType;
@Nullable
private final int mIntermediateIndex;
public final int mMarkType;
public final int mIntermediateIndex;
public RoutePointInfo(@RouteMarkType int markType, int intermediateIndex)
{
@ -29,16 +29,6 @@ public class RoutePointInfo implements Parcelable
mIntermediateIndex = intermediateIndex;
}
public @RouteMarkType int getMarkType()
{
return mMarkType;
}
public int getIntermediateIndex()
{
return mIntermediateIndex;
}
private RoutePointInfo(Parcel in)
{
//noinspection WrongConstant