aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2020-04-17 01:33:13 +0200
committerGitHub <noreply@github.com>2020-04-17 01:33:13 +0200
commitd4e5eb004066720d235cba7e474af088b6b9ce85 (patch)
tree22a8b4955ec76a55d53153556dc836d993650dc5 /src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
parent221783c1c2844783d5863218a92787f8c72facbd (diff)
parent91cd859b72c89a47bbe145c00a9e7c1b20a5e657 (diff)
downloadlombok-d4e5eb004066720d235cba7e474af088b6b9ce85.tar.gz
lombok-d4e5eb004066720d235cba7e474af088b6b9ce85.tar.bz2
lombok-d4e5eb004066720d235cba7e474af088b6b9ce85.zip
Merge pull request #2426 from Rawi01/subArrayTypeSourceRange
[fixes #2286] Set source range for vararg arrays
Diffstat (limited to 'src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java')
-rw-r--r--src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
index 756c23fa..95d42c2c 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java
@@ -103,6 +103,7 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable {
patchIdentifierEndReparse(sm);
patchRetrieveEllipsisStartPosition(sm);
patchRetrieveRightBraceOrSemiColonPosition(sm);
+ patchRetrieveProperRightBracketPosition(sm);
patchSetGeneratedFlag(sm);
patchDomAstReparseIssues(sm);
patchHideGeneratedNodes(sm);
@@ -445,6 +446,16 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable {
// .transplant().request(StackRequest.RETURN_VALUE, StackRequest.PARAM2).build());
}
+ private static void patchRetrieveProperRightBracketPosition(ScriptManager sm) {
+ sm.addScript(ScriptBuilder.wrapMethodCall()
+ .target(new MethodTarget("org.eclipse.jdt.core.dom.ASTConverter", "extractSubArrayType", "org.eclipse.jdt.core.dom.ArrayType", "org.eclipse.jdt.core.dom.ArrayType", "int", "int"))
+ .methodToWrap(new Hook("org.eclipse.jdt.core.dom.ASTConverter", "retrieveProperRightBracketPosition", "int", "int", "int"))
+ .wrapMethod(new Hook("lombok.launch.PatchFixesHider$PatchFixes", "fixRetrieveProperRightBracketPosition", "int", "int", "org.eclipse.jdt.core.dom.ArrayType"))
+ .requestExtra(StackRequest.PARAM1)
+ .transplant()
+ .build());
+ }
+
private static void patchSetGeneratedFlag(ScriptManager sm) {
sm.addScript(ScriptBuilder.addField()
.targetClass("org.eclipse.jdt.internal.compiler.ast.ASTNode")