{"record":{"id":"2f5e5242654b0600","repo":"microg/GmsCore","slug":"invalid-type","errorCode":null,"errorMessage":"invalid type: ","messagePattern":"invalid type: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"play-services-location/core/system-api/src/main/java/android/location/Geofence.java","lineNumber":87,"sourceCode":"\n    private static void checkRadius(float radius) {\n        if (radius <= 0) {\n            throw new IllegalArgumentException(\"invalid radius: \" + radius);\n        }\n    }\n\n    private static void checkLatLong(double latitude, double longitude) {\n        if (latitude > 90.0 || latitude < -90.0) {\n            throw new IllegalArgumentException(\"invalid latitude: \" + latitude);\n        }\n        if (longitude > 180.0 || longitude < -180.0) {\n            throw new IllegalArgumentException(\"invalid longitude: \" + longitude);\n        }\n    }\n\n    private static void checkType(int type) {\n        if (type != TYPE_HORIZONTAL_CIRCLE) {\n            throw new IllegalArgumentException(\"invalid type: \" + type);\n        }\n    }\n\n    public static final Parcelable.Creator<Geofence> CREATOR = new Parcelable.Creator<Geofence>() {\n        @Override\n        public Geofence createFromParcel(Parcel in) {\n            int type = in.readInt();\n            double latitude = in.readDouble();\n            double longitude = in.readDouble();\n            float radius = in.readFloat();\n            checkType(type);\n            return Geofence.createCircle(latitude, longitude, radius);\n        }\n        @Override\n        public Geofence[] newArray(int size) {\n            return new Geofence[size];\n        }\n    };","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-location/core/system-api/src/main/java/android/location/Geofence.java#L69-L105","documentation":"Guard in Geofence.checkType: the geofence type value is not a recognized constant, so the geofence cannot be interpreted. The offending value is appended; used both at construction and when reading types back via createFromParcel/typeToString.","triggerScenarios":"Thrown at play-services-location/core/system-api/src/main/java/android/location/Geofence.java:87 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use only the recognized geofence type / transition constants (ENTER, EXIT, DWELL)","Validate stored or received type values before building a Geofence"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}