ST4’s Java syntax definition strictly follows official language specifications (see: https://docs.oracle.com/javase/specs/jls/se20).
String Literals
According to Chapter 3.10.15 string literals must be enclosed by double quotes.
Single quotes are used to denote character literals (see Chapter 3.10.14), which consist of exactly one character (e.g. 'c'
) or an escape sequence (e.g.: '\u214'
).
Java compiler actually throws a compile error on your statement.
debug.java:6: error: unclosed character literal
ven.addError('Name Already Exists');
^
debug.java:6: error: ';' expected
ven.addError('Name Already Exists');
^
debug.java:6: error: unclosed character literal
ven.addError('Name Already Exists');
^
debug.java:6: error: not a statement
ven.addError('Name Already Exists');
^
with … class
public with sharing class VenueTriggerHandler
The with sharing
expression is also not part of official Java language specs causing java compiler to throw compile error at it
debug.java:2: error: class, interface, enum, or record expected
public with any class VenuTrigger
^
As ST4’s Java syntax does not know this construct either it fails highlighting the class definition due to internal implementation details, causing the first public
keyword to be highlighted as illegal.