Skip to content

Commit fab8926

Browse files
zhezzzzhezzz
andauthored
refactor: remove duplicate getRightItem call in TablesNamesFinder (#2370)
1. Mark Join.getRightItem() and setRightItem() as @deprecated since they return the same value as getFromItem(). 2. Remove the duplicate call to join.getRightItem().accept(this, context) in TablesNamesFinder.visit() method, as join.getFromItem() already processes the same FromItem object. Co-authored-by: zhezzz <taylorlzz@outlook.com>
1 parent 484eaa1 commit fab8926

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/main/java/net/sf/jsqlparser/statement/select/Join.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,12 @@ public Join withCross(boolean cross) {
277277
/**
278278
* Returns the right item of the join
279279
*/
280+
@Deprecated
280281
public FromItem getRightItem() {
281282
return fromItem;
282283
}
283284

285+
@Deprecated
284286
public void setRightItem(FromItem item) {
285287
fromItem = item;
286288
}

src/main/java/net/sf/jsqlparser/util/TablesNamesFinder.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,6 @@ private <S> void visitJoins(List<Join> joins, S context) {
13791379
}
13801380
for (Join join : joins) {
13811381
join.getFromItem().accept(this, context);
1382-
join.getRightItem().accept(this, context);
13831382
for (Expression expression : join.getOnExpressions()) {
13841383
expression.accept(this, context);
13851384
}

0 commit comments

Comments
 (0)