Repository navigation
[apex] Update Apex compiler - #489
Conversation
There are some AST changes: * no DottedExpression anymore * NewNameValueObjectExpression has been renamed to NewKeyValueObjectExpression * no TestNode anymore * new types: CastExpression, ConstructorPreamble, IllegalStoreExpression, MethodBlockStatement, Modifier, MultiStatement, NestedExpression, NestedSToreExpression, StatementExecuted
The compiler seems to have a problem with Soql expressions See ApexCompilerSoqlTest
|
@sergeygorbaty @up2go-rsoesemann |
|
I've verified the same code now with Salesforce IDE and it fails with the same NullPointer. The effect is, that the Outline View is not updated anymore with the changes made to the class. You can see the stacktrace of the exception in the Error Log View of eclipse. |
|
Ok, seems this is not going anywhere for the time being. Did you report this issue back to them? https://github.com/forcedotcom/idecore/issues |
|
Sorry @adangel for not responding. I have create an issue here https://github.com/forcedotcom/idecore/issues/227 and will moderate when answers com in. |
|
@up2go-rsoesemann Thanks for creating the issue upstream! |
|
@adangel it fails to parse your snippet because its invalid Apex. It took me a while to see it. But Apex uses single quotes instead of double quotes. Replace with and it should work. |
|
@up2go-rsoesemann |
Note: the test case in VariableNamingConvetion with a custom annotation type is not relevant for apex, since there are no custom annotations.
The new parser seems to always return a BlockStatement, regardless whether it's a real block or just an expression statement.
|
@up2go-rsoesemann It works now. Using the single quotes indeed fixed it. I've deleted one test case, which created a custom annotation type, which is not possible with Apex, or is it? |
|
Merged! Amazing! |
Since a year ago, the Salesforce IDE uses a new version of the jorje compiler jars, see commit 3083815933....
I tried to update the PMD integration. After adjusting to the API changes (e.g. new/renamed/deleted AST node types), I'm running into some problems:
The new compiler seem to have a bug when parsing the following Apex snippet, which contains SOQL:
The stacktrace is this:
I've created the test class
ApexCompilerSoqlTest, which tries to parse/compile this code snippet.Only parsing works without an error (see
ApexLexerTestwhere I lex and parse the snippet).Before submitting a PR, please check that:
master. The PMD team will merge back to support branches as needed.mvn testpasses.mvn checkstyle:checkpasses. Check this for more info