aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2020-09-18 02:31:44 +0200
committerGitHub <noreply@github.com>2020-09-18 02:31:44 +0200
commit1dd84581c0a0f3c843ac59d5b6bca3d5f674c7b8 (patch)
treed225c675cae91a7182d60296174d04d2cbd09cdc /src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
parentf43a63b1d988a703dddbc61c47076d616bb3d639 (diff)
parent4d2ae4ba3261ab2963c13649b3ba8f4b3881e9c3 (diff)
downloadlombok-1dd84581c0a0f3c843ac59d5b6bca3d5f674c7b8.tar.gz
lombok-1dd84581c0a0f3c843ac59d5b6bca3d5f674c7b8.tar.bz2
lombok-1dd84581c0a0f3c843ac59d5b6bca3d5f674c7b8.zip
Merge pull request #2558 from Rawi01/extensionmethod-suppress
Fix suppressBaseMethods in ecj/eclipse
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
index 1c7de88b..3412000e 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
@@ -850,6 +850,7 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable {
final String METHOD_BINDING_SIG = "org.eclipse.jdt.internal.compiler.lookup.MethodBinding";
final String COMPLETION_PROPOSAL_COLLECTOR_SIG = "org.eclipse.jdt.ui.text.java.CompletionProposalCollector";
final String I_JAVA_COMPLETION_PROPOSAL_SIG = "org.eclipse.jdt.ui.text.java.IJavaCompletionProposal[]";
+ final String AST_NODE = "org.eclipse.jdt.internal.compiler.ast.ASTNode";
sm.addScript(wrapReturnValue()
.target(new MethodTarget(MESSAGE_SEND_SIG, "resolveType", TYPE_BINDING_SIG, BLOCK_SCOPE_SIG))
@@ -878,6 +879,13 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable {
.replacementMethod(new Hook(PATCH_EXTENSIONMETHOD, "invalidMethod", "void", PROBLEM_REPORTER_SIG, MESSAGE_SEND_SIG, METHOD_BINDING_SIG, SCOPE_SIG))
.build());
+ sm.addScript(replaceMethodCall()
+ .target(new MethodTarget(MESSAGE_SEND_SIG, "resolveType", TYPE_BINDING_SIG, BLOCK_SCOPE_SIG))
+ .methodToReplace(new Hook(PROBLEM_REPORTER_SIG, "nonStaticAccessToStaticMethod", "void", AST_NODE, METHOD_BINDING_SIG))
+ .replacementMethod(new Hook(PATCH_EXTENSIONMETHOD, "nonStaticAccessToStaticMethod", "void", PROBLEM_REPORTER_SIG, AST_NODE, METHOD_BINDING_SIG, MESSAGE_SEND_SIG))
+ .requestExtra(StackRequest.THIS)
+ .build());
+
if (!ecj) {
sm.addScript(wrapReturnValue()
.target(new MethodTarget(COMPLETION_PROPOSAL_COLLECTOR_SIG, "getJavaCompletionProposals", I_JAVA_COMPLETION_PROPOSAL_SIG))