aboutsummaryrefslogtreecommitdiff
path: root/src/eclipseAgent/lombok/launch/PatchFixesHider.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/launch/PatchFixesHider.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/launch/PatchFixesHider.java')
-rwxr-xr-xsrc/eclipseAgent/lombok/launch/PatchFixesHider.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/eclipseAgent/lombok/launch/PatchFixesHider.java b/src/eclipseAgent/lombok/launch/PatchFixesHider.java
index 563beab1..deab0be1 100755
--- a/src/eclipseAgent/lombok/launch/PatchFixesHider.java
+++ b/src/eclipseAgent/lombok/launch/PatchFixesHider.java
@@ -38,6 +38,7 @@ import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.dom.ArrayType;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.search.SearchMatch;
@@ -517,6 +518,12 @@ final class PatchFixesHider {
return -1;
}
+ public static int fixRetrieveProperRightBracketPosition(int retVal, ArrayType arrayType) {
+ if (retVal != -1 || arrayType == null) return retVal;
+ if (isGenerated(arrayType)) return arrayType.getStartPosition() + arrayType.getLength() - 1;
+ return -1;
+ }
+
public static final int ALREADY_PROCESSED_FLAG = 0x800000; //Bit 24
public static boolean checkBit24(Object node) throws Exception {