Changeset 137

Show
Ignore:
Timestamp:
09/24/08 07:00:33 (3 months ago)
Author:
mb0
Message:

NEW - # 110: log exceptions
http://axdt.org/ticket/110
ASSIGNED - # 108: Cannot compile swf file with AXDT
http://axdt.org/ticket/108

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • axdt/trunk/org.axdt.as3.debug/src/org/axdt/as3/debug/AS3DebugPlugin.java

    r92 r137  
    66import org.eclipse.core.runtime.IPath; 
    77import org.eclipse.core.runtime.Path; 
     8import org.eclipse.core.runtime.Status; 
    89import org.eclipse.core.runtime.preferences.ConfigurationScope; 
    910import org.eclipse.core.runtime.preferences.IScopeContext; 
     
    7576                return null; 
    7677        } 
     78 
     79        public void log(String msg) { 
     80                log(msg, null); 
     81        } 
     82 
     83        public void log(String msg, Exception e) { 
     84                getLog().log(new Status(Status.ERROR, PLUGIN_ID, Status.OK, msg, e)); 
     85        } 
    7786} 
  • axdt/trunk/org.axdt.as3.debug/src/org/axdt/as3/debug/launcher/AS3LauncherDelegate.java

    r122 r137  
    55import org.axdt.as3.compiler.AS3Compiler; 
    66import org.axdt.as3.compiler.AS3CompilerTarget; 
     7import org.axdt.as3.debug.AS3DebugPlugin; 
    78import org.axdt.as3.debug.IAS3DebugConstants; 
    89import org.axdt.as3.debug.preferences.AS3DebugPreferences; 
     
    8990                                } 
    9091                        } catch (Exception e) { 
    91                                 e.printStackTrace(); 
     92                                AS3DebugPlugin.getDefault().log("Error compiling swf", e); 
    9293                        } 
    9394                        return new Status(IStatus.OK, "org.axdt.as3.debug", "launching is done"); 
     
    120121                                                } 
    121122                                        } catch (Exception e) { 
    122                                                 e.printStackTrace(); 
     123                                                AS3DebugPlugin.getDefault().log("Error opening swf", e); 
    123124                                        } 
    124125                                        ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); 
     
    209210        } 
    210211 
     212        @SuppressWarnings("unchecked") 
    211213        public Object getAdapter(Class adapter) { 
    212214                return null; 
  • axdt/trunk/org.axdt.as3.debug/src/org/axdt/as3/debug/launcher/AS3LauncherShortcut.java

    r92 r137  
    11package org.axdt.as3.debug.launcher; 
    22 
     3import org.axdt.as3.debug.AS3DebugPlugin; 
    34import org.axdt.as3.debug.IAS3DebugConstants; 
    45import org.axdt.launcher.AbstractLauncherShortcut; 
     
    4647                        return workingCopy.doSave(); 
    4748                } catch (Exception e) { 
    48                         e.printStackTrace(); 
     49                        AS3DebugPlugin.getDefault().log("Error creating launch configuration", e); 
    4950                } 
    5051                return null; 
  • axdt/trunk/org.axdt.as3/src/org/axdt/as3/AS3Plugin.java

    r120 r137  
    88import org.eclipse.core.runtime.IPath; 
    99import org.eclipse.core.runtime.Path; 
     10import org.eclipse.core.runtime.Status; 
    1011import org.eclipse.core.runtime.preferences.ConfigurationScope; 
    1112import org.eclipse.core.runtime.preferences.IScopeContext; 
     
    8081                                templateStore.load(); 
    8182                        } catch (IOException e) { 
    82                                 e.printStackTrace(); 
     83                                AS3Plugin.getDefault().log("Error loading AXDT template store", e); 
    8384                        } 
    8485                } 
     
    124125                return null; 
    125126        } 
     127 
     128        public void log(String msg) { 
     129                log(msg, null); 
     130        } 
     131 
     132        public void log(String msg, Exception e) { 
     133                getLog().log(new Status(Status.ERROR, PLUGIN_ID, Status.OK, msg, e)); 
     134        } 
    126135} 
  • axdt/trunk/org.axdt.as3/src/org/axdt/as3/compiler/AS3Compiler.java

    r92 r137  
    4848                                                return (IAxdtCompiler) c.createExecutableExtension("class"); 
    4949                                } catch (Exception e) { 
    50                                         e.printStackTrace(); 
     50                                        AS3Plugin.getDefault().log("Error creating AXDT compiler", e); 
    5151                                } 
    5252                        } 
     
    6666                return getActualCompiler().compile(target, monitor); 
    6767        } 
    68  
    6968} 
  • axdt/trunk/org.axdt.as3/src/org/axdt/as3/imp/autoEdit/AS3AutoEditStrategy.java

    r119 r137  
    11package org.axdt.as3.imp.autoEdit; 
    22 
     3import org.axdt.as3.AS3Plugin; 
    34import org.axdt.as3.preferences.AS3Preferences; 
    45import org.axdt.util.AxdtTextHelper; 
     
    7172                        } 
    7273                } catch (BadLocationException e) { 
    73                         e.printStackTrace(); 
     74                        AS3Plugin.getDefault().log("Error deleting closing pair", e); 
    7475                } 
    7576        } 
     
    128129                        } 
    129130                } catch (BadLocationException e) { 
    130                         e.printStackTrace(); 
     131                        AS3Plugin.getDefault().log("Error scanning for closing pair", e); 
    131132                } 
    132133        } 
  • axdt/trunk/org.axdt.as3/src/org/axdt/as3/imp/foldingUpdater/AS3FoldingUpdater.java

    r96 r137  
    6868        private void makeAdjunctAnnotations(ASTNode theAST) { 
    6969                IPrsStream prsStream = theAST.getLeftIToken().getPrsStream(); 
    70                 ArrayList adjuncts = prsStream.getAdjuncts(); 
     70                ArrayList<?> adjuncts = prsStream.getAdjuncts(); 
    7171                for (int i = 0; i < adjuncts.size();) { 
    7272                        Adjunct adjunct = (Adjunct) adjuncts.get(i); 
     
    7878        } 
    7979 
    80         public void sendVisitorToAST(HashMap newAnnotations, List annotations, Object ast) { 
     80        public void sendVisitorToAST(HashMap<Annotation, Position> newAnnotations, List<Annotation> annotations, Object ast) { 
    8181                ASTNode theAST = (ASTNode) ast; 
    8282                theAST.accept(new FoldingVisitor()); 
  • axdt/trunk/org.axdt.as3/src/org/axdt/as3/imp/hoverHelper/AS3HoverHelper.java

    r92 r137  
    1717import org.eclipse.jface.text.source.ISourceViewer; 
    1818 
     19import org.axdt.as3.AS3Plugin; 
    1920import org.axdt.as3.imp.parser.Ast.*; 
    2021 
     
    7071                                        fResolver = ServiceFactory.getInstance().getReferenceResolver(fLanguage); 
    7172                                } catch (Exception e) { 
    72                                         System.err 
    73                                                         .println("Exception getting Reference Resolver service from service factory"); 
    74                                         e.printStackTrace(); 
     73                                        AS3Plugin.getDefault().log("Exception getting Reference Resolver service from service factory", e); 
    7574                                        fResolver = null; 
    7675                                } 
     
    9998 
    10099                        } catch (Exception e) { 
    101                                 System.err 
    102                                                 .println("Exception getting Documentation Provider Service from service factory"); 
    103                                 e.printStackTrace(); 
     100                                AS3Plugin.getDefault().log("Exception getting Documentation Provider Service from service factory", e); 
    104101                                fResolver = null; 
    105102                        } 
  • axdt/trunk/org.axdt.as3/src/org/axdt/as3/wizards/NewAs3Wizard.java

    r98 r137  
    149149                } catch (Exception e1) { 
    150150                        contents = "package " + packageName + "{\n\t// template error \n}"; 
    151                         e1.printStackTrace(); 
     151                        AS3Plugin.getDefault().log("Error loading template", e1); 
    152152                } 
    153153                return new ByteArrayInputStream(contents.getBytes()); 
  • axdt/trunk/org.axdt.as3/src/org/axdt/as3/wizards/NewProjectWizard.java

    r92 r137  
    33import java.lang.reflect.InvocationTargetException; 
    44 
     5import org.axdt.as3.AS3Plugin; 
    56import org.axdt.as3.imp.builders.AS3Nature; 
    67import org.axdt.as3.preferences.AS3Preferences; 
     
    1617import org.eclipse.core.runtime.IPath; 
    1718import org.eclipse.core.runtime.IProgressMonitor; 
    18 import org.eclipse.jface.dialogs.MessageDialog; 
    1919import org.eclipse.jface.operation.IRunnableWithProgress; 
    2020import org.eclipse.jface.viewers.IStructuredSelection; 
     
    8484                        return false; 
    8585                } catch (InvocationTargetException e) { 
    86                         Throwable realException = e.getTargetException(); 
    87                         realException.printStackTrace(); 
    88                         MessageDialog.openError(getShell(), "Error", realException.getMessage()); 
     86                        AS3Plugin.getDefault().log("Error finishing axdt project creation", e); 
    8987                        return false; 
    9088                } 
  • axdt/trunk/org.axdt.common/src/org/axdt/common/AxdtPlugin.java

    r92 r137  
    55import org.eclipse.core.runtime.FileLocator; 
    66import org.eclipse.core.runtime.Path; 
     7import org.eclipse.core.runtime.Status; 
    78import org.eclipse.core.runtime.preferences.ConfigurationScope; 
    89import org.eclipse.core.runtime.preferences.IScopeContext; 
     
    7374                if (url != null) reg.put(AXDT_ICON, ImageDescriptor.createFromURL(url)); 
    7475        } 
     76 
     77        public void log(String msg) { 
     78                log(msg, null); 
     79        } 
     80 
     81        public void log(String msg, Exception e) { 
     82                getLog().log(new Status(Status.ERROR, PLUGIN_ID, Status.OK, msg, e)); 
     83        } 
    7584} 
  • axdt/trunk/org.axdt.flex3sdk.compiler/src/org/axdt/flex3sdk/Flex3Console.java

    r104 r137  
    8383                                                addHyperlink((IHyperlink) link[0], (Integer) link[1], (Integer) link[2]); 
    8484                                        } catch (Exception e) { 
    85                                                 e.printStackTrace(); 
     85                                                Flex3SDKPlugin.getDefault().log("error adding hyperlink to flex compiler console", e); 
    8686                                        } 
    8787                                } 
     
    111111                        stream.close(); 
    112112                } catch (IOException e) { 
    113                         e.printStackTrace(); 
     113                        Flex3SDKPlugin.getDefault().log("error closing flex compiler console stream", e); 
    114114                } 
    115115        } 
     
    128128                                addHyperlink(hyperlink, event.getOffset(), event.getLength()); 
    129129                        } catch (BadLocationException e) { 
    130                                 e.printStackTrace(); 
     130                                Flex3SDKPlugin.getDefault().log("error matching error code", e); 
    131131                        } 
    132132                } 
     
    143143 
    144144                public String getPattern() { 
    145                         return "'" + rootLoc.toOSString() + "[^']*'"; 
     145                        return "'" + rootLoc.toOSString().replace("\\", "\\\\") + "[^']*'"; 
    146146                } 
    147147 
     
    152152                                if (string != null) { 
    153153                                        String[] split = string.split(":"); 
     154                                        // do we have a sane path ? 
     155                                        if (split[0].length() == 1) { 
     156                                                // no we have a windows path 
     157                                                split = new String[] { 
     158                                                        split[0] + ":" + split[1], 
     159                                                        split[2], split[3] 
     160                                                }; 
     161                                        } 
    154162                                        IPath path = new Path(split[0]); 
    155163                                        path = path.removeFirstSegments(rootLoc.matchingFirstSegments(path)); 
     
    161169                                } 
    162170                        } catch (Exception e) { 
    163                                 e.printStackTrace(); 
     171                                Flex3SDKPlugin.getDefault().log("error matching worspace path", e); 
    164172                        } 
    165173                } 
  • axdt/trunk/org.axdt.flex3sdk/src/org/axdt/flex3sdk/Flex3SDKPlugin.java

    r92 r137  
    77import org.eclipse.core.runtime.IPath; 
    88import org.eclipse.core.runtime.Platform; 
     9import org.eclipse.core.runtime.Status; 
    910import org.eclipse.core.runtime.preferences.ConfigurationScope; 
    1011import org.eclipse.core.runtime.preferences.IScopeContext; 
     
    7576                        return FileLocator.resolve(urls[0]); 
    7677                } catch (IOException e) { 
    77                         e.printStackTrace(); 
     78                        getDefault().log("Error resolving flex sdk bundle url", e); 
    7879                } 
    7980                return null; 
     
    8384                return imageDescriptorFromPlugin(PLUGIN_ID, path); 
    8485        } 
     86 
     87        public void log(String msg) { 
     88                log(msg, null); 
     89        } 
     90 
     91        public void log(String msg, Exception e) { 
     92                getLog().log(new Status(Status.ERROR, PLUGIN_ID, Status.OK, msg, e)); 
     93        } 
    8594} 
  • axdt/trunk/org.axdt.mxml/src/org/axdt/mxml/MxmlPlugin.java

    r136 r137  
    77import org.eclipse.core.runtime.Path; 
    88import org.eclipse.core.runtime.Platform; 
     9import org.eclipse.core.runtime.Status; 
    910import org.eclipse.core.runtime.preferences.ConfigurationScope; 
    1011import org.eclipse.core.runtime.preferences.IScopeContext; 
     
    8889                        return FileLocator.resolve(urls[0]); 
    8990                } catch (IOException e) { 
    90                         e.printStackTrace(); 
     91                        getDefault().log("error resolving bundle url", e); 
    9192                } 
    9293                return null; 
    9394        } 
     95 
     96        public void log(String msg) { 
     97                log(msg, null); 
     98        } 
     99 
     100        public void log(String msg, Exception e) { 
     101                getLog().log(new Status(Status.ERROR, PLUGIN_ID, Status.OK, msg, e)); 
     102        } 
    94103} 
  • axdt/trunk/org.axdt.navigator/src/org/axdt/navigator/AxdtNavigatorPlugin.java

    r92 r137  
    11package org.axdt.navigator; 
    22 
     3import org.eclipse.core.runtime.Status; 
    34import org.eclipse.core.runtime.preferences.ConfigurationScope; 
    45import org.eclipse.core.runtime.preferences.IScopeContext; 
     
    6566                return imageDescriptorFromPlugin(PLUGIN_ID, path); 
    6667        } 
     68 
     69        public void log(String msg) { 
     70                log(msg, null); 
     71        } 
     72 
     73        public void log(String msg, Exception e) { 
     74                getLog().log(new Status(Status.ERROR, PLUGIN_ID, Status.OK, msg, e)); 
     75        } 
    6776} 
  • axdt/trunk/org.axdt.swfview/src/org/axdt/swfview/SWFViewEditor.java

    r103 r137  
    103103                                        }); 
    104104                                } catch (Exception e) { 
    105                                         // TODO: handle exception 
    106                                         e.printStackTrace(); 
     105                                        SWFViewPlugin.getDefault().log("error handling resource change", e); 
    107106                                } 
    108107                        } 
  • axdt/trunk/org.axdt.swfview/src/org/axdt/swfview/SWFViewPlugin.java

    r92 r137  
    11package org.axdt.swfview; 
    22 
     3import org.eclipse.core.runtime.Status; 
    34import org.eclipse.core.runtime.preferences.ConfigurationScope; 
    45import org.eclipse.core.runtime.preferences.IScopeContext; 
     
    6566                return imageDescriptorFromPlugin(PLUGIN_ID, path); 
    6667        } 
     68 
     69        public void log(String msg) { 
     70                log(msg, null); 
     71        } 
     72 
     73        public void log(String msg, Exception e) { 
     74                getLog().log(new Status(Status.ERROR, PLUGIN_ID, Status.OK, msg, e)); 
     75        } 
    6776}