Skip to content

Commit

Permalink
fix sonar issue in ColumnDefinitionSegmentBinder and ShardingRuleTest
Browse files Browse the repository at this point in the history
  • Loading branch information
strongduanmu committed Dec 24, 2024
1 parent 572998a commit c400ccb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Map;
Expand Down Expand Up @@ -739,15 +738,6 @@ private ColumnSegment createColumnSegment(final String columnName, final String
return result;
}

private Map<String, String> createColumnTableNameMap() {
Map<String, String> result = new HashMap<>(4, 1F);
result.put("logic_Table.user_id", "logic_Table");
result.put("sub_Logic_Table.user_id", "sub_Logic_Table");
result.put("logic_Table.order_id", "logic_Table");
result.put("sub_Logic_Table.order_id", "sub_Logic_Table");
return result;
}

@Test
void assertGetDataNodesByTableName() {
ShardingRule shardingRule = createMinimumShardingRule();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static ColumnDefinitionSegment bind(final ColumnDefinitionSegment segment
ColumnSegment boundColumnSegment = ColumnSegmentBinder.bind(segment.getColumnName(), SegmentType.DEFINITION_COLUMNS, binderContext, tableBinderContexts, LinkedHashMultimap.create());
ColumnDefinitionSegment result =
new ColumnDefinitionSegment(segment.getStartIndex(), segment.getStopIndex(), boundColumnSegment, segment.getDataType(), segment.isPrimaryKey(), segment.isNotNull(), segment.getText());
copy(segment, result);
copy(result, segment);
segment.getReferencedTables().forEach(each -> result.getReferencedTables().add(SimpleTableSegmentBinder.bind(each, binderContext, tableBinderContexts)));
return result;
}
Expand Down

0 comments on commit c400ccb

Please sign in to comment.