Skip to content

Conversation

@openrefactory
Copy link

OpenRefactory introduces fixers, that automatically fix safety, security, reliability and compliance issues. We ran OpenRefactory's Intelligent Code Repair (iCR) analysis engine on your code. We are reporting a few sample fixes that were generated.
The goal of the this fix is to resolve Zero Division Check, Unexpected Control Flow and Weak Library Usage problem.

Zero Division Check Fixes:

In file: Duration.java, class: Duration, method: append , there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.

In file: CommitLog.java, class: CommitLog, method: getActiveSegmentCompressionRatios , there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.

In file: SizeTieredCompactionStrategy.java, class: SizeTieredCompactionStrategy, method: getEstimatedCompactionsByTasks , there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.

In file: Upgrader.java, class: Upgrader, method: Upgrader, there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.

In file: MajorLeveledCompactionWriter.java, class: MajorLeveledCompactionWriter, method: MajorLeveledCompactionWriter, there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.

In file: MaxSSTableSizeWriter.java, class: MaxSSTableSizeWriter, method: MaxSSTableSizeWriter , there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.

In file: StorageProxy.java, class: StorageProxy, method: estimateResultsPerRange , there is a potential Division By Zero error while running. iCR suggested changes in 1 files to resolve the problem.

The fix addresses CWE 369

Unexpected Control Flow Fixes:

In file: AbstractTypeVersionComparator.java, class: AbstractTypeVersionComparator, method: compareCompositeTypes has a semicolon at an unusual place . iCR suggested changes in 1 files to resolve the problem.

Weak Library Usage Fixes:

In file: UUIDGen.java, class: UUIDGen, method:hash uses Random object but it may not be truly random. It should be replaced with SecureRandom. . iCR suggested changes in 1 files to resolve the problem.

@smiklosovic
Copy link
Contributor

Please file a JIRA ticket in Apache JIRA if you want to make this happen first. Thank you.

@smiklosovic smiklosovic added the missing-ticket missing ticket in Cassandra JIRA label Mar 16, 2022
blambov pushed a commit to blambov/cassandra that referenced this pull request Mar 21, 2022
blambov pushed a commit to blambov/cassandra that referenced this pull request Jun 13, 2022
blambov pushed a commit to blambov/cassandra that referenced this pull request Nov 24, 2022
(cherry picked from commit e1f6c58)
(cherry picked from commit f038e10)
adelapena pushed a commit to adelapena/cassandra that referenced this pull request Sep 26, 2023
(cherry picked from commit e1f6c58)
(cherry picked from commit f038e10)
(cherry picked from commit c667fab)
(cherry picked from commit fd4e739)
ekaterinadimitrova2 pushed a commit to ekaterinadimitrova2/cassandra that referenced this pull request Jun 3, 2024
(cherry picked from commit e1f6c58)
(cherry picked from commit f038e10)
(cherry picked from commit c667fab)
(cherry picked from commit fd4e739)
(cherry picked from commit 7bd6c3c)
@belliottsmith belliottsmith force-pushed the trunk branch 2 times, most recently from df3eb40 to 54e39a9 Compare July 23, 2025 11:19
michaelsembwever pushed a commit to thelastpickle/cassandra that referenced this pull request Jan 7, 2026
(cherry picked from commit e1f6c58)
(cherry picked from commit f038e10)
(cherry picked from commit c667fab)
(cherry picked from commit fd4e739)
(cherry picked from commit 7bd6c3c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-ticket missing ticket in Cassandra JIRA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants