{"record":{"id":"d57909b9c4434339","repo":"antlr/antlr4","slug":"set","errorCode":null,"errorMessage":"set","messagePattern":"set","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"runtime/CSharp/src/Sharpen/BitSet.cs","lineNumber":215,"sourceCode":"            {\n                int bit = BitScanForward(current);\n                if (bit >= 0)\n                    return bit + i * BitsPerElement;\n\n                i++;\n                if (i >= _data.Length)\n                    break;\n\n                current = _data[i];\n            }\n\n            return -1;\n        }\n\n        public void And(BitSet set)\n        {\n            if (set == null)\n                throw new ArgumentNullException(\"set\");\n\n            int length = Math.Min(_data.Length, set._data.Length);\n            for (int i = 0; i < length; i++)\n                _data[i] &= set._data[i];\n\n            for (int i = length; i < _data.Length; i++)\n                _data[i] = 0;\n        }\n\n        public void Or(BitSet set)\n        {\n            if (set == null)\n                throw new ArgumentNullException(\"set\");\n\n            if (set._data.Length > _data.Length)\n                Array.Resize(ref _data, set._data.Length);\n\n            for (int i = 0; i < set._data.Length; i++)","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/antlr/antlr4/blob/7d5770395bb7b02eb56e7c62662cb1d7c08f42a3/runtime/CSharp/src/Sharpen/BitSet.cs#L197-L233","documentation":"Error \"set\" thrown in antlr/antlr4.","triggerScenarios":"BitSet set operation (Or/And/Xor/AndNot) called with a null set argument.","commonSituations":"Guard against null BitSet operands in set algebra calls.","solutions":["Pass a non-null BitSet to the set operation (And/Or/Xor/AndNot).","Null-check the other set before combining."],"exampleFix":"if (other != null) bits.Or(other);","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d5770395bb7b02eb56e7c62662cb1d7c08f42a3","analyzedAt":"2026-08-14T14:47:56.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}