Skip to content

Parser error with time notation #58

@oowekyala

Description

@oowekyala

Repost from pmd/pmd#5388:

Description:

Whenever I have a test class with this type of time notation -> 01:00:00.000Z, the PMD breaks with syntax error.

Exception Stacktrace:

src/classes/VMS_OnCallCalculations_Test.cls	-	ParseException: Parse exception: com.google.summit.SummitAST$ParseException: Failed to parse src/classes/VMS_OnCallCalculations_Test.cls:
Syntax error at 256:174: mismatched input ':' expecting {'for', 'update', 'with', 'order', 'limit', 'and', 'group', 'all', 'offset', ']'}
Syntax error at 256:177: mismatched input ':' expecting {'for', 'update', 'with', 'order', 'limit', 'and', 'group', 'all', 'offset', ']'}
Syntax error at 256:184: missing ';' at 'Z'
Syntax error at 257:46: no viable alternative at input 'timeCardItemToUpdate.Check_Out__c ='
Syntax error at 257:74: mismatched input ';' expecting '{'
Syntax error at 258:12: extraneous input 'update' expecting {'abstract', 'after', 'before', 'class', 'enum', 'final', 'get', 'global', 'inherited', 'instanceof', 'interface', 'override', 'private', 'protected', 'public', 'set', 'sharing', 'static', 'switch', 'testmethod', 'transient', 'trigger', 'virtual', 'void', 'webservice', 'when', 'with', 'without', 'list', 'map', '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', 'grouping', 'convertcurrency', '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 261:8: mismatched input 'Test' expecting <EOF>

Code Sample demonstrating the issue:

List<VMS_Time_Card_Item__c> timeCardItem2 = [SELECT Break__c,Check_Out__c FROM VMS_Time_Card_Item__c WHERE Time_Card__c =:timeCard.Id AND Check_Out__c = 01:00:00.000Z];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions