Skip to content

feat: Add @SuppressWarnings annotations to various ML Kit classes #777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import io.flutter.plugin.common.MethodChannel;

@SuppressWarnings({"unchecked", "rawtypes"})
public class InputImageConverter {

//Returns an [InputImage] from the image data received
Expand Down Expand Up @@ -99,7 +100,6 @@ public static InputImage getInputImageFromData(Map<String, Object> imageData,
} else {
if (model != null && model.equals("bytes")) {
try {
@SuppressWarnings("unchecked")
Map<String, Object> metaData = (Map<String, Object>) imageData.get("metadata");

assert metaData != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;

@SuppressWarnings({"unchecked", "rawtypes"})
public class DigitalInkRecognizer implements MethodChannel.MethodCallHandler {
private static final String START = "vision#startDigitalInkRecognizer";
private static final String CLOSE = "vision#closeDigitalInkRecognizer";
Expand Down Expand Up @@ -99,7 +100,6 @@ private void handleDetection(MethodCall call, final MethodChannel.Result result)
} else {
builder.setPreContext("");
}

Map<String, Object> writingAreaMap = (Map<String, Object>) contextMap.get("writingArea");
if (writingAreaMap != null) {
float width = (float) (double) writingAreaMap.get("width");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;

@SuppressWarnings({"unchecked", "rawtypes"})
public class EntityExtractor implements MethodChannel.MethodCallHandler {
private static final String START = "nlp#startEntityExtractor";
private static final String CLOSE = "nlp#closeEntityExtractor";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
@SuppressWarnings({"unchecked", "rawtypes"})

class FaceDetector implements MethodChannel.MethodCallHandler {
private static final String START = "vision#startFaceDetector";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;

@SuppressWarnings({"unchecked", "rawtypes"})
class FaceMeshDetector implements MethodChannel.MethodCallHandler {
private static final String START = "vision#startFaceMeshDetector";
private static final String CLOSE = "vision#closeFaceMeshDetector";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;

@SuppressWarnings({"unchecked", "rawtypes"})
public class ObjectDetector implements MethodChannel.MethodCallHandler {
private static final String START = "vision#startObjectDetector";
private static final String CLOSE = "vision#closeObjectDetector";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;

@SuppressWarnings({"unchecked", "rawtypes"})
public class PoseDetector implements MethodChannel.MethodCallHandler {
private static final String START = "vision#startPoseDetector";
private static final String CLOSE = "vision#closePoseDetector";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;

@SuppressWarnings({"unchecked", "rawtypes"})
public class SelfieSegmenter implements MethodChannel.MethodCallHandler {
private static final String START = "vision#startSelfieSegmenter";
private static final String CLOSE = "vision#closeSelfieSegmenter";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import com.google.mlkit.vision.segmentation.subject.SubjectSegmenterOptions;
import com.google_mlkit_commons.InputImageConverter;

@SuppressWarnings({"unchecked", "rawtypes"})
public class SubjectSegmenter implements MethodChannel.MethodCallHandler {
private static final String START = "vision#startSubjectSegmenter";
private static final String CLOSE = "vision#closeSubjectSegmenter";
Expand Down