{"record":{"id":"82242819997450ad","repo":"pinpoint-apm/pinpoint","slug":"non-positive-tielength-tielength","errorCode":null,"errorMessage":"non-positive tieLength:<tieLength>","messagePattern":"non-positive tieLength:<tieLength>","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"commons-hbase/src/main/java/com/navercorp/pinpoint/common/hbase/LastRowWithTiesResultsExtractor.java","lineNumber":60,"sourceCode":"    private final int tieLength;\n\n    @Nullable\n    private final LastRowHandler<T> rowHandler;\n    private final ToIntFunction<T> resultSizeHandler;\n\n    public LastRowWithTiesResultsExtractor(RowMapper<T> rowMapper,\n                                           int limit,\n                                           int tieOffset,\n                                           int tieLength,\n                                           @Nullable LastRowHandler<T> rowHandler) {\n        this.rowMapper = Objects.requireNonNull(rowMapper, \"RowMapper\");\n        this.limit = limit;\n        if (tieOffset < 0) {\n            throw new IllegalArgumentException(\"negative tieOffset:\" + tieOffset);\n        }\n        this.tieOffset = tieOffset;\n        if (tieLength <= 0) {\n            throw new IllegalArgumentException(\"non-positive tieLength:\" + tieLength);\n        }\n        this.tieLength = tieLength;\n        this.rowHandler = rowHandler;\n        this.resultSizeHandler = resolveResultSizeHandler(rowMapper);\n    }\n\n    private ToIntFunction<T> resolveResultSizeHandler(RowMapper<T> rowMapper) {\n        if (rowMapper instanceof RowTypeHint hint) {\n            Class<?> clazz = hint.rowType();\n            return ResultSizeHandlers.getHandler(clazz);\n        }\n        return new LazyResultSizeHandler<>();\n    }\n\n    @Override\n    public List<T> extractData(ResultScanner results) throws Exception {\n        final List<T> rs = new ArrayList<>();\n        int rowNum = 0;","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/commons-hbase/src/main/java/com/navercorp/pinpoint/common/hbase/LastRowWithTiesResultsExtractor.java#L42-L78","documentation":"Constructor validation in LastRowWithTiesResultsExtractor: tieLength must be strictly positive because it caps how many tie rows are fetched beyond the limit. Zero or negative values make no sense, so the constructor throws IllegalArgumentException immediately.","triggerScenarios":"Calling new LastRowWithTiesResultsExtractor<>(rowMapper, limit, tieOffset, tieLength, rowHandler) with tieLength <= 0, e.g. passing 0 to mean 'no ties' or a computed size that underflowed.","commonSituations":"Misconfigured tie/page-size properties resolving to 0; using -1 as an 'unlimited' sentinel where this class requires a positive count.","solutions":["Pass tieLength >= 1; remove the extractor and use a plain ResultsExtractor if you do not need tie rows","Fix the config/property source that yields a non-positive tieLength","Add Math.max(1, tieLength) only if your caller semantics allow silently coercing to 1"],"exampleFix":"// before\nnew LastRowWithTiesResultsExtractor<>(mapper, limit, 0, 0, handler);\n// after\nnew LastRowWithTiesResultsExtractor<>(mapper, limit, 0, 10, handler);","handlingStrategy":"validation","validationCode":"if (tieLength <= 0) throw new IllegalArgumentException(\"tieLength must be >= 1, got \" + tieLength);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate tie/page-size config properties at load time (> 0)","Don't overload -1/0 as 'no ties'; skip the extractor instead","Default tieLength to a sane positive value when config is absent"],"tags":["hbase","argument-validation","pagination"],"backgroundTag":"invalid-argument-value","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}