{"record":{"id":"ea2a077af849349c","repo":"MuntashirAkon/AppManager","slug":"invalid-format-componentstatus-not-found","errorCode":null,"errorMessage":"Invalid format: componentStatus not found","messagePattern":"Invalid format: componentStatus not found","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/rules/struct/ComponentRule.java","lineNumber":93,"sourceCode":"    @ComponentStatus\n    private final String mComponentStatus;\n\n    @Nullable\n    @ComponentStatus\n    private String mLastComponentStatus;\n\n    public ComponentRule(@NonNull String packageName, @NonNull String name, RuleType componentType,\n                         @NonNull @ComponentStatus String componentStatus) {\n        super(packageName, name, componentType);\n        mComponentStatus = fixComponentStatus(componentStatus);\n    }\n\n    public ComponentRule(@NonNull String packageName, @NonNull String name, RuleType componentType,\n                         @NonNull StringTokenizer tokenizer) throws IllegalArgumentException {\n        super(packageName, name, componentType);\n        if (tokenizer.hasMoreElements()) {\n            mComponentStatus = fixComponentStatus(tokenizer.nextElement().toString());\n        } else throw new IllegalArgumentException(\"Invalid format: componentStatus not found\");\n    }\n\n    public ComponentName getComponentName() {\n        return new ComponentName(packageName, name);\n    }\n\n    @NonNull\n    @ComponentStatus\n    public String getComponentStatus() {\n        return mComponentStatus;\n    }\n\n    public void setLastComponentStatus(@Nullable String lastComponentStatus) {\n        mLastComponentStatus = lastComponentStatus;\n    }\n\n    public boolean applyDefaultState() {\n        if (mLastComponentStatus == null) {","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/rules/struct/ComponentRule.java#L75-L111","documentation":"ComponentRule parses the component status from the next StringTokenizer token and normalizes it via fixComponentStatus. If the tokenizer has no remaining element, the rule line lacks the componentStatus column and the constructor throws IllegalArgumentException('Invalid format: componentStatus not found').","triggerScenarios":"new ComponentRule(pkg, name, componentType, tokenizer) where the tokenizer is exhausted — an ACTIVITY/SERVICE/RECEIVER/PROVIDER rule line containing only package and component name without a status token.","commonSituations":"Truncated or hand-edited rules TSV backups; importing rules exported from older App Manager versions with different column layouts; lines damaged by copy-paste or encoding issues.","solutions":["Ensure each component rule line includes the status column (e.g. pkg<TAB>name<TAB>block)","Check tokenizer.hasMoreElements() and skip malformed lines before constructing ComponentRule","Regenerate the rules export with the current app version so all rows carry a status","Catch IllegalArgumentException around rule parsing and log/skip bad rows"],"exampleFix":"// before\nComponentRule rule = new ComponentRule(pkg, name, RuleType.ACTIVITY, new StringTokenizer(line, \"\\t\"));\n// after\nStringTokenizer st = new StringTokenizer(line, \"\\t\");\nif (!st.hasMoreElements()) {\n    Log.w(TAG, \"Skipping malformed component line: \" + line);\n    return;\n}\nComponentRule rule = new ComponentRule(pkg, name, RuleType.ACTIVITY, st);","handlingStrategy":"validation","validationCode":"StringTokenizer st = new StringTokenizer(line, \"\\t\");\nif (st.countTokens() < 3) { // package + name + status\n    Log.w(TAG, \"Malformed component line: \" + line);\n    return;\n}","typeGuard":null,"tryCatchPattern":"try {\n    rule = new ComponentRule(pkg, name, componentType, tokenizer);\n} catch (IllegalArgumentException e) {\n    Log.w(TAG, \"Skipping invalid component rule: \" + line, e);\n}","preventionTips":["Ensure each component rule row carries a status column","Skip and log malformed lines during batch import instead of aborting","Regenerate rule exports after app version upgrades"],"tags":["parsing","tsv","rules","format"],"backgroundTag":"invalid-argument-format","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}