Revision: 3401
          http://vexi.svn.sourceforge.net/vexi/?rev=3401&view=rev
Author:   mkpg2
Date:     2009-03-05 01:19:54 +0000 (Thu, 05 Mar 2009)

Log Message:
-----------
Fix. Exn was being thrown when discovering path of file, if library on the path.

Modified Paths:
--------------
    trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/VexidevUtils.java
    
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/ui/LaunchShortcut.java

Modified: trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/VexidevUtils.java
===================================================================
--- trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/VexidevUtils.java 
2009-03-04 19:38:52 UTC (rev 3400)
+++ trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/VexidevUtils.java 
2009-03-05 01:19:54 UTC (rev 3401)
@@ -172,26 +172,12 @@
                IProject proj = resource.getProject();
                VexiProject vproj = (VexiProject) 
proj.getAdapter(VexiProject.class);
                
-               /*
-               Set<IResource> srcPath = new HashSet(vproj.sources.getPath());
-               
-               for(IResource parent = file; parent!=null; 
parent=parent.getParent()){
-                       if(srcPath.contains(parent)){
-                               int segmentsSrc = 
parent.getProjectRelativePath().segmentCount();
-                               IPath templatePath = 
resource.getProjectRelativePath().removeFirstSegments(segmentsSrc);
-                               String template = 
templatePath.removeFileExtension().toString().replace('/', '.');
-                               return
-                               conf.setAttribute(P_LAUNCH_MAINTEMPLATE, 
template);
-                               break;
-                       }
-               }*/
-               
                List sourcePath = vproj.sources.getPath();
                for(int i=0; i<sourcePath.size(); i++){
                        Object dir = sourcePath.get(i);
                        if(dir instanceof IProject){
                                return getVexiPath(new Path("/"), 
resource.getProjectRelativePath());
-                       }else{ // dir instanceof IFolder
+                       }else if(dir instanceof IFolder){
                                IFolder folder = (IFolder)dir;
                                IContainer parent = resource.getParent();
                                while(parent!=null){
@@ -199,7 +185,8 @@
                                                return 
getVexiPath(folder.getFullPath(), resource.getFullPath());
                                        parent = parent.getParent();
                                }       
-
+                       }else{
+                               // String => a library, resource cannot be from 
a library
                        }
                        
                }

Modified: 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/ui/LaunchShortcut.java
===================================================================
--- 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/ui/LaunchShortcut.java  
    2009-03-04 19:38:52 UTC (rev 3400)
+++ 
trunk/tools/org.vexi.vexidev/src/org/vexi/vexidev/debug/ui/LaunchShortcut.java  
    2009-03-05 01:19:54 UTC (rev 3401)
@@ -91,21 +91,22 @@
        
        
        public ILaunchConfiguration createDefaultLaunchConfiguration(IFile 
file) {
-               ILaunchManager manager = 
org.eclipse.debug.core.DebugPlugin.getDefault().getLaunchManager();
-               ILaunchConfigurationType type = 
manager.getLaunchConfigurationType(getLaunchConfigId());
-               if (type == null) {
-                       reportError("Vexi launch configuration 
'"+getLaunchConfigId()+"' not found", null);
-                       return null;
-               }
-               
-               String mainTemplate = getVexiPathOfFile(file);
-               StringBuffer buffer = new 
StringBuffer(file.getProject().getName());
-               buffer.append(" ");
-               buffer.append(mainTemplate);
-               String name = buffer.toString().trim();
-               name= manager.generateUniqueLaunchConfigurationNameFrom(name);
                try {
+                       ILaunchManager manager = 
org.eclipse.debug.core.DebugPlugin.getDefault().getLaunchManager();
+                       ILaunchConfigurationType type = 
manager.getLaunchConfigurationType(getLaunchConfigId());
+                       if (type == null) {
+                               reportError("Vexi launch configuration 
'"+getLaunchConfigId()+"' not found", null);
+                               return null;
+                       }
 
+                       String mainTemplate = getVexiPathOfFile(file);
+                       StringBuffer buffer = new 
StringBuffer(file.getProject().getName());
+                       buffer.append(" ");
+                       buffer.append(mainTemplate);
+                       String name = buffer.toString().trim();
+                       name= 
manager.generateUniqueLaunchConfigurationNameFrom(name);
+
+
                        ILaunchConfigurationWorkingCopy workingCopy = 
type.newInstance(null, name);
                        LaunchTab.initLaunchConfig(workingCopy, file, 
isVunit());
                        return workingCopy;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to