A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/5218 below:

[apex] Parser error when using nested subqueries in SOQL · Issue #5218 · pmd/pmd · GitHub

Make sure, to test with the latest PMD version.

First encountered when using version 7.0.0 from the vscode-apex-pmd extension, but after testing against version 7.5.0 it appears to persist.

A SOQL query with one level of subquery works, but adding a second level of subquery causes a syntax error. The syntax error is not correct, however, as the query has been deployed and runs correctly.

Removing the second-level subquery allows PMD to check the file, and adding the second-level subquery causes the syntax error again.

pmd check --no-cache -d "c:\Users\imax-erik\...\NestedSubqueries.cls" -R "c:\Users\imax-erik\.vscode\extensions\chuckjonas.apex-pmd-0.7.0\rulesets\apex_ruleset.xml" -v
[DEBUG] Log level is at TRACE
[DEBUG] Adding regular file c:\Users\imax-erik\...\NestedSubqueries.cls.
[TRACE] Adding file c:\Users\imax-erik\...\NestedSubqueries.cls (lang: apex 60)
[DEBUG] Rules loaded from c:\\Users\\imax-erik\\.vscode\\extensions\\chuckjonas.apex-pmd-0.7.0\\rulesets\\apex_ruleset.xml:
[DEBUG] - ExcessiveClassLength (Apex)
...
[DEBUG] Runtime classpath:
C:\\Users\\imax-erik\\Downloads\\pmd-7.5.0\\bin\\..\\conf;C:\\Users\\imax-erik\\Downloads\\pmd-7.5.0\\bin\\..\\lib\\antlr4-runtime-4.9.3.jar;C:\\Users\\imax-erik\\Downloads\\pmd-7.5.0\\bin\\..\\lib\\apex-ls_2.13-5.2.0.jar;C:\\Users\\imax-erik\\Downloads\\pmd-7.5.0\\bin\\..\\lib\\apex-parser-4.1.0.jar;
...
[TRACE] Processing file (lang: apex+version:60): c:\Users\imax-erik\...\NestedSubqueries.cls
c:\Users\imax-erik\...\NestedSubqueries.cls        -       ParseException: Parse exception: com.google.summit.SummitAST$ParseException: Failed to parse c:\Users\imax-erik\...\NestedSubqueries.cls:
Syntax error at 3:57: extraneous input '(' expecting {'after', 'before', 'get', 'inherited', 'instanceof', 'set', 'sharing', 'switch', 'transient', 'trigger', 'when', 'with', 'without', 'system', 'user', 'select', 'count', 'from', 'as', 'using', 'scope', 'where', 'order', 'by', 'limit', 'and', 'or', 'not', 'avg', 'count_distinct', 'min', 'max', 'sum', 'typeof', 'end', 'then', 'like', 'in', 'includes', 'excludes', 'asc', 'desc', 'nulls', 'first', 'last', 'group', 'all', 'rows', 'view', 'having', 'rollup', 'tolabel', 'offset', 'data', 'category', 'at', 'above', 'below', 'above_or_below', 'security_enforced', 'system_mode', 'user_mode', 'reference', 'cube', 'format', 'tracking', 'viewstat', 'custom', 'standard', 'distance', 'geolocation', 'calendar_month', 'calendar_quarter', 'calendar_year', 'day_in_month', 'day_in_week', 'day_in_year', 'day_only', 'fiscal_month', 'fiscal_quarter', 'fiscal_year', 'hour_in_day', 'week_in_month', 'week_in_year', 'converttimezone', 'yesterday', 'today', 'tomorrow', 'last_week', 'this_week', 'next_week', 'last_month', 'this_month', 'next_month', 'last_90_days', 'next_90_days', 'last_n_days', 'next_n_days', 'n_days_ago', 'next_n_weeks', 'last_n_weeks', 'n_weeks_ago', 'next_n_months', 'last_n_months', 'n_months_ago', 'this_quarter', 'last_quarter', 'next_quarter', 'next_n_quarters', 'last_n_quarters', 'n_quarters_ago', 'this_year', 'last_year', 'next_year', 'next_n_years', 'last_n_years', 'n_years_ago', 'this_fiscal_quarter', 'last_fiscal_quarter', 'next_fiscal_quarter', 'next_n_fiscal_quarters', 'last_n_fiscal_quarters', 'n_fiscal_quarters_ago', 'this_fiscal_year', 'last_fiscal_year', 'next_fiscal_year', 'next_n_fiscal_years', 'last_n_fiscal_years', 'n_fiscal_years_ago', IntegralCurrencyLiteral, 'find', 'email', 'name', 'phone', 'sidebar', 'fields', 'metadata', 'pricebookid', 'network', 'snippet', 'target_length', 'division', 'returning', 'listview', Identifier}
Syntax error at 3:97: mismatched input ')' expecting {'from', ','}
Syntax error at 3:112: missing ';' at 'LIMIT'
Syntax error at 3:119: extraneous input ']' expecting ';'
[INFO] An error occurred while executing PMD.
Run in verbose mode to see a stack-trace.
If you think this is a bug in PMD, please report this issue at https://github.com/pmd/pmd/issues/new/choose
If you do so, please include a stack-trace, the code sample
 causing the issue, and details about your run configuration.

Please provide detailed steps for how we can reproduce the bug.

pmd check -d NestedSubqueries.cls

Comment out the second-level subqueries to allow PMD to check the file, then uncomment the subqueries after fixing the issues found.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4