-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[apex] Update parser to support new 'as user' keywords (User Mode for Database Operations) #3973
Comments
No, because it is incomplete. There is also We are anyway trying to get rid of jorje in order to use a true open source alternative - see #3766. I'm updating now and I found out, that there are additional classes in com.google.common which are not available anywhere else (e.g. |
That sounds promising, thanks for the info!
Even with the current Jorje setup under certain circumstances you could already run into issues when some Guava classes were loaded from the Jorje JAR but other classes had already been loaded by a parent class loader from a regular Guava JAR you had on your classpath. If the Jorje Guava classes tried to access the regular ones in the same package but from the regular Guava JAR, an I am a bit afraid that your proposed changes of removing some of the Guava classes could make it more likely that such issues occur. Maybe an alternative would be to change the package name of the Guava classes in Jorje to avoid conflicts with regular Guava versions, for examples with the Jar Jar Links plugin or similar. Though of course changing package names is a bit risky in case there is reflective usage which is not detected by the tool performing the renaming. |
It works with PMD 7.0.0-rc4: public class UserMode {
public void coverAllCasesWithTest() {
Contact c;
c = [SELECT Name FROM Contact WITH USER_MODE];
// Should be flagged a critical issue
Contact c2;
insert c2;
// Should be ignored
insert as user c2;
// Should be at best a warning because it ignores CRUD but explicitly
insert as system c2;
// Should be ignored
update as user c2;
}
} Are you sure you are using rc4? From which software is your screenshot? |
PMD 7.0.0 final release is out, I recommend you try it out and open a new issue if needed. |
Affects PMD Version:
Commit 9d23d79 (PMD 6.45.0)
Description:
It looks like the Maven dependencies declared by pmd-apex-jorje do not match the actual dependencies of the currently used
apex-jorje-lsp.jar
anymore. In particularjol-core
seems to not be used anymore, and some other dependencies are pulled in as transitive dependencies and might not have to be declared explicitly.Do you think it would be possible to adjust the
create-local-repo.sh
script to automatically adjust the pmd-apex-jorje POM with the information from theMETA-INF/maven
directory in theapex-jorje-lsp.jar
file? (with exclusions for thecom.salesforce.apex
artifacts, since they are part of the JAR)Maybe it would also be good to add a small comment to
create-local-repo.sh
explaining whycom/google/common*
is not removed from the JAR. Currently one has to dig into the Git history to find #773 (comment) which mentions thatapex-jorje-lsp.jar
is using a modified version of Guava.The text was updated successfully, but these errors were encountered: