]> source.dussan.org Git - aspectj.git/commitdiff
141730: underpinning changes for new handles support. No longer 'leak' implementatio...
authoraclement <aclement>
Tue, 13 Jun 2006 13:23:14 +0000 (13:23 +0000)
committeraclement <aclement>
Tue, 13 Jun 2006 13:23:14 +0000 (13:23 +0000)
asm/src/org/aspectj/asm/IElementHandleProvider.java
asm/src/org/aspectj/asm/IProgramElement.java
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
asm/src/org/aspectj/asm/internal/FullPathHandleProvider.java
asm/src/org/aspectj/asm/internal/OptimizedFullPathHandleProvider.java
asm/src/org/aspectj/asm/internal/ProgramElement.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AsmInterTypeRelationshipProvider.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java
tests/src/org/aspectj/systemtest/incremental/tools/AbstractMultiProjectIncrementalAjdeInteractionTestbed.java
weaver/src/org/aspectj/weaver/AsmRelationshipProvider.java
weaver/src/org/aspectj/weaver/ShadowMunger.java

index d88799b627f06293cd505d35ccdee92058fdd399..3e5ef9570d78292ca6aabae904f2ee0a0acc8ba2 100644 (file)
@@ -37,6 +37,11 @@ public interface IElementHandleProvider {
      */
     public String createHandleIdentifier(File sourceFile, int line,int column,int offset);
 
+    /**
+     * @return  a String uniquely identifying this element
+     */
+       public String createHandleIdentifier(IProgramElement ipe);
+    
     /**
      * NOTE: this is necessary for the current implementation to look up nodes, 
      * but we may want to consider removing it.
index f88c2dbbad7ae7ffc8d203ebd9a538bc039321f9..6fbc15b0930c9eaf4b59444d29f3d3179223c299 100644 (file)
@@ -127,9 +127,11 @@ public interface IProgramElement extends Serializable {
         * The format of the string handle is not specified, but is stable across 
         * compilation sessions.
         * 
-        * @return      a string representtaion of this element
+        * @return      a string representation of this element
         */
        public String getHandleIdentifier();
+       public String getHandleIdentifier(boolean create);
+       public void setHandleIdentifier(String handle);
        
        /**
         * @return      a string representation of this node and all of its children (recursive)
index 8260c4805aeaf88b2436e5f891c17ed92d2ecb71..8c525b083fd165e8a026d29d2b19045682735f99 100644 (file)
@@ -37,16 +37,7 @@ public class AspectJElementHierarchy implements IHierarchy {
        public IProgramElement getElement(String handle) {
                IProgramElement cachedEntry = (IProgramElement)handleMap.get(handle);
                if (cachedEntry!=null) return cachedEntry;
-               
-//             StringTokenizer st = new StringTokenizer(handle, ProgramElement.ID_DELIM);
-//        int line = new Integer(st.nextToken()).intValue();
-        // int col = new Integer(st.nextToken()).intValue(); TODO: use column number when available
-        String file = AsmManager.getDefault().getHandleProvider().getFileForHandle(handle); // st.nextToken();
-        int line = AsmManager.getDefault().getHandleProvider().getLineNumberForHandle(handle); // st.nextToken();
-        int offSet = AsmManager.getDefault().getHandleProvider().getOffSetForHandle(handle); 
-        
-        String canonicalSFP = AsmManager.getDefault().getCanonicalFilePath(new File(file));
-               IProgramElement ret = findNodeForSourceLineHelper(root,canonicalSFP, line, offSet);
+               IProgramElement ret = findElementForHandle(handle);
                if (ret!=null) {
                        cache(handle,ret);
                }
@@ -68,7 +59,10 @@ public class AspectJElementHierarchy implements IHierarchy {
        }
        
        public boolean removeFromFileMap(Object key) {
-               return (fileMap.remove(key)!=null);
+               if (fileMap.containsKey(key)) {
+                       return (fileMap.remove(key)!=null);
+               }
+               return true;    
        }
 
        public void setFileMap(HashMap fileMap) {
@@ -344,30 +338,26 @@ public class AspectJElementHierarchy implements IHierarchy {
                IProgramElement ret = (IProgramElement) handleMap.get(handle);
                if (ret != null) return ret;
                
-//             StringTokenizer st = new StringTokenizer(handle, ProgramElement.ID_DELIM);
-//             String file = st.nextToken();
-//             int line = new Integer(st.nextToken()).intValue();
-//             int col = new Integer(st.nextToken()).intValue();
-               // TODO: use column number when available
-        String file = AsmManager.getDefault().getHandleProvider().getFileForHandle(handle); // st.nextToken();
-        int line = AsmManager.getDefault().getHandleProvider().getLineNumberForHandle(handle); // st.nextToken();
-        int offSet = AsmManager.getDefault().getHandleProvider().getOffSetForHandle(handle);
-        
-               ret = findElementForOffSet(file, line, offSet);
-               if (ret != null) { 
+               ret = findElementForHandle(root,handle);
+               if (ret != null) {
                        cache(handle,(ProgramElement)ret);
                }
                return ret;
-               
-//             IProgramElement parent = findElementForType(packageName, typeName);
-//             if (parent == null) return null;
-//             if (kind == IProgramElement.Kind.CLASS ||
-//                     kind == IProgramElement.Kind.ASPECT) {
-//                             return parent;
-//             } else {
-//                     return findElementForSignature(parent, kind, name);     
-//             }       
        }
+       
+       private IProgramElement findElementForHandle(IProgramElement parent, String handle) {
+               for (Iterator it = parent.getChildren().iterator(); it.hasNext(); ) {
+                       IProgramElement node = (IProgramElement)it.next();
+                       if (handle.equals(node.getHandleIdentifier())) {
+                               return node;
+                       } else {
+                               IProgramElement childSearch = findElementForHandle(node,handle);
+                               if (childSearch != null) return childSearch;
+                       }
+               }
+               return null;
+       }
+       
 //     
 //     private IProgramElement findElementForBytecodeInfo(
 //             IProgramElement node, 
index d58834ae3d9662e83c54f4de2c771c5aec336912..6ab254d453df003f20a350fb188d3e3dcf9d55eb 100644 (file)
@@ -17,9 +17,12 @@ import java.util.StringTokenizer;
 
 import org.aspectj.asm.AsmManager;
 import org.aspectj.asm.IElementHandleProvider;
+import org.aspectj.asm.IProgramElement;
 import org.aspectj.bridge.ISourceLocation;
 
 /**
+ * HandleProvider of the form '<full path to src file>|line|column|offset'
+ * 
  * @author Mik Kersten
  */
 public class FullPathHandleProvider implements IElementHandleProvider {
@@ -70,4 +73,18 @@ public class FullPathHandleProvider implements IElementHandleProvider {
         st.nextToken(); // skip over the column
         return new Integer(st.nextToken()).intValue();
        }
+
+       public String createHandleIdentifier(IProgramElement ipe) {
+               if (ipe.getHandleIdentifier(false) != null) {
+                       return ipe.getHandleIdentifier(false);
+               }
+               String handle = null;  
+               if (ipe.getSourceLocation() != null) {
+                       handle = createHandleIdentifier(ipe.getSourceLocation());
+               } else {
+                       handle = createHandleIdentifier(ISourceLocation.NO_FILE,-1,-1,-1);
+               }
+               ipe.setHandleIdentifier(handle);
+               return handle;
+       }
 }
index 39013169d69d671e476dc7cdb03e72cdac1b22ab..e7b36424166d5a52d5d753b9e5c19a0e7ea0db88 100644 (file)
@@ -21,10 +21,11 @@ import java.util.StringTokenizer;
 
 import org.aspectj.asm.AsmManager;
 import org.aspectj.asm.IElementHandleProvider;
+import org.aspectj.asm.IProgramElement;
 import org.aspectj.bridge.ISourceLocation;
 
 /**
- * Not currently used - uses int keys rather than the full file path as the first part of the handle.
+ * Uses int keys rather than the full file path as the first part of the handle.
  */
 public class OptimizedFullPathHandleProvider implements IElementHandleProvider {
 
@@ -96,4 +97,18 @@ public class OptimizedFullPathHandleProvider implements IElementHandleProvider {
         st.nextToken(); // skip over the column
         return new Integer(st.nextToken()).intValue();
        }
+
+       public String createHandleIdentifier(IProgramElement ipe) {
+               if (ipe.getHandleIdentifier(false) != null) {
+                       return ipe.getHandleIdentifier(false);
+               }
+               String handle = null;  
+               if (ipe.getSourceLocation() != null) {
+                       handle = createHandleIdentifier(ipe.getSourceLocation());
+               } else {
+                       handle = createHandleIdentifier(ISourceLocation.NO_FILE,-1,-1,-1);
+               }
+               ipe.setHandleIdentifier(handle);
+               return handle;
+       }
 }
index af5a16960e69e4b05c738986f8e9f208676b00c2..7bf2b3e44eef5f090f49ba846b9e8ca166618c82 100644 (file)
@@ -493,19 +493,25 @@ public class ProgramElement implements IProgramElement {
        }
        
        public String getHandleIdentifier() {
-           if (null == handle) {
-                       if (sourceLocation != null) {
-                handle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(sourceLocation);
-//                         return genHandleIdentifier(sourceLocation);
-                       } 
-           }
-           return handle;
+               return getHandleIdentifier(true);
+       }
+       
+       public String getHandleIdentifier(boolean create) {
+               if (null == handle && create) {
+            handle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(this);                 
+               }
+               return handle;
+       }
+       
+       public void setHandleIdentifier(String handle) {
+               this.handle = handle;
        }
        
        public List getParameterNames() { 
                List parameterNames = (List)kvpairs.get("parameterNames");
                return parameterNames; 
        }
+       
        public void setParameterNames(List list) { 
                if (list==null || list.size()==0) return;
                if (kvpairs==Collections.EMPTY_MAP) kvpairs = new HashMap();
index 73ffafee39f590d9f3d70bbe3a90e5d597581747..b7f81415ff199a9962862700d4437ac0e80ea1cb 100644 (file)
@@ -15,6 +15,7 @@ package org.aspectj.ajdt.internal.compiler.lookup;
 //import java.io.IOException;
 
 import org.aspectj.asm.AsmManager;
+import org.aspectj.asm.IProgramElement;
 import org.aspectj.asm.IRelationship;
 import org.aspectj.asm.IRelationshipMap;
 import org.aspectj.weaver.ResolvedType;
@@ -48,17 +49,15 @@ public class AsmInterTypeRelationshipProvider {
        
                if (munger.getSourceLocation() != null
                        && munger.getSourceLocation() != null) {
-                       String sourceHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(
-                               munger.getSourceLocation().getSourceFile(),
-                               munger.getSourceLocation().getLine(),
-                               munger.getSourceLocation().getColumn(),
-                               munger.getSourceLocation().getOffset());
-                               
-                       String targetHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(
-                               onType.getSourceLocation().getSourceFile(),
-                               onType.getSourceLocation().getLine(),
-                               onType.getSourceLocation().getColumn(),
-                               onType.getSourceLocation().getOffset());
+                       IProgramElement sourceIPE = AsmManager.getDefault().getHierarchy()
+                               .findElementForSourceLine(munger.getSourceLocation());
+                       String sourceHandle = AsmManager.getDefault().getHandleProvider()
+                               .createHandleIdentifier(sourceIPE);
+                       
+                       IProgramElement targetIPE = AsmManager.getDefault().getHierarchy()
+                               .findElementForSourceLine(onType.getSourceLocation());
+                       String targetHandle = AsmManager.getDefault().getHandleProvider()
+                               .createHandleIdentifier(targetIPE);
                                
                        IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
                        if (sourceHandle != null && targetHandle != null) {
index 8d90795f599fa728a9720e58a8adbd80f04a56de..a65cfbf778119e40b05a585b97c08a754254eea2 100644 (file)
@@ -430,10 +430,18 @@ public class AsmHierarchyBuilder extends ASTVisitor {
             ReferencePointcut rp = (ReferencePointcut) it.next();
             ResolvedMember member = getPointcutDeclaration(rp, declaration);
             if (member != null) {
-                IRelationship foreward = AsmManager.getDefault().getRelationshipMap().get(peNode.getHandleIdentifier(), IRelationship.Kind.USES_POINTCUT, "uses pointcut", false, true);
-                foreward.addTarget(AsmManager.getDefault().getHandleProvider().createHandleIdentifier(member.getSourceLocation()));            
+                IRelationship foreward = AsmManager.getDefault().getRelationshipMap()
+                               .get(peNode.getHandleIdentifier(), 
+                                               IRelationship.Kind.USES_POINTCUT, "uses pointcut", false, true);
+                IProgramElement forwardIPE = AsmManager.getDefault().getHierarchy()
+                               .findElementForSourceLine(member.getSourceLocation());
+                foreward.addTarget(AsmManager.getDefault().getHandleProvider()
+                               .createHandleIdentifier(forwardIPE));            
                 
-                IRelationship back = AsmManager.getDefault().getRelationshipMap().get(AsmManager.getDefault().getHandleProvider().createHandleIdentifier(member.getSourceLocation()), IRelationship.Kind.USES_POINTCUT, "pointcut used by", false, true);
+                IRelationship back = AsmManager.getDefault().getRelationshipMap()
+                               .get(AsmManager.getDefault().getHandleProvider()
+                                               .createHandleIdentifier(forwardIPE), 
+                                               IRelationship.Kind.USES_POINTCUT, "pointcut used by", false, true);
                 back.addTarget(peNode.getHandleIdentifier());             
             } 
         }        
index 57ac60c9e630e49cff5a5ac3ba0f1d52a87e9384..f0a063c38d0bea3f8a271e31f3d0c28a9d50f4b6 100644 (file)
@@ -26,6 +26,7 @@ public class AbstractMultiProjectIncrementalAjdeInteractionTestbed extends
        protected void tearDown() throws Exception {
                super.tearDown();
                AjState.FORCE_INCREMENTAL_DURING_TESTING = false;
+               configureBuildStructureModel(false);
        }
 
        public void build(String projectName) {
index 7ea351930eb2552570df6fa391c4ded44b512203..033503e5354b964493e37e18e6a34a82f7462a56 100644 (file)
@@ -55,33 +55,25 @@ public class AsmRelationshipProvider {
                
                // Ensure a node for the target exists
                IProgramElement targetNode = getNode(AsmManager.getDefault().getHierarchy(), shadow);
-
-               String sourceHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(
-                       checker.getSourceLocation().getSourceFile(),
-                       checker.getSourceLocation().getLine(),
-                       checker.getSourceLocation().getColumn(),
-                       checker.getSourceLocation().getOffset());
-
+               IProgramElement sourceNode = AsmManager.getDefault().getHierarchy()
+                               .findElementForSourceLine(checker.getSourceLocation());
+               String sourceHandle = AsmManager.getDefault().getHandleProvider()
+                               .createHandleIdentifier(sourceNode);
+               String targetHandle = AsmManager.getDefault().getHandleProvider()
+                               .createHandleIdentifier(targetNode);
+                               
                if (World.createInjarHierarchy) {
                        checker.createHierarchy();
                }
 
-               String targetHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(
-                       shadow.getSourceLocation().getSourceFile(),
-                       shadow.getSourceLocation().getLine(),
-                       shadow.getSourceLocation().getColumn(),
-                       shadow.getSourceLocation().getOffset());
-
                IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
                if (sourceHandle != null && targetHandle != null) {
                        IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE, MATCHED_BY,false,true);
                        foreward.addTarget(targetHandle);
-//                     foreward.getTargets().add(targetHandle);
                                
                        IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE, MATCHES_DECLARE,false,true);
                        if (back != null && back.getTargets() != null) {
                                back.addTarget(sourceHandle);
-                               //back.getTargets().add(sourceHandle);   
                        }
                }
        }
@@ -95,25 +87,21 @@ public class AsmRelationshipProvider {
          if (!AsmManager.isCreatingModel()) return;
                String sourceHandle = "";
                if (munger.getSourceLocation()!=null && munger.getSourceLocation().getOffset()!=-1) {
-                       sourceHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(
-                                                                               munger.getSourceLocation().getSourceFile(),
-                                                                               munger.getSourceLocation().getLine(),
-                                                                               munger.getSourceLocation().getColumn(),
-                                                                               munger.getSourceLocation().getOffset());
+                       IProgramElement sourceNode = AsmManager.getDefault().getHierarchy()
+                                       .findElementForSourceLine(munger.getSourceLocation());
+                       sourceHandle = AsmManager.getDefault().getHandleProvider()
+                                       .createHandleIdentifier(sourceNode);
                } else {
-                       sourceHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(
-                                                       originatingAspect.getSourceLocation().getSourceFile(),
-                                                       originatingAspect.getSourceLocation().getLine(),
-                                                       originatingAspect.getSourceLocation().getColumn(),
-                                                       originatingAspect.getSourceLocation().getOffset());
+                       IProgramElement sourceNode = AsmManager.getDefault().getHierarchy()
+                                       .findElementForSourceLine(originatingAspect.getSourceLocation());
+                       sourceHandle = AsmManager.getDefault().getHandleProvider()
+                                       .createHandleIdentifier(sourceNode);
                }
                if (originatingAspect.getSourceLocation() != null) {
-                               
-                       String targetHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(
-                               onType.getSourceLocation().getSourceFile(),
-                               onType.getSourceLocation().getLine(),
-                               onType.getSourceLocation().getColumn(),
-                               onType.getSourceLocation().getOffset());
+                       IProgramElement targetNode = AsmManager.getDefault().getHierarchy()
+                                       .findElementForSourceLine(onType.getSourceLocation());
+                       String targetHandle = AsmManager.getDefault().getHandleProvider()
+                                       .createHandleIdentifier(targetNode);
                                
                        IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
                        if (sourceHandle != null && targetHandle != null) {
@@ -131,17 +119,15 @@ public class AsmRelationshipProvider {
        public void addDeclareParentsRelationship(ISourceLocation decp,ResolvedType targetType, List newParents) {
            if (!AsmManager.isCreatingModel()) return;
 
-               String sourceHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(decp.getSourceFile(),decp.getLine(),decp.getColumn(),decp.getOffset());
-               
-               IProgramElement ipe = AsmManager.getDefault().getHierarchy().findElementForHandle(sourceHandle);
+               IProgramElement sourceNode = AsmManager.getDefault().getHierarchy()
+                               .findElementForSourceLine(decp);
+               String sourceHandle = AsmManager.getDefault().getHandleProvider()
+                               .createHandleIdentifier(sourceNode);
+               IProgramElement targetNode = AsmManager.getDefault().getHierarchy()
+                               .findElementForSourceLine(targetType.getSourceLocation());
+               String targetHandle = AsmManager.getDefault().getHandleProvider()
+                               .createHandleIdentifier(targetNode);
                
-       
-               String targetHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(
-                               targetType.getSourceLocation().getSourceFile(),
-                               targetType.getSourceLocation().getLine(),
-                               targetType.getSourceLocation().getColumn(),
-                               targetType.getSourceLocation().getOffset());
-                               
                IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
                if (sourceHandle != null && targetHandle != null) {
                        IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, INTER_TYPE_DECLARES,false,true);
@@ -159,15 +145,16 @@ public class AsmRelationshipProvider {
         */
        public void addDeclareAnnotationRelationship(ISourceLocation declareAnnotationLocation,ISourceLocation annotatedLocation) {
            if (!AsmManager.isCreatingModel()) return;
-               String sourceHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(declareAnnotationLocation.getSourceFile(),declareAnnotationLocation.getLine(),
-                                                                                                                                       declareAnnotationLocation.getColumn(),declareAnnotationLocation.getOffset());
-               IProgramElement declareAnnotationPE = AsmManager.getDefault().getHierarchy().findElementForHandle(sourceHandle);
-               
-               String targetHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(
-                               annotatedLocation.getSourceFile(),
-                               annotatedLocation.getLine(),
-                               annotatedLocation.getColumn(),
-                               annotatedLocation.getOffset());
+           
+           IProgramElement sourceNode = AsmManager.getDefault().getHierarchy()
+                       .findElementForSourceLine(declareAnnotationLocation);
+           String sourceHandle = AsmManager.getDefault().getHandleProvider()
+                       .createHandleIdentifier(sourceNode);
+
+           IProgramElement targetNode = AsmManager.getDefault().getHierarchy()
+                               .findElementForSourceLine(annotatedLocation);
+           String targetHandle = AsmManager.getDefault().getHandleProvider()
+                               .createHandleIdentifier(targetNode);
                                
                IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
                if (sourceHandle != null && targetHandle != null) {
@@ -205,7 +192,9 @@ public class AsmRelationshipProvider {
                        AdviceKind ak = ((Advice)munger).getKind();
                        ai.setExtraAdviceInformation(ak.getName());
                        IProgramElement adviceElement = AsmManager.getDefault().getHierarchy().findElementForHandle(adviceHandle);
-                       adviceElement.setExtraInfo(ai);         
+                       if (adviceElement != null) {
+                               adviceElement.setExtraInfo(ai); 
+                       }
                        
                        if (adviceHandle != null && targetNode != null) {
                
@@ -392,9 +381,9 @@ public class AsmRelationshipProvider {
          if (methodElem == null) return;
          
          try {
-           String sourceHandle = 
-            AsmManager.getDefault().getHandleProvider().createHandleIdentifier(sourceLocation.getSourceFile(),sourceLocation.getLine(),
-                       sourceLocation.getColumn(),sourceLocation.getOffset());
+                 
+                 IProgramElement sourceNode = AsmManager.getDefault().getHierarchy().findElementForSourceLine(sourceLocation);
+                 String sourceHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(sourceNode);
                                
            String targetHandle = methodElem.getHandleIdentifier();
            IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
@@ -433,9 +422,8 @@ public class AsmRelationshipProvider {
         IProgramElement fieldElem = AsmManager.getDefault().getHierarchy().findElementForSignature(typeElem,IProgramElement.Kind.FIELD,field.getName());
         if (fieldElem== null) return;
 
-               String sourceHandle = 
-            AsmManager.getDefault().getHandleProvider().createHandleIdentifier(sourceLocation.getSourceFile(),sourceLocation.getLine(),
-                       sourceLocation.getColumn(),sourceLocation.getOffset());
+                 IProgramElement sourceNode = AsmManager.getDefault().getHierarchy().findElementForSourceLine(sourceLocation);
+                 String sourceHandle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(sourceNode);
                        
                String targetHandle = fieldElem.getHandleIdentifier();
                
index 6e045e83b0de148e826f65d5f7341eaf0a81289a..df21a4a82d0b5f5680e4bc3c80392c25ef26ea2f 100644 (file)
@@ -101,11 +101,8 @@ public abstract class ShadowMunger implements PartialOrder.PartialComparable, IH
                                if (World.createInjarHierarchy) {
                                        createHierarchy();
                                } 
-                               handle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(
-                                           sl.getSourceFile(),
-                                           sl.getLine(),
-                                           sl.getColumn(),
-                                                       sl.getOffset());                                        
+                               IProgramElement ipe = AsmManager.getDefault().getHierarchy().findElementForSourceLine(sl);
+                               handle = AsmManager.getDefault().getHandleProvider().createHandleIdentifier(ipe);
                        }
                }
                return handle;