[Issue 109304] NPE when propertyAlias is selected after referenced message part is deleted webapi_public_112441_root
authoryaroslavskiy@netbeans.org
Thu, 09 Aug 2007 08:24:21 +0000
changeset 973e6c5a2358afb
parent 972 813221c28b12
child 974 acf658f774d5
[Issue 109304] NPE when propertyAlias is selected after referenced message part is deleted
bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/Factory.java
     1.1 --- a/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/Factory.java	Thu Aug 09 01:51:14 2007 +0000
     1.2 +++ b/bpel.refactoring/src/org/netbeans/modules/bpel/refactoring/Factory.java	Thu Aug 09 08:24:21 2007 +0000
     1.3 @@ -18,6 +18,7 @@
     1.4   */
     1.5  package org.netbeans.modules.bpel.refactoring;
     1.6  
     1.7 +import org.netbeans.modules.xml.xam.Referenceable;
     1.8  import org.netbeans.modules.refactoring.api.AbstractRefactoring;
     1.9  import org.netbeans.modules.refactoring.api.MoveRefactoring;
    1.10  import org.netbeans.modules.refactoring.api.RenameRefactoring;
    1.11 @@ -25,7 +26,6 @@
    1.12  import org.netbeans.modules.refactoring.api.WhereUsedQuery;
    1.13  import org.netbeans.modules.refactoring.spi.RefactoringPlugin;
    1.14  import org.netbeans.modules.refactoring.spi.RefactoringPluginFactory;
    1.15 -import org.netbeans.modules.xml.xam.Referenceable;
    1.16  
    1.17  /**
    1.18   * @author Vladimir Yaroslavskiy
    1.19 @@ -35,10 +35,11 @@
    1.20     
    1.21    /**{@inheritDoc}*/
    1.22    public RefactoringPlugin createInstance(AbstractRefactoring refactoring) {
    1.23 -   Referenceable ref = refactoring.getRefactoringSource().lookup(Referenceable.class);
    1.24 -   if(ref == null){
    1.25 -     //this is not my obj, dont participate in refactoring
    1.26 -     return null;
    1.27 +    Referenceable referenceable = refactoring.getRefactoringSource().lookup(Referenceable.class);
    1.28 +  
    1.29 +    if (referenceable == null){
    1.30 +      // this is not my object, don't participate in refactoring
    1.31 +      return null;
    1.32      }
    1.33      if (refactoring instanceof WhereUsedQuery) {
    1.34        return new Finder((WhereUsedQuery) refactoring);