aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2015-10-06 00:25:32 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2015-10-06 00:25:32 +0200
commit9d8c4e4099bef9b7854cc5d77bc996c3b3bf0e41 (patch)
tree6ca48925c989d3f314fbeef08931a1940b5c03cf /src/utils
parentb4d69f5cb8b093718bb7ffb539e5875df52ca48e (diff)
downloadlombok-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.java19
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) {