mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-19 04:16:15 +00:00
Optimized the 'val' search; previously a fairly lengthy import list check was done for _every_ local declaration _anywhere_ in _any_ eclipse source file to see if it needed 'val' treatment. Now as a shortcut there's a check if the typeRef's last part is equal to 'val', and if not, no check is performed.
This commit is contained in:
1 parent
f4cce85965
commit
a85023b919
1 file changed
+4
-1
@@ -581,7 +581,10 @@ public class Eclipse {
|
||||
* @param typeRef A type reference to check.
|
||||
*/
|
||||
public static boolean typeMatches(Class<?> type, EclipseNode node, TypeReference typeRef) {
|
||||
if (typeRef == null || typeRef.getTypeName() == null) return false;
|
||||
if (typeRef == null || typeRef.getTypeName() == null || typeRef.getTypeName().length == 0) return false;
|
||||
String lastPartA = new String(typeRef.getTypeName()[typeRef.getTypeName().length -1]);
|
||||
String lastPartB = type.getSimpleName();
|
||||
if (!lastPartA.equals(lastPartB)) return false;
|
||||
String typeName = toQualifiedName(typeRef.getTypeName());
|
||||
|
||||
TypeLibrary library = new TypeLibrary();
|
||||
|
||||
Reference in new issue
Block a user