This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new ce90a987d46 Fix sonar issues (#37250)
ce90a987d46 is described below
commit ce90a987d462fc8da6a7a9d7fe615dfe78bf148b
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Dec 2 01:04:18 2025 +0800
Fix sonar issues (#37250)
---
.../sharding/algorithm/sharding/mod/ModShardingAlgorithm.java | 2 +-
.../preparer/inventory/splitter/InventoryDumperContextSplitter.java | 6 ++----
src/resources/idea/inspections.xml | 1 -
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithm.java
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithm.java
index 67cbf0b1ed8..f3b08990d7f 100644
---
a/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithm.java
+++
b/features/sharding/core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/mod/ModShardingAlgorithm.java
@@ -114,7 +114,7 @@ public final class ModShardingAlgorithm implements
StandardShardingAlgorithm<Com
return true;
}
return
getBigInteger(shardingValue.getValueRange().upperEndpoint()).subtract(getBigInteger(shardingValue.getValueRange().lowerEndpoint()))
- .compareTo(BigInteger.valueOf(shardingCount - 1)) >= 0;
+ .compareTo(BigInteger.valueOf(shardingCount - 1L)) >= 0;
}
private Collection<String> getAvailableTargetNames(final
Collection<String> availableTargetNames, final
RangeShardingValue<Comparable<?>> shardingValue) {
diff --git
a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/preparer/inventory/splitter/InventoryDumperContextSplitter.java
b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/preparer/inventory/splitter/InventoryDumperContextSplitter.java
index 54e1cbeb3eb..40870f001bf 100644
---
a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/preparer/inventory/splitter/InventoryDumperContextSplitter.java
+++
b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/preparer/inventory/splitter/InventoryDumperContextSplitter.java
@@ -126,10 +126,8 @@ public final class InventoryDumperContextSplitter {
int shardingSize =
jobItemContext.getJobProcessContext().getProcessConfiguration().getRead().getShardingSize();
return
InventoryPositionCalculator.getPositionByIntegerUniqueKeyRange(tableRecordsCount,
uniqueKeyValuesRange, shardingSize);
}
- if (1 == uniqueKeyColumns.size()) {
- if (dataTypeOption.isStringDataType(firstColumnDataType)) {
- return Collections.singleton(new
StringPrimaryKeyIngestPosition(null, null));
- }
+ if (1 == uniqueKeyColumns.size() &&
dataTypeOption.isStringDataType(firstColumnDataType)) {
+ return Collections.singleton(new
StringPrimaryKeyIngestPosition(null, null));
}
return Collections.singleton(new UnsupportedKeyIngestPosition());
}
diff --git a/src/resources/idea/inspections.xml
b/src/resources/idea/inspections.xml
index 43970315cbc..777c25fec50 100644
--- a/src/resources/idea/inspections.xml
+++ b/src/resources/idea/inspections.xml
@@ -248,7 +248,6 @@
<inspection_tool class="InstanceofThis" enabled="true" level="WARNING"
enabled_by_default="true" />
<inspection_tool class="IntLiteralMayBeLongLiteral" enabled="true"
level="WARNING" enabled_by_default="true" />
<inspection_tool class="IntroduceWhenSubject" enabled="false" level="WEAK
WARNING" enabled_by_default="false" />
- <inspection_tool class="JDBCExecuteWithNonConstantString" enabled="true"
level="WARNING" enabled_by_default="true" />
<inspection_tool class="JDBCResource" enabled="true" level="WARNING"
enabled_by_default="true">
<option name="insideTryAllowed" value="false" />
</inspection_tool>