diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-10-06 00:25:32 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2015-10-06 00:25:32 +0200 |
commit | 9d8c4e4099bef9b7854cc5d77bc996c3b3bf0e41 (patch) | |
tree | 6ca48925c989d3f314fbeef08931a1940b5c03cf /src/utils | |
parent | b4d69f5cb8b093718bb7ffb539e5875df52ca48e (diff) | |
download | lombok-9d8c4e4099bef9b7854cc5d77bc996c3b3bf0e41.tar.gz lombok-9d8c4e4099bef9b7854cc5d77bc996c3b3bf0e41.tar.bz2 lombok-9d8c4e4099bef9b7854cc5d77bc996c3b3bf0e41.zip |
New feature: FieldDefaults can now be configured to apply to _every_ file, regardless of annotations.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/lombok/eclipse/Eclipse.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/utils/lombok/eclipse/Eclipse.java b/src/utils/lombok/eclipse/Eclipse.java index c2a863d5..18b22256 100644 --- a/src/utils/lombok/eclipse/Eclipse.java +++ b/src/utils/lombok/eclipse/Eclipse.java @@ -98,15 +98,20 @@ public class Eclipse { * string containing the same fully qualified name with dots in the string. */ public static boolean nameEquals(char[][] typeName, String string) { - StringBuilder sb = new StringBuilder(); - boolean first = true; - for (char[] elem : typeName) { - if (first) first = false; - else sb.append('.'); - sb.append(elem); + int pos = 0, len = string.length(); + for (int i = 0; i < typeName.length; i++) { + char[] t = typeName[i]; + if (i > 0) { + if (pos == len) return false; + if (string.charAt(pos++) != '.') return false; + } + for (int j = 0; j < t.length; j++) { + if (pos == len) return false; + if (string.charAt(pos++) != t[j]) return false; + } } - return string.contentEquals(sb); + return true; } public static boolean hasClinit(TypeDeclaration parent) { |