Community
Participate
Working Groups
Asking the VariableBinding of 'array'.length for a key results in a null pointer exception. The stack trace is: Stack trace: java/lang/Throwable.<init>()V java/lang/Throwable.<init>(Ljava/lang/String;)V java/lang/NullPointerException.<init>(Ljava/lang/String;)V org/eclipse/jdt/core/dom/DefaultBindingResolver.getTypeBinding (Lorg/eclipse/jdt/internal/compiler/lookup/TypeBinding;) Lorg/eclipse/jdt/core/dom/ITypeBinding; org/eclipse/jdt/core/dom/VariableBinding.getDeclaringClass() Lorg/eclipse/jdt/core/dom/ITypeBinding; org/eclipse/jdt/core/dom/VariableBinding.getKey()Ljava/lang/String; org/eclipse/jdt/internal/corext/dom/BindingIdentifier.matches (Lorg/eclipse/jdt/core/dom/IBinding;)Z org/eclipse/jdt/internal/corext/refactoring/sef/AccessAnalyzer.getFieldBinding (Lorg/eclipse/jdt/core/dom/Name;)Lorg/eclipse/jdt/core/dom/IVariableBinding; org/eclipse/jdt/internal/corext/refactoring/sef/AccessAnalyzer.handleSimpleName (Lorg/eclipse/jdt/core/dom/SimpleName;)V org/eclipse/jdt/internal/corext/refactoring/sef/AccessAnalyzer.visit (Lorg/eclipse/jdt/core/dom/SimpleName;)Z org/eclipse/jdt/core/dom/SimpleName.accept0 (Lorg/eclipse/jdt/core/dom/ASTVisitor;)V org/eclipse/jdt/core/dom/ASTNode.acceptChild (Lorg/eclipse/jdt/core/dom/ASTVisitor;Lorg/eclipse/jdt/core/dom/ASTNode;)V org/eclipse/jdt/core/dom/QualifiedName.accept0 (Lorg/eclipse/jdt/core/dom/ASTVisitor;)V org/eclipse/jdt/core/dom/ASTNode.acceptChildren (Lorg/eclipse/jdt/core/dom/ASTVisitor;Lorg/eclipse/jdt/core/dom/ASTNode$NodeList ;)V org/eclipse/jdt/core/dom/MethodInvocation.accept0 (Lorg/eclipse/jdt/core/dom/ASTVisitor;)V org/eclipse/jdt/core/dom/ASTNode.acceptChild (Lorg/eclipse/jdt/core/dom/ASTVisitor;Lorg/eclipse/jdt/core/dom/ASTNode;)V org/eclipse/jdt/core/dom/ExpressionStatement.accept0 (Lorg/eclipse/jdt/core/dom/ASTVisitor;)V org/eclipse/jdt/core/dom/ASTNode.acceptChildren (Lorg/eclipse/jdt/core/dom/ASTVisitor;Lorg/eclipse/jdt/core/dom/ASTNode$NodeList ;)V org/eclipse/jdt/core/dom/Block.accept0(Lorg/eclipse/jdt/core/dom/ASTVisitor;) V org/eclipse/jdt/core/dom/ASTNode.acceptChild (Lorg/eclipse/jdt/core/dom/ASTVisitor;Lorg/eclipse/jdt/core/dom/ASTNode;)V org/eclipse/jdt/core/dom/MethodDeclaration.accept0 (Lorg/eclipse/jdt/core/dom/ASTVisitor;)V org/eclipse/jdt/core/dom/ASTNode.acceptChildren (Lorg/eclipse/jdt/core/dom/ASTVisitor;Lorg/eclipse/jdt/core/dom/ASTNode$NodeList ;)V org/eclipse/jdt/core/dom/TypeDeclaration.accept0 (Lorg/eclipse/jdt/core/dom/ASTVisitor;)V org/eclipse/jdt/core/dom/ASTNode.acceptChildren (Lorg/eclipse/jdt/core/dom/ASTVisitor;Lorg/eclipse/jdt/core/dom/ASTNode$NodeList ;)V org/eclipse/jdt/core/dom/CompilationUnit.accept0 (Lorg/eclipse/jdt/core/dom/ASTVisitor;)V org/eclipse/jdt/core/dom/ASTNode.accept (Lorg/eclipse/jdt/core/dom/ASTVisitor;)V org/eclipse/jdt/internal/corext/refactoring/sef/SelfEncapsulateFieldRefactoring. checkInput(Lorg/eclipse/core/runtime/IProgressMonitor;) Lorg/eclipse/jdt/internal/corext/refactoring/base/RefactoringStatus; org/eclipse/jdt/internal/ui/refactoring/CheckConditionsOperation.run (Lorg/eclipse/core/runtime/IProgressMonitor;)V org/eclipse/jdt/internal/ui/refactoring/CreateChangeOperation.run (Lorg/eclipse/core/runtime/IProgressMonitor;)V org/eclipse/jface/operation/ModalContext$ModalContextThread.run()V Reason is that the declaringClass of the compiler's FieldBinding is null.
This will be fixed today.
In case the field is .length, there is no declaring class associated with it. Then the getKey() on a VariableBinding should check if the declaring class is not null, before trying to include the declaring class getKey() inside the variable binding key. Fixed. Wait for the build input to release it.
Released.