File tree Expand file tree Collapse file tree 4 files changed +40
-7
lines changed
src/main/java/net/sf/jsqlparser/statement/update Expand file tree Collapse file tree 4 files changed +40
-7
lines changed Original file line number Diff line number Diff line change 124124 <phase >process-sources</phase >
125125 </execution >
126126 </executions >
127+ <dependencies >
128+ <dependency >
129+ <groupId >net.sourceforge.pmd</groupId >
130+ <artifactId >pmd-core</artifactId >
131+ <version >${pmdVersion} </version >
132+ </dependency >
133+ <dependency >
134+ <groupId >net.sourceforge.pmd</groupId >
135+ <artifactId >pmd-java</artifactId >
136+ <version >${pmdVersion} </version >
137+ </dependency >
138+ <dependency >
139+ <groupId >net.sourceforge.pmd</groupId >
140+ <artifactId >pmd-javascript</artifactId >
141+ <version >${pmdVersion} </version >
142+ </dependency >
143+ <dependency >
144+ <groupId >net.sourceforge.pmd</groupId >
145+ <artifactId >pmd-jsp</artifactId >
146+ <version >${pmdVersion} </version >
147+ </dependency >
148+ </dependencies >
127149 </plugin >
128150 <plugin >
129151 <groupId >org.codehaus.mojo</groupId >
610632
611633 <properties >
612634 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
635+ <pmdVersion >6.36.0</pmdVersion >
613636 </properties >
614637
615638 <description >JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes.
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ under the License.
3838 <!-- this little fellow will complain about PACKAGE based imports -->
3939 <!-- <rule ref="category/java/bestpractices.xml/UnusedImports" /> -->
4040
41- <rule ref =" category/java/bestpractices.xml/UnusedFormalParameter" />
41+ <!-- < rule ref="category/java/bestpractices.xml/UnusedFormalParameter" /> -- >
4242 <rule ref =" category/java/bestpractices.xml/UnusedLocalVariable" />
4343 <rule ref =" category/java/bestpractices.xml/UnusedPrivateField" />
4444 <rule ref =" category/java/bestpractices.xml/UnusedPrivateMethod" />
Original file line number Diff line number Diff line change @@ -167,10 +167,11 @@ public Select getSelect() {
167167
168168 @ Deprecated
169169 public void setSelect (Select select ) {
170- if (select != null ) {
170+ if (select != null ) {
171171 SubSelect subSelect = new SubSelect ().withSelectBody (select .getSelectBody ());
172- if (select .getWithItemsList () != null && select .getWithItemsList ().size () > 0 )
172+ if (select .getWithItemsList () != null && select .getWithItemsList ().size () > 0 ) {
173173 subSelect .setWithItemsList (select .getWithItemsList ());
174+ }
174175
175176 if (updateSets .get (0 ).expressions .isEmpty ()) {
176177 updateSets .get (0 ).expressions .add (subSelect );
@@ -192,11 +193,12 @@ public void setUseColumnsBrackets(boolean useColumnsBrackets) {
192193
193194 @ Deprecated
194195 public boolean isUseSelect () {
195- return ( updateSets .get (0 ).expressions .get (0 ) instanceof SubSelect ) ;
196+ return updateSets .get (0 ).expressions .get (0 ) instanceof SubSelect ;
196197 }
197198
198199 @ Deprecated
199200 public void setUseSelect (boolean useSelect ) {
201+ //todo
200202 }
201203
202204 public void setOrderByElements (List <OrderByElement > orderByElements ) {
@@ -260,8 +262,8 @@ public String toString() {
260262 }
261263 b .append (" SET " );
262264
263- int j = 0 ;
264- for (UpdateSet updateSet : updateSets ) {
265+ int j = 0 ;
266+ for (UpdateSet updateSet : updateSets ) {
265267 if (j > 0 ) {
266268 b .append (", " );
267269 }
@@ -317,7 +319,6 @@ public String toString() {
317319// b.append(" = ");
318320// b.append("(").append(select).append(")");
319321// }
320-
321322 if (fromItem != null ) {
322323 b .append (" FROM " ).append (fromItem );
323324 if (joins != null ) {
Original file line number Diff line number Diff line change 1+ /*-
2+ * #%L
3+ * JSQLParser library
4+ * %%
5+ * Copyright (C) 2004 - 2021 JSQLParser
6+ * %%
7+ * Dual licensed under GNU LGPL 2.1 or Apache License 2.0
8+ * #L%
9+ */
110package net .sf .jsqlparser .statement .update ;
211
312import net .sf .jsqlparser .expression .Expression ;
You can’t perform that action at this time.
0 commit comments