[Tmf][Ctf] Add descriptive fail to import messages.
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Thu, 18 Apr 2013 17:35:48 +0000 (13:35 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Mon, 22 Apr 2013 22:13:35 +0000 (18:13 -0400)
This patch proposes a way of showing more error details.
The ctf modifications use reflexion since the parser and lexer are
auto-generated. Now with number format exceptions for ints
Messages.java now have suppress warnings javadoc

Change-Id: I74cbbd4aaff29f458786ffc96e88b5416b49beed
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/11788

34 files changed:
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/CTFReaderException.java
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/ctf/core/trace/Metadata.java
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/metadata/IOStructGen.java
org.eclipse.linuxtools.ctf.core/src/org/eclipse/linuxtools/internal/ctf/core/event/metadata/exceptions/ParseException.java
org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/Activator.java [new file with mode: 0644]
org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/trace/GdbTrace.java
org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/trace/Messages.java [new file with mode: 0644]
org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/trace/messages.properties [new file with mode: 0644]
org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/CtfKernelTrace.java
org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/Messages.java [new file with mode: 0644]
org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/messages.properties [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfTraceTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfTraceTest.java
org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/Messages.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/TmfTraceStub.java
org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/messages.properties [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/Messages.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/messages.properties [new file with mode: 0644]
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTrace.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfExperiment.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtTrace.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomXmlTrace.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/Messages.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/messages.properties [new file with mode: 0644]
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/Messages.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/SelectTraceTypeHandler.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/project/handlers/messages.properties
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/Messages.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/Messages.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/model/Messages.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Messages.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/Messages.java

index c3499eaf68bbf8f7f60388ea4c284c8bc2ebf594..179829d2aa9c2d3e17f9559c1cb3d4704b041d5c 100644 (file)
@@ -7,20 +7,33 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors: Alexandre Montplaisir - Initial API and implementation
+ * Contributors: Matthew Khouzam - Addition to have more descriptive errors
  *******************************************************************************/
 
 package org.eclipse.linuxtools.ctf.core.trace;
 
+import java.lang.reflect.Field;
+
+import org.antlr.runtime.MismatchedTokenException;
+import org.antlr.runtime.RecognitionException;
+import org.eclipse.linuxtools.ctf.parser.CTFLexer;
+
 /**
  * General exception that is thrown when there is a problem somewhere with the
  * CTF trace reader.
- * 
+ *
  * @version 1.0
  * @author Alexandre Montplaisir
  */
 public class CTFReaderException extends Exception {
 
     private static final long serialVersionUID = 2065258365219777672L;
+    private int fErrorLine = -1;
+    private String fFile = ""; //$NON-NLS-1$
+    private String fExpectingName = ""; //$NON-NLS-1$
+    private int fExpectedValue = -1;
+    private String fActualName = ""; //$NON-NLS-1$
+    private int fActualValue = -1;
 
     /**
      * Default constructor with no message.
@@ -48,4 +61,80 @@ public class CTFReaderException extends Exception {
     public CTFReaderException(Exception e) {
         super(e);
     }
+
+    /**
+     * Re-throw the exception but read its data
+     *
+     * @param e
+     *            the previous recognition exception (Antlr specific)
+     * @since 2.0
+     */
+    public CTFReaderException(RecognitionException e) {
+        super(e);
+        this.fErrorLine = e.line;
+        this.fFile = "metadata"; //$NON-NLS-1$ // we're in CTF, the only thing using antlr is metadata
+    }
+
+    /**
+     * Re-throw the exception but read its data
+     *
+     * @param e
+     *            the previous recognition exception (Antlr specific)
+     * @since 2.0
+     */
+    public CTFReaderException(MismatchedTokenException e){
+        super(e);
+        this.fErrorLine = e.line;
+        this.fFile = "metadata"; //$NON-NLS-1$ // we're in CTF, the only thing using antlr is metadata
+        parseMismatchedException(e);
+    }
+
+    private void parseMismatchedException(MismatchedTokenException m) {
+        // Iterate through the tokens that are hidden in the CTFLexer
+        // They are private static final int fields.
+        for (Field f : CTFLexer.class.getDeclaredFields()) {
+            f.setAccessible(true);
+            String name;
+            int value;
+            try {
+                name = f.getName();
+                final boolean isInt = (f.getType().isPrimitive());
+                if (isInt) {
+                    value = ((Integer) f.get(null)).intValue();
+                    if (value == m.expecting) {
+                        this.fExpectingName = name;
+                        this.fExpectedValue = value;
+                    }
+                    if (value == m.c) {
+                        this.fActualName = name;
+                        this.fActualValue = value;
+                    }
+                }
+            } catch (NullPointerException e1) {
+                // Pokemon, gotta catch em all!
+                // actually useful since f may not have a
+                // value
+            } catch (IllegalArgumentException e1) {
+                // Catch these exceptions (reflexion)
+            } catch (IllegalAccessException e1) {
+                // Catch these exceptions (reflexion)
+            }
+            if (!this.fExpectingName.isEmpty() && !this.fActualName.isEmpty()) {
+                return;
+            }
+        }
+    }
+
+    @Override
+    public String getMessage() {
+        final String message = super.getMessage();
+        if (fErrorLine == -1) {
+            return message;
+        }
+        String expected = "" + this.fExpectedValue; //$NON-NLS-1$
+        String actual = "" + this.fActualValue; //$NON-NLS-1$
+        String newMessage = message.replaceAll(expected, this.fExpectingName);
+        newMessage = newMessage.replaceAll(actual, this.fActualName);
+        return newMessage + " at " + fFile + ":" + fErrorLine; //$NON-NLS-1$ //$NON-NLS-2$
+    }
 }
index 92e0129139576c8b211071b13da9628a30bdf792..27ca681d63be828d4c3e67c81b0d9a99f2ee895a 100644 (file)
@@ -27,6 +27,7 @@ import java.util.UUID;
 
 import org.antlr.runtime.ANTLRReaderStream;
 import org.antlr.runtime.CommonTokenStream;
+import org.antlr.runtime.MismatchedTokenException;
 import org.antlr.runtime.RecognitionException;
 import org.antlr.runtime.tree.CommonTree;
 import org.eclipse.linuxtools.ctf.parser.CTFLexer;
@@ -174,11 +175,9 @@ public class Metadata {
             tempException = new CTFReaderException(e);
         } catch (ParseException e) {
             tempException = new CTFReaderException(e);
+        } catch (MismatchedTokenException e) {
+            tempException = new CTFReaderException(e);
         } catch (RecognitionException e) {
-            /*
-             * We don't want to expose this ANTLR-specific exception type to the
-             * outside..
-             */
             tempException = new CTFReaderException(e);
         }
 
@@ -250,8 +249,7 @@ public class Metadata {
         try {
             metadataFileChannel.read(magicByteBuffer, 0);
         } catch (IOException e) {
-            throw new CTFReaderException(
-                    "Unable to read metadata file channel."); //$NON-NLS-1$
+            throw new CTFReaderException("Unable to read metadata file channel."); //$NON-NLS-1$
         }
 
         /* Get the first int from the file */
@@ -353,8 +351,7 @@ public class Metadata {
         try {
             metadataFileChannel.read(payloadByteBuffer);
         } catch (IOException e) {
-            throw new CTFReaderException(
-                    "Error reading metadata packet payload."); //$NON-NLS-1$
+            throw new CTFReaderException("Error reading metadata packet payload."); //$NON-NLS-1$
         }
         payloadByteBuffer.rewind();
 
index aa5a43fff8547d6930f4419fceab824cfaf37b6c..c6a1fb5fa8bca93e929f0c41c0bea0febe86157b 100644 (file)
@@ -35,6 +35,7 @@ import org.eclipse.linuxtools.ctf.core.event.types.SequenceDeclaration;
 import org.eclipse.linuxtools.ctf.core.event.types.StringDeclaration;
 import org.eclipse.linuxtools.ctf.core.event.types.StructDeclaration;
 import org.eclipse.linuxtools.ctf.core.event.types.VariantDeclaration;
+import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
 import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
 import org.eclipse.linuxtools.ctf.core.trace.Stream;
 import org.eclipse.linuxtools.ctf.parser.CTFParser;
@@ -2307,23 +2308,26 @@ public class IOStructGen {
      * @param unaryInteger
      *            An unary integer node.
      * @return The integer value.
+     * @throws CTFReaderException
      */
-    private static long parseUnaryInteger(CommonTree unaryInteger) {
+    private static long parseUnaryInteger(CommonTree unaryInteger) throws ParseException {
 
         List<CommonTree> children = unaryInteger.getChildren();
         CommonTree value = children.get(0);
         String strval = value.getText();
 
         long intval;
-
-        if (unaryInteger.getType() == CTFParser.UNARY_EXPRESSION_DEC) {
-            intval = Long.parseLong(strval, 10);
-        } else if (unaryInteger.getType() == CTFParser.UNARY_EXPRESSION_HEX) {
-            intval = Long.parseLong(strval, 0x10);
-        } else { /* unaryInteger.getType() == CTFParser.UNARY_EXPRESSION_OCT */
-            intval = Long.parseLong(strval, 010); // 010 == 0x08 == 8
+        try {
+            if (unaryInteger.getType() == CTFParser.UNARY_EXPRESSION_DEC) {
+                intval = Long.parseLong(strval, 10);
+            } else if (unaryInteger.getType() == CTFParser.UNARY_EXPRESSION_HEX) {
+                intval = Long.parseLong(strval, 0x10);
+            } else { /* unaryInteger.getType() == CTFParser.UNARY_EXPRESSION_OCT */
+                intval = Long.parseLong(strval, 010); // 010 == 0x08 == 8
+            }
+        } catch (NumberFormatException e) {
+            throw new ParseException(e);
         }
-
         /* The rest of children are sign */
         if ((children.size() % 2) == 0) {
             return -intval;
index 242f015143a2d7135b6c618f62b284e0947dc705..b365b87ca4558c2f0e19d834bf4d593cc6067e9d 100644 (file)
@@ -12,6 +12,7 @@
 
 package org.eclipse.linuxtools.internal.ctf.core.event.metadata.exceptions;
 
+
 /**
  * <b><u>ParseException</u></b>
  */
@@ -20,7 +21,7 @@ public class ParseException extends Exception {
     private static final long serialVersionUID = 7901917601459652080L;
 
     /**
-     * Enoty constructor
+     * Empty constructor
      */
     public ParseException() {
         super();
@@ -35,4 +36,11 @@ public class ParseException extends Exception {
         super(message);
     }
 
+    /**
+     * Copy constructor
+     * @param e the exception to throw
+     */
+    public ParseException(Exception e) {
+        super(e);
+    }
 }
diff --git a/org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/Activator.java b/org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/Activator.java
new file mode 100644 (file)
index 0000000..5052894
--- /dev/null
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.gdbtrace.core;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+
+/**
+ * The activator class controls the plug-in life cycle. No more than one such
+ * plug-in can exist at any time.
+ * <p>
+ * It also provides the plug-in's general logging facility and manages the
+ * internal tracer.
+ */
+public class Activator extends Plugin {
+
+    // ------------------------------------------------------------------------
+    // Attributes
+    // ------------------------------------------------------------------------
+
+    /**
+     * The plug-in ID
+     */
+    public static final String PLUGIN_ID = "org.eclipse.linuxtools.gdbtrace.core"; //$NON-NLS-1$
+
+    /**
+     * The shared instance
+     */
+    private static Activator fPlugin;
+
+    // ------------------------------------------------------------------------
+    // Constructors
+    // ------------------------------------------------------------------------
+
+    /**
+     * Constructor
+     */
+    public Activator() {
+        setDefault(this);
+    }
+
+    // ------------------------------------------------------------------------
+    // Accessors
+    // ------------------------------------------------------------------------
+
+    /**
+     * Returns the TMF Core plug-in instance.
+     *
+     * @return the TMF Core plug-in instance.
+     */
+    public static Activator getDefault() {
+        return fPlugin;
+    }
+
+    // Sets plug-in instance
+    private static void setDefault(Activator plugin) {
+        fPlugin = plugin;
+    }
+
+    // ------------------------------------------------------------------------
+    // Log INFO
+    // ------------------------------------------------------------------------
+
+    /**
+     * Logs a message with severity INFO in the runtime log of the plug-in.
+     *
+     * @param message A message to log
+     */
+    public static void logInfo(String message) {
+        fPlugin.getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message));
+    }
+
+    /**
+     * Logs a message and exception with severity INFO in the runtime log of the plug-in.
+     *
+     * @param message A message to log
+     * @param exception The corresponding exception
+     */
+    public static void logInfo(String message, Throwable exception) {
+        fPlugin.getLog().log(new Status(IStatus.INFO, PLUGIN_ID, message, exception));
+    }
+
+    // ------------------------------------------------------------------------
+    // Log WARNING
+    // ------------------------------------------------------------------------
+
+    /**
+     * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
+     *
+     * @param message A message to log
+     */
+    public static void logWarning(String message) {
+        fPlugin.getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message));
+    }
+
+    /**
+     * Logs a message and exception with severity WARNING in the runtime log of the plug-in.
+     *
+     * @param message A message to log
+     * @param exception The corresponding exception
+     */
+    public static void logWarning(String message, Throwable exception) {
+        fPlugin.getLog().log(new Status(IStatus.WARNING, PLUGIN_ID, message, exception));
+    }
+
+    // ------------------------------------------------------------------------
+    // Log ERROR
+    // ------------------------------------------------------------------------
+
+    /**
+     * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
+     *
+     * @param message A message to log
+     */
+    public static void logError(String message) {
+        fPlugin.getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message));
+    }
+
+    /**
+     * Logs a message and exception with severity ERROR in the runtime log of the plug-in.
+     *
+     * @param message A message to log
+     * @param exception The corresponding exception
+     */
+    public static void logError(String message, Throwable exception) {
+        fPlugin.getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, message, exception));
+    }
+
+}
index c234cf438d77b65e06de4c2c4c360273812652ad..9def9764dfbb1e5bf8ddfe3fdc91ad6febc5a58d 100644 (file)
@@ -10,6 +10,7 @@
  *   Marc Dumais - Initial implementation
  *   Francois Chouinard - Initial API and implementation
  *   Patrick Tasse - Updated for TMF 2.0
+ *   Matthew Khouzam - update validate
  *******************************************************************************/
 
 package org.eclipse.linuxtools.internal.gdbtrace.core.trace;
@@ -17,9 +18,12 @@ package org.eclipse.linuxtools.internal.gdbtrace.core.trace;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.linuxtools.internal.gdbtrace.core.GdbTraceCorePlugin;
 import org.eclipse.linuxtools.internal.gdbtrace.core.event.GdbTraceEvent;
+import org.eclipse.linuxtools.internal.gdbtrace.core.Activator;
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
@@ -31,12 +35,14 @@ import org.eclipse.linuxtools.tmf.core.trace.TmfLongLocation;
 import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
 
 /**
- * GDB Tracepoint extension of TmfTrace.  This class implements the necessary
- * methods and functionalities so that a GDB tracepoint file can be used by
- * the TMF framework as a "tracer".
+ * GDB Tracepoint extension of TmfTrace. This class implements the necessary
+ * methods and functionalities so that a GDB tracepoint file can be used by the
+ * TMF framework as a "tracer".
  * <p>
+ *
  * @author Marc Dumais
  * @author Francois Chouinard
+ * @author Matthew Khouzam
  */
 public class GdbTrace extends TmfTrace implements ITmfEventParser {
 
@@ -73,8 +79,11 @@ public class GdbTrace extends TmfTrace implements ITmfEventParser {
     }
 
     @Override
-    public boolean validate(IProject project, String path) {
-        return fileExists(path);
+    public IStatus validate(IProject project, String path) {
+        if (fileExists(path)) {
+            return Status.OK_STATUS;
+        }
+        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.GdbTrace_FileNotFound + ": " + path); //$NON-NLS-1$
     }
 
     @Override
@@ -104,15 +113,15 @@ public class GdbTrace extends TmfTrace implements ITmfEventParser {
     /**
      * @return GDB-DSF session id
      */
-    public String getDsfSessionId () {
+    public String getDsfSessionId() {
         return fGdbTpRef.getSessionId();
     }
 
     /**
      * @return the number of frames in current tp session
      */
-    public long getNbFrames () {
-        fNbFrames =  fGdbTpRef.getNumberOfFrames();
+    public long getNbFrames() {
+        fNbFrames = fGdbTpRef.getNumberOfFrames();
         return fNbFrames;
     }
 
@@ -150,7 +159,8 @@ public class GdbTrace extends TmfTrace implements ITmfEventParser {
         if (context.getRank() >= fNbFrames) {
             return null;
         }
-        // work-around to ensure that the select and parse of trace frame will be atomic
+        // work-around to ensure that the select and parse of trace frame will
+        // be atomic
         GdbTraceEvent event = fGdbTpRef.selectAndReadFrame(context.getRank());
         fLocation++;
         return event;
@@ -171,7 +181,9 @@ public class GdbTrace extends TmfTrace implements ITmfEventParser {
 
     /**
      * Select a frame and update the visualization
-     * @param rank the rank
+     *
+     * @param rank
+     *            the rank
      */
     public void selectFrame(long rank) {
         fGdbTpRef.selectDataFrame(rank, true);
diff --git a/org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/trace/Messages.java b/org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/trace/Messages.java
new file mode 100644 (file)
index 0000000..7de66b6
--- /dev/null
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.gdbtrace.core.trace;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ *
+ * @author Matthew Khouzam
+ *
+ */
+@SuppressWarnings("javadoc")
+public class Messages extends NLS {
+    private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.gdbtrace.core.trace.messages"; //$NON-NLS-1$
+    /**
+     * File not found
+     */
+    public static String GdbTrace_FileNotFound;
+    static {
+        // initialize resource bundle
+        NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+    }
+
+    private Messages() {
+    }
+}
diff --git a/org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/trace/messages.properties b/org.eclipse.linuxtools.gdbtrace.core/src/org/eclipse/linuxtools/internal/gdbtrace/core/trace/messages.properties
new file mode 100644 (file)
index 0000000..e2917d6
--- /dev/null
@@ -0,0 +1 @@
+GdbTrace_FileNotFound=File not found
index 2ea145c6a8489dea53b26c2464cd9bc09036c60c..072eef0ed357d64ad63ede67f46e401d8f104ef6 100644 (file)
@@ -8,6 +8,7 @@
  *
  * Contributors:
  *   Alexandre Montplaisir - Initial API and implementation
+ *   Matthew Khouzam - Improved validation
  ******************************************************************************/
 
 package org.eclipse.linuxtools.lttng2.kernel.core.trace;
@@ -17,8 +18,11 @@ import java.io.File;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
 import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
+import org.eclipse.linuxtools.internal.lttng2.kernel.core.Activator;
 import org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider.CtfKernelStateInput;
 import org.eclipse.linuxtools.tmf.core.TmfCommonConstants;
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfTrace;
@@ -54,9 +58,13 @@ public class CtfKernelTrace extends CtfTmfTrace {
         super();
     }
 
+    /**
+     * @since 2.0
+     */
     @Override
-    public boolean validate(final IProject project, final String path) {
+    public IStatus validate(final IProject project, final String path)  {
         CTFTrace temp;
+        IStatus validStatus;
         /*
          * Make sure the trace is openable as a CTF trace. We do this here
          * instead of calling super.validate() to keep the reference to "temp".
@@ -64,16 +72,21 @@ public class CtfKernelTrace extends CtfTmfTrace {
         try {
             temp = new CTFTrace(path);
         } catch (CTFReaderException e) {
-            return false;
+            validStatus = new Status(IStatus.ERROR,  Activator.PLUGIN_ID, e.toString(), e);
+            return validStatus;
+        } catch (NullPointerException e){
+            validStatus = new Status(IStatus.ERROR,  Activator.PLUGIN_ID, e.toString(), e);
+            return validStatus;
         }
 
         /* Make sure the domain is "kernel" in the trace's env vars */
         String dom = temp.getEnvironment().get("domain"); //$NON-NLS-1$
         temp.dispose();
         if (dom != null && dom.equals("\"kernel\"")) { //$NON-NLS-1$
-            return true;
+            return Status.OK_STATUS;
         }
-        return false;
+        validStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfKernelTrace_DomainError);
+        return validStatus;
     }
 
     @Override
diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/Messages.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/Messages.java
new file mode 100644 (file)
index 0000000..6734618
--- /dev/null
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.lttng2.kernel.core.trace;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Messages
+ *
+ * @author Matthew Khouzam
+ * @since 2.0
+ */
+@SuppressWarnings("javadoc")
+public class Messages extends NLS {
+    private static final String BUNDLE_NAME = "org.eclipse.linuxtools.lttng2.kernel.core.trace.messages"; //$NON-NLS-1$
+    /**
+     * The domain is not "kernel"
+     */
+    public static String CtfKernelTrace_DomainError;
+    static {
+        // initialize resource bundle
+        NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+    }
+
+    private Messages() {
+    }
+}
diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/messages.properties b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/messages.properties
new file mode 100644 (file)
index 0000000..2faa30e
--- /dev/null
@@ -0,0 +1 @@
+CtfKernelTrace_DomainError=Domain mismatch, make sure the environment is 'kernel'
index 3805bf6ed823a097f2335952d5e0edb53be41f90..82f8a4fd35d1f2ebf8bdb78cb3042de4c16aebb8 100644 (file)
@@ -21,6 +21,7 @@ import static org.junit.Assume.assumeTrue;
 
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocation;
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfLocationInfo;
 import org.eclipse.linuxtools.tmf.core.ctfadaptor.CtfTmfEvent;
@@ -348,12 +349,13 @@ public class CtfTmfTraceTest {
 
     /**
      * Run the boolean validate(IProject,String) method test.
+     * @throws TmfValidationException
      */
     @Test
     public void testValidate() {
         IProject project = null;
         String path = PATH;
-        boolean result = fixture.validate(project, path);
-        assertTrue(result);
+        IStatus result = fixture.validate(project, path);
+        assertTrue(result.isOK());
     }
 }
index 3a1ee1130d88e350e4d3480e2ac97d520d2f6f6e..496a6d0b1dbef488af2b1b9b48edc1d31e6ea58c 100644 (file)
@@ -397,7 +397,7 @@ public class TmfTraceTest {
         // Validate
         final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null);
         final File testfile = new File(FileLocator.toFileURL(location).toURI());
-        assertTrue("validate", trace.validate(null, testfile.getPath()));
+        assertTrue("validate", trace.validate(null, testfile.getPath()).isOK());
 
         // InitTrace and wait for indexing completion...
         trace.initTrace(null, testfile.toURI().getPath(), ITmfEvent.class);
diff --git a/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/Messages.java b/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/Messages.java
new file mode 100644 (file)
index 0000000..e03ebf7
--- /dev/null
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *   Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.tmf.tests.stubs.trace;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Matthew Khouzam
+ * @since 2.0
+ */
+@SuppressWarnings("javadoc")
+public class Messages extends NLS {
+    private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.tests.stubs.trace.messages"; //$NON-NLS-1$
+    /**
+     * File not found exception
+     */
+    public static String TmfTraceStub_FileNotFound;
+    static {
+        // initialize resource bundle
+        NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+    }
+
+    private Messages() {
+    }
+}
index c2acb599e9c454082577c94dd03793a93a41a760..3b762ed4136651fe740b9357e046431c5ebecb65 100644 (file)
@@ -20,6 +20,9 @@ import java.util.concurrent.locks.ReentrantLock;
 
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.linuxtools.internal.tmf.core.Activator;
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
@@ -90,7 +93,7 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
     public TmfTraceStub(final String path, final int cacheSize, final long interval) throws TmfTraceException {
         super(null, ITmfEvent.class, path, cacheSize, interval, null, null);
         try {
-            fTrace = new RandomAccessFile(path, "r");
+            fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
         } catch (FileNotFoundException e) {
             throw new TmfTraceException(e.getMessage());
         }
@@ -124,7 +127,7 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
     public TmfTraceStub(final String path, final int cacheSize, final boolean waitForCompletion) throws TmfTraceException {
         super(null, ITmfEvent.class, path, cacheSize, 0, null, null);
         try {
-            fTrace = new RandomAccessFile(path, "r");
+            fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
         } catch (FileNotFoundException e) {
             throw new TmfTraceException(e.getMessage());
         }
@@ -143,7 +146,7 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
     public TmfTraceStub(final IResource resource,  final String path, final int cacheSize, final boolean waitForCompletion) throws TmfTraceException {
         super(resource, ITmfEvent.class, path, cacheSize, 0, null, null);
         try {
-            fTrace = new RandomAccessFile(path, "r");
+            fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
         } catch (FileNotFoundException e) {
             throw new TmfTraceException(e.getMessage());
         }
@@ -161,7 +164,7 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
             final ITmfEventParser parser, final ITmfTraceIndexer indexer) throws TmfTraceException {
         super(null, ITmfEvent.class, path, cacheSize, 0, indexer, null);
         try {
-            fTrace = new RandomAccessFile(path, "r");
+            fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
         } catch (FileNotFoundException e) {
             throw new TmfTraceException(e.getMessage());
         }
@@ -174,7 +177,7 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
     public TmfTraceStub(final TmfTraceStub trace) throws TmfTraceException {
         super(trace);
         try {
-            fTrace = new RandomAccessFile(getPath(), "r");
+            fTrace = new RandomAccessFile(getPath(), "r"); //$NON-NLS-1$
         } catch (FileNotFoundException e) {
             throw new TmfTraceException(e.getMessage());
         }
@@ -188,7 +191,7 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
     @Override
     public void initTrace(final IResource resource, final String path, final Class<? extends ITmfEvent> type) throws TmfTraceException {
         try {
-            fTrace = new RandomAccessFile(path, "r");
+            fTrace = new RandomAccessFile(path, "r"); //$NON-NLS-1$
         } catch (FileNotFoundException e) {
             throw new TmfTraceException(e.getMessage());
         }
@@ -371,8 +374,11 @@ public class TmfTraceStub extends TmfTrace implements ITmfEventParser {
      * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#validate(org.eclipse.core.resources.IProject, java.lang.String)
      */
     @Override
-    public boolean validate(IProject project, String path) {
-        return fileExists(path);
+    public IStatus validate(IProject project, String path) {
+        if (fileExists(path)) {
+            return Status.OK_STATUS;
+        }
+        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TmfTraceStub_FileNotFound + ": " + path); //$NON-NLS-1$
     }
 
 }
diff --git a/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/messages.properties b/org.eclipse.linuxtools.tmf.core.tests/stubs/org/eclipse/linuxtools/tmf/tests/stubs/trace/messages.properties
new file mode 100644 (file)
index 0000000..2e07804
--- /dev/null
@@ -0,0 +1 @@
+TmfTraceStub_FileNotFound=File does not exist
index d81825d3a39f6830d5487758d024017505ee126e..c4263d0f419aff2a24c71a8585f8199d047eb76d 100644 (file)
@@ -15,8 +15,11 @@ package org.eclipse.linuxtools.tmf.core.ctfadaptor;
 
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.linuxtools.ctf.core.trace.CTFReaderException;
 import org.eclipse.linuxtools.ctf.core.trace.CTFTrace;
+import org.eclipse.linuxtools.internal.tmf.core.Activator;
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
 import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
@@ -34,27 +37,24 @@ import org.eclipse.linuxtools.tmf.core.trace.TmfTrace;
  */
 public class CtfTmfTrace extends TmfTrace implements ITmfEventParser {
 
-
-    //-------------------------------------------
-    //        Constants
-    //-------------------------------------------
+    // -------------------------------------------
+    // Constants
+    // -------------------------------------------
     /**
      * Default cache size for CTF traces
      */
     protected static final int DEFAULT_CACHE_SIZE = 50000;
 
-    //-------------------------------------------
-    //        Fields
-    //-------------------------------------------
+    // -------------------------------------------
+    // Fields
+    // -------------------------------------------
 
     /* Reference to the CTF Trace */
     private CTFTrace fTrace;
 
-
-
-    //-------------------------------------------
-    //        TmfTrace Overrides
-    //-------------------------------------------
+    // -------------------------------------------
+    // TmfTrace Overrides
+    // -------------------------------------------
     /**
      * Method initTrace.
      *
@@ -88,7 +88,7 @@ public class CtfTmfTrace extends TmfTrace implements ITmfEventParser {
             /* Set the start and (current) end times for this trace */
             ctx = (CtfTmfContext) seekEvent(0L);
             CtfTmfEvent event = getNext(ctx);
-            if((ctx.getLocation().equals(CtfIterator.NULL_LOCATION)) || (ctx.getCurrentEvent() == null)) {
+            if ((ctx.getLocation().equals(CtfIterator.NULL_LOCATION)) || (ctx.getCurrentEvent() == null)) {
                 /* Handle the case where the trace is empty */
                 this.setStartTime(TmfTimestamp.BIG_BANG);
             } else {
@@ -107,7 +107,9 @@ public class CtfTmfTrace extends TmfTrace implements ITmfEventParser {
         }
     }
 
-    /* (non-Javadoc)
+    /*
+     * (non-Javadoc)
+     *
      * @see org.eclipse.linuxtools.tmf.core.trace.TmfTrace#dispose()
      */
     @Override
@@ -122,26 +124,34 @@ public class CtfTmfTrace extends TmfTrace implements ITmfEventParser {
 
     /**
      * Method validate.
-     * @param project IProject
-     * @param path String
-     * @return boolean
+     *
+     * @param project
+     *            IProject
+     * @param path
+     *            String
+     * @return IStatus IStatus.error or Status.OK_STATUS
      * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#validate(IProject, String)
+     * @since 2.0
      */
     @Override
-    public boolean validate(final IProject project, final String path) {
+    public IStatus validate(final IProject project, final String path) {
+        IStatus validTrace = Status.OK_STATUS;
         try {
             final CTFTrace temp = new CTFTrace(path);
             boolean valid = temp.majortIsSet(); // random test
             temp.dispose();
-            return valid;
+            if (!valid) {
+                validTrace = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_MajorNotSet);
+            }
         } catch (final CTFReaderException e) {
-            /* Nope, not a CTF trace we can read */
-            return false;
+            validTrace = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CtfTmfTrace_ReadingError +": " + e.toString()); //$NON-NLS-1$
         }
+        return validTrace;
     }
 
     /**
      * Method getCurrentLocation. This is not applicable in CTF
+     *
      * @return null, since the trace has no knowledge of the current location
      * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getCurrentLocation()
      */
@@ -156,7 +166,7 @@ public class CtfTmfTrace extends TmfTrace implements ITmfEventParser {
         final CtfTmfContext context = new CtfTmfContext(this);
         context.setLocation(curLocation);
         context.seek(curLocation.getLocationInfo());
-        final CtfLocationInfo currentTime = ((CtfLocationInfo)context.getLocation().getLocationInfo());
+        final CtfLocationInfo currentTime = ((CtfLocationInfo) context.getLocation().getLocationInfo());
         final long startTime = getIterator(this, context).getStartTime();
         final long endTime = getIterator(this, context).getEndTime();
         return ((double) currentTime.getTimestamp() - startTime)
@@ -165,7 +175,9 @@ public class CtfTmfTrace extends TmfTrace implements ITmfEventParser {
 
     /**
      * Method seekEvent.
-     * @param location ITmfLocation<?>
+     *
+     * @param location
+     *            ITmfLocation<?>
      * @return ITmfContext
      */
     @Override
@@ -196,13 +208,12 @@ public class CtfTmfTrace extends TmfTrace implements ITmfEventParser {
                 currentLocation = new CtfLocation(event.getTimestamp().getValue(), 0);
             }
         }
-        if(context.getRank() != 0) {
+        if (context.getRank() != 0) {
             context.setRank(ITmfContext.UNKNOWN_RANK);
         }
         return context;
     }
 
-
     @Override
     public synchronized ITmfContext seekEvent(double ratio) {
         CtfTmfContext context = new CtfTmfContext(this);
@@ -222,7 +233,9 @@ public class CtfTmfTrace extends TmfTrace implements ITmfEventParser {
 
     /**
      * Method readNextEvent.
-     * @param context ITmfContext
+     *
+     * @param context
+     *            ITmfContext
      * @return CtfTmfEvent
      * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#getNext(ITmfContext)
      */
@@ -251,16 +264,16 @@ public class CtfTmfTrace extends TmfTrace implements ITmfEventParser {
 
     /**
      * gets the CTFtrace that this is wrapping
+     *
      * @return the CTF trace
      */
     public CTFTrace getCTFTrace() {
         return fTrace;
     }
 
-
-    //-------------------------------------------
-    //        Environment Parameters
-    //-------------------------------------------
+    // -------------------------------------------
+    // Environment Parameters
+    // -------------------------------------------
     /**
      * Method getNbEnvVars.
      *
@@ -291,24 +304,25 @@ public class CtfTmfTrace extends TmfTrace implements ITmfEventParser {
         return this.fTrace.getEnvironment().get(key);
     }
 
-    //-------------------------------------------
-    //        Clocks
-    //-------------------------------------------
+    // -------------------------------------------
+    // Clocks
+    // -------------------------------------------
 
     /**
      * gets the clock offset
+     *
      * @return the clock offset in ns
      */
-    public long getOffset(){
-        if( fTrace != null ) {
+    public long getOffset() {
+        if (fTrace != null) {
             return fTrace.getOffset();
         }
         return 0;
     }
 
-    //-------------------------------------------
-    //        Parser
-    //-------------------------------------------
+    // -------------------------------------------
+    // Parser
+    // -------------------------------------------
 
     @Override
     public CtfTmfEvent parseEvent(ITmfContext context) {
@@ -327,11 +341,11 @@ public class CtfTmfTrace extends TmfTrace implements ITmfEventParser {
         setCacheSize(DEFAULT_CACHE_SIZE);
     }
 
-    //-------------------------------------------
-    //          Helpers
-    //-------------------------------------------
+    // -------------------------------------------
+    // Helpers
+    // -------------------------------------------
 
-    private static CtfIterator getIterator(CtfTmfTrace trace,  CtfTmfContext context) {
+    private static CtfIterator getIterator(CtfTmfTrace trace, CtfTmfContext context) {
         return CtfIteratorManager.getIterator(trace, context);
     }
 
@@ -341,7 +355,7 @@ public class CtfTmfTrace extends TmfTrace implements ITmfEventParser {
      * @return an iterator to the trace
      * @since 2.0
      */
-    public CtfIterator createIterator(){
+    public CtfIterator createIterator() {
         return new CtfIterator(this);
     }
 }
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/Messages.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/Messages.java
new file mode 100644 (file)
index 0000000..42d3e05
--- /dev/null
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.tmf.core.ctfadaptor;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * @author Matthew Khouzam
+ * @since 2.0
+ */
+@SuppressWarnings("javadoc")
+public class Messages extends NLS {
+    private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.core.ctfadaptor.messages"; //$NON-NLS-1$
+    /**
+     * And error message
+     */
+    public static String CtfTmfTrace_MajorNotSet;
+    /**
+     * Read error
+     */
+    public static String CtfTmfTrace_ReadingError;
+    static {
+        // initialize resource bundle
+        NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+    }
+
+    private Messages() {
+    }
+}
diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/messages.properties b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/messages.properties
new file mode 100644 (file)
index 0000000..f9626a9
--- /dev/null
@@ -0,0 +1,2 @@
+CtfTmfTrace_MajorNotSet=Major version number not set
+CtfTmfTrace_ReadingError=Reading error
index 7badaff5531f74d9698e9a688555fcd071902b6c..131317549ff43b1a376b897967693c5a18e50d68 100644 (file)
@@ -18,6 +18,7 @@ import java.util.Map;
 
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.linuxtools.tmf.core.component.ITmfDataProvider;
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
 import org.eclipse.linuxtools.tmf.core.exceptions.TmfTraceException;
@@ -149,8 +150,9 @@ public interface ITmfTrace extends ITmfDataProvider {
      * @param path the trace path
      *
      * @return true if trace is valid
+     * @since 2.0
      */
-    public boolean validate(IProject project, String path);
+    public IStatus validate(IProject project, String path);
 
     // ------------------------------------------------------------------------
     // Basic getters
index 0b0bebf039e6a5fafcaa1e3ed19c6ae712a9877d..0b511458840afdc5dda8267582143aa1f72dde12 100644 (file)
@@ -18,6 +18,8 @@ package org.eclipse.linuxtools.tmf.core.trace;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.linuxtools.internal.tmf.core.trace.TmfExperimentContext;
 import org.eclipse.linuxtools.internal.tmf.core.trace.TmfExperimentLocation;
 import org.eclipse.linuxtools.internal.tmf.core.trace.TmfLocationArray;
@@ -182,9 +184,12 @@ public class TmfExperiment extends TmfTrace implements ITmfEventParser {
     /* (non-Javadoc)
      * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#validate(org.eclipse.core.resources.IProject, java.lang.String)
      */
+    /**
+     * @since 2.0
+     */
     @Override
-    public boolean validate(final IProject project, final String path) {
-        return true;
+    public IStatus validate(final IProject project, final String path) {
+        return Status.OK_STATUS;
     }
 
     // ------------------------------------------------------------------------
index 5cdd17fa898c811d5787c5c0e3dcdfd08ff6b9a2..39bf5c37038fd547dfd7c5c8e783b90035bc259e 100644 (file)
@@ -22,6 +22,8 @@ import java.util.regex.Matcher;
 
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
 import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomTxtTraceDefinition.InputLine;
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
@@ -390,7 +392,10 @@ public class CustomTxtTrace extends TmfTrace implements ITmfEventParser {
      * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#validate(org.eclipse.core.resources.IProject, java.lang.String)
      */
     @Override
-    public boolean validate(IProject project, String path) {
-        return fileExists(path);
+    public IStatus validate(IProject project, String path) {
+        if( fileExists(path)) {
+            return Status.OK_STATUS;
+        }
+        return new Status(IStatus.ERROR, Activator.PLUGIN_ID ,Messages.CustomTrace_FileNotFound + ": " + path); //$NON-NLS-1$
     }
 }
index a69c0a424696d8faecb56459369c556a1bc46d8f..aa6b63b388251d47ce67ae8925f5f5d41324428c 100644 (file)
@@ -19,7 +19,8 @@ import java.io.RandomAccessFile;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
-
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
@@ -493,7 +494,10 @@ public class CustomXmlTrace extends TmfTrace implements ITmfEventParser {
      * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#validate(org.eclipse.core.resources.IProject, java.lang.String)
      */
     @Override
-    public boolean validate(IProject project, String path) {
-        return fileExists(path);
+    public IStatus validate(IProject project, String path) {
+        if (fileExists(path)) {
+            return Status.OK_STATUS;
+        }
+        return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CustomTrace_FileNotFound + ": " + path); //$NON-NLS-1$
     }
 }
diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/Messages.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/Messages.java
new file mode 100644 (file)
index 0000000..c462f42
--- /dev/null
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Matthew Khouzam - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.tmf.ui.parsers.custom;
+
+import org.eclipse.osgi.util.NLS;
+
+@SuppressWarnings("javadoc")
+public class Messages extends NLS {
+    private static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.messages"; //$NON-NLS-1$
+    public static String CustomTrace_FileNotFound;
+    static {
+        // initialize resource bundle
+        NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+    }
+
+    private Messages() {
+    }
+}
diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/messages.properties b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/messages.properties
new file mode 100644 (file)
index 0000000..1117219
--- /dev/null
@@ -0,0 +1 @@
+CustomTrace_FileNotFound=File not found
index 28d4c1e22c9175494a1ad6276fad29f9180b2ffa..5f9ac1c4146095623eb0a4d598c7a6a85f1424f8 100644 (file)
@@ -42,7 +42,13 @@ public class Messages extends NLS {
     public static String DeleteExperimentHandler_Message;
     public static String DeleteExperimentHandler_Error;
 
+    public static String SelectTraceTypeHandler_ErrorSelectingTrace;
+
     public static String SelectTraceTypeHandler_Title;
+
+    public static String SelectTraceTypeHandler_TraceFailedValidation;
+
+    public static String SelectTraceTypeHandler_TracesFailedValidation;
     public static String SelectTraceTypeHandler_InvalidTraceType;
 
     public static String DropAdapterAssistant_RenameTraceTitle;
index e434c081befad413d2b755bccf45dd5a1b0f36f2..473016d18c7e81021de41f088e4dec30838d78e7 100644 (file)
@@ -13,7 +13,9 @@
 
 package org.eclipse.linuxtools.internal.tmf.ui.project.handlers;
 
+import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.List;
 
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
@@ -21,6 +23,10 @@ import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.TreeSelection;
@@ -31,8 +37,7 @@ import org.eclipse.linuxtools.tmf.ui.project.model.ITmfProjectModelElement;
 import org.eclipse.linuxtools.tmf.ui.project.model.TmfExperimentFolder;
 import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceElement;
 import org.eclipse.linuxtools.tmf.ui.project.model.TmfTraceFolder;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.IWorkbenchWindow;
@@ -112,7 +117,7 @@ public class SelectTraceTypeHandler extends AbstractHandler {
         if (window == null) {
             return null;
         }
-
+        List<IStatus> statuses = new ArrayList<IStatus>();
         boolean ok = true;
         for (Object element : fSelection.toList()) {
             TmfTraceElement trace = (TmfTraceElement) element;
@@ -124,25 +129,34 @@ public class SelectTraceTypeHandler extends AbstractHandler {
                     String bundleName = event.getParameter(BUNDLE_PARAMETER);
                     String traceType = event.getParameter(TYPE_PARAMETER);
                     String iconUrl = event.getParameter(ICON_PARAMETER);
-                    ok &= propagateProperties(trace, bundleName, traceType, iconUrl);
+                    IStatus status = propagateProperties(trace, bundleName, traceType, iconUrl);
+                    ok &= status.isOK();
+                    if (!status.isOK()) {
+                        statuses.add(status);
+                    }
                 } catch (CoreException e) {
-                    Activator.getDefault().logError("Error selecting trace type for trace" + trace.getName(), e); //$NON-NLS-1$
+                    Activator.getDefault().logError(Messages.SelectTraceTypeHandler_ErrorSelectingTrace + trace.getName(), e);
                 }
             }
         }
         ((ITmfProjectModelElement) fSelection.getFirstElement()).getProject().refresh();
 
         if (!ok) {
-            MessageBox mb = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.ICON_ERROR);
-            mb.setText(Messages.SelectTraceTypeHandler_Title);
-            mb.setMessage(Messages.SelectTraceTypeHandler_InvalidTraceType);
-            mb.open();
+            final Shell shell = window.getShell();
+            MultiStatus info = new MultiStatus(Activator.PLUGIN_ID, 1, Messages.SelectTraceTypeHandler_TraceFailedValidation, null);
+            if (statuses.size() > 1)
+            {
+                info = new MultiStatus(Activator.PLUGIN_ID, 1, Messages.SelectTraceTypeHandler_TracesFailedValidation, null);
+            }
+            for (IStatus status : statuses) {
+                info.add(status);
+            }
+            ErrorDialog.openError(shell, Messages.SelectTraceTypeHandler_Title, Messages.SelectTraceTypeHandler_InvalidTraceType, info);
         }
-
         return null;
     }
 
-    private static boolean propagateProperties(TmfTraceElement trace,
+    private static IStatus propagateProperties(TmfTraceElement trace,
             String bundleName, String traceType, String iconUrl)
             throws CoreException {
 
@@ -153,10 +167,11 @@ public class SelectTraceTypeHandler extends AbstractHandler {
 
         setProperties(trace.getResource(), bundleName, traceType, iconUrl);
         trace.refreshTraceType();
-        if (!validateTraceType(trace)) {
+        final IStatus validateTraceType = validateTraceType(trace);
+        if (!validateTraceType.isOK()) {
             setProperties(trace.getResource(), svBundleName, svTraceType, svIconUrl);
             trace.refreshTraceType();
-            return false;
+            return validateTraceType;
         }
 
         trace.refreshTraceType();
@@ -177,7 +192,7 @@ public class SelectTraceTypeHandler extends AbstractHandler {
             }
         }
 
-        return true;
+        return Status.OK_STATUS;
     }
 
     private static void setProperties(IResource resource, String bundleName,
@@ -187,17 +202,27 @@ public class SelectTraceTypeHandler extends AbstractHandler {
         resource.setPersistentProperty(TmfCommonConstants.TRACEICON, iconUrl);
     }
 
-    private static boolean validateTraceType(TmfTraceElement trace) {
+    private static IStatus validateTraceType(TmfTraceElement trace) {
         IProject project = trace.getProject().getResource();
         ITmfTrace tmfTrace = null;
+        IStatus validate = null;
         try {
             tmfTrace = trace.instantiateTrace();
-            return (tmfTrace != null && tmfTrace.validate(project, trace.getLocation().getPath()));
+            if (tmfTrace != null) {
+                validate = tmfTrace.validate(project, trace.getLocation().getPath());
+            }
+            else{
+                validate =  new Status(IStatus.ERROR, trace.getName(), "File does not exist : " + trace.getLocation().getPath()); //$NON-NLS-1$
+            }
         } finally {
             if (tmfTrace != null) {
                 tmfTrace.dispose();
             }
         }
+        if (validate == null) {
+            validate = new Status(IStatus.ERROR, "unknown", "unknown"); //$NON-NLS-1$ //$NON-NLS-2$
+        }
+        return validate;
     }
 
 }
index 26ec1bfaa97d715c29c198d904ccef03c2abe6ce..1b7c8eed0e9a421bf4d05e5b7e0ec64cc3e9fa5a 100644 (file)
@@ -18,7 +18,10 @@ DeleteExperimentHandler_Message = Are you sure you want to delete this experimen
 DeleteExperimentHandler_Error = Error deleting experiment
 
 # Set Trace Type
+SelectTraceTypeHandler_ErrorSelectingTrace=Error selecting trace type for trace
 SelectTraceTypeHandler_Title = Validation Error
+SelectTraceTypeHandler_TraceFailedValidation=A trace has failed validation
+SelectTraceTypeHandler_TracesFailedValidation=Several trace files failed validation
 SelectTraceTypeHandler_InvalidTraceType =  Type could not be set for one or more traces
 
 # Drag and drop
index 697417aedcf804ca7faa29db66956bd4ec0c832d..91b720a42c596a537a538d2d85247d7fa7b843e0 100644 (file)
@@ -90,11 +90,12 @@ import org.eclipse.ui.wizards.datatransfer.ImportOperation;
  * A variant of the standard resource import wizard with the following changes:
  * <ul>
  * <li>A folder/file combined checkbox tree viewer to select traces
- * <li>Cherry-picking of traces in the file structure without re-creating the file hierarchy
+ * <li>Cherry-picking of traces in the file structure without re-creating the
+ * file hierarchy
  * <li>A trace types dropbox for optional characterization
  * </ul>
- * For our purpose, a trace can either be a single file or a whole directory sub-tree, whichever is reached first from
- * the root directory.
+ * For our purpose, a trace can either be a single file or a whole directory
+ * sub-tree, whichever is reached first from the root directory.
  * <p>
  *
  * @version 1.0
@@ -132,11 +133,12 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
     // ------------------------------------------------------------------------
 
     /**
-     * Constructor.
-     * Creates the trace wizard page.
+     * Constructor. Creates the trace wizard page.
      *
-     * @param name The name of the page.
-     * @param selection The current selection
+     * @param name
+     *            The name of the page.
+     * @param selection
+     *            The current selection
      */
     protected ImportTraceWizardPage(String name, IStructuredSelection selection) {
         super(name, selection);
@@ -144,8 +146,11 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
 
     /**
      * Constructor
-     * @param workbench The workbench reference.
-     * @param selection The current selection
+     *
+     * @param workbench
+     *            The workbench reference.
+     * @param selection
+     *            The current selection
      */
     public ImportTraceWizardPage(IWorkbench workbench, IStructuredSelection selection) {
         this(IMPORT_WIZARD_PAGE, selection);
@@ -183,7 +188,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
     // ------------------------------------------------------------------------
     /*
      * (non-Javadoc)
-     * @see org.eclipse.ui.dialogs.WizardResourceImportPage#createControl(org.eclipse.swt.widgets.Composite)
+     *
+     * @see
+     * org.eclipse.ui.dialogs.WizardResourceImportPage#createControl(org.eclipse
+     * .swt.widgets.Composite)
      */
     @Override
     public void createControl(Composite parent) {
@@ -197,7 +205,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
 
     /*
      * (non-Javadoc)
-     * @see org.eclipse.ui.dialogs.WizardResourceImportPage#createSourceGroup(org.eclipse.swt.widgets.Composite)
+     *
+     * @see
+     * org.eclipse.ui.dialogs.WizardResourceImportPage#createSourceGroup(org
+     * .eclipse.swt.widgets.Composite)
      */
     @Override
     protected void createSourceGroup(Composite parent) {
@@ -209,7 +220,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
 
     /*
      * (non-Javadoc)
-     * @see org.eclipse.ui.dialogs.WizardResourceImportPage#createFileSelectionGroup(org.eclipse.swt.widgets.Composite)
+     *
+     * @see
+     * org.eclipse.ui.dialogs.WizardResourceImportPage#createFileSelectionGroup
+     * (org.eclipse.swt.widgets.Composite)
      */
     @Override
     protected void createFileSelectionGroup(Composite parent) {
@@ -256,6 +270,7 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
 
     /*
      * (non-Javadoc)
+     *
      * @see org.eclipse.ui.dialogs.WizardResourceImportPage#getFolderProvider()
      */
     @Override
@@ -265,6 +280,7 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
 
     /*
      * (non-Javadoc)
+     *
      * @see org.eclipse.ui.dialogs.WizardResourceImportPage#getFileProvider()
      */
     @Override
@@ -314,7 +330,9 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
 
     /*
      * (non-Javadoc)
-     * @see org.eclipse.ui.dialogs.WizardResourceImportPage#getSelectedResources()
+     *
+     * @see
+     * org.eclipse.ui.dialogs.WizardResourceImportPage#getSelectedResources()
      */
     @Override
     protected List<FileSystemElement> getSelectedResources() {
@@ -344,7 +362,9 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
 
     /**
      * creates the directory selection group.
-     * @param parent the parent composite
+     *
+     * @param parent
+     *            the parent composite
      */
     protected void createDirectorySelectionGroup(Composite parent) {
 
@@ -421,7 +441,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
 
     /*
      * (non-Javadoc)
-     * @see org.eclipse.ui.dialogs.WizardResourceImportPage#handleEvent(org.eclipse.swt.widgets.Event)
+     *
+     * @see
+     * org.eclipse.ui.dialogs.WizardResourceImportPage#handleEvent(org.eclipse
+     * .swt.widgets.Event)
      */
     @Override
     public void handleEvent(Event event) {
@@ -598,7 +621,8 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
         });
     }
 
-    // The mapping of available trace type IDs to their corresponding configuration element
+    // The mapping of available trace type IDs to their corresponding
+    // configuration element
     private final Map<String, IConfigurationElement> fTraceTypeAttributes = new HashMap<String, IConfigurationElement>();
     private final Map<String, IConfigurationElement> fTraceCategories = new HashMap<String, IConfigurationElement>();
     private final Map<String, IConfigurationElement> fTraceAttributes = new HashMap<String, IConfigurationElement>();
@@ -662,7 +686,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
 
     /*
      * (non-Javadoc)
-     * @see org.eclipse.ui.dialogs.WizardDataTransferPage#createOptionsGroupButtons(org.eclipse.swt.widgets.Group)
+     *
+     * @see
+     * org.eclipse.ui.dialogs.WizardDataTransferPage#createOptionsGroupButtons
+     * (org.eclipse.swt.widgets.Group)
      */
     @Override
     protected void createOptionsGroupButtons(Group optionsGroup) {
@@ -695,6 +722,7 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
 
     /*
      * (non-Javadoc)
+     *
      * @see org.eclipse.ui.dialogs.WizardDataTransferPage#validateSourceGroup()
      */
     @Override
@@ -736,19 +764,23 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
         // Perform trace validation
         String traceTypeName = fTraceTypes.getText();
         if (traceTypeName != null && !"".equals(traceTypeName) && //$NON-NLS-1$
-            !traceTypeName.startsWith(CUSTOM_TXT_CATEGORY) && !traceTypeName.startsWith(CUSTOM_XML_CATEGORY)) {
+                !traceTypeName.startsWith(CUSTOM_TXT_CATEGORY) && !traceTypeName.startsWith(CUSTOM_XML_CATEGORY)) {
 
             List<File> traces = isolateTraces();
             for (File trace : traces) {
                 ITmfTrace tmfTrace = null;
+
                 try {
                     IConfigurationElement ce = fTraceAttributes.get(traceTypeName);
                     tmfTrace = (ITmfTrace) ce.createExecutableExtension(TmfTraceType.TRACE_TYPE_ATTR);
-                    if (tmfTrace != null && !tmfTrace.validate(fProject, trace.getAbsolutePath())) {
-                        setMessage(null);
-                        setErrorMessage(Messages.ImportTraceWizard_TraceValidationFailed);
-                        tmfTrace.dispose();
-                        return false;
+                    if (tmfTrace != null) {
+                        IStatus status = tmfTrace.validate(fProject, trace.getAbsolutePath());
+                        if (!status.isOK()) {
+                            setMessage(null);
+                            setErrorMessage(Messages.ImportTraceWizard_TraceValidationFailed);
+                            tmfTrace.dispose();
+                            return false;
+                        }
                     }
                 } catch (CoreException e) {
                 } finally {
@@ -801,6 +833,7 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
 
     /**
      * Finish the import.
+     *
      * @return <code>true</code> if successful else false
      */
     public boolean finish() {
@@ -825,7 +858,8 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
         List<FileSystemElement> selectedResources = getSelectedResources();
         Iterator<FileSystemElement> resources = selectedResources.iterator();
 
-        // Use a map to end up with unique resources (getSelectedResources() can return duplicates)
+        // Use a map to end up with unique resources (getSelectedResources() can
+        // return duplicates)
         Map<String, File> fileSystemObjects = new HashMap<String, File>();
         while (resources.hasNext()) {
             File file = (File) resources.next().getFileSystemObject();
@@ -934,8 +968,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage {
             }
         });
 
-        // Perform a distinct import operation for everything that has the same prefix
-        // (distinct prefixes correspond to traces - we don't want to re-create parent structures)
+        // Perform a distinct import operation for everything that has the same
+        // prefix
+        // (distinct prefixes correspond to traces - we don't want to re-create
+        // parent structures)
         boolean ok = true;
         boolean isLinked = createLinksInWorkspaceButton.getSelection();
         for (int i = 0; i < fileList.size(); i++) {
index 0d31ea439c2a91654ff4f0012e686421b943af88..e3cd26dfe517e964401a469f3f6e14e0a7b6aa65 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2011, 2012 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Francois Chouinard - Initial API and implementation
  *******************************************************************************/
@@ -16,11 +16,12 @@ import org.eclipse.osgi.util.NLS;
 
 /**
  * Message strings for TMF model handling.
- * 
+ *
  * @version 1.0
  * @author Francois Chouinard
  *
  */
+@SuppressWarnings("javadoc")
 public class Messages extends NLS {
 
     private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.ui.project.wizards.messages"; //$NON-NLS-1$
@@ -74,7 +75,7 @@ public class Messages extends NLS {
      */
     public static String ImportTraceWizard_InvalidTraceDirectory;
     /**
-     * The error message when a trace validation failed (import trace wizard). 
+     * The error message when a trace validation failed (import trace wizard).
      */
     public static String ImportTraceWizard_TraceValidationFailed;
     /**
index 202aa36e920800443c0fa8ebc2c994aa9c4d084f..908c593407411114896f511234b994cd1e3a73c7 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.osgi.util.NLS;
  * @since 2.0
  * @version 2.0
  */
+@SuppressWarnings("javadoc")
 public class Messages extends NLS {
 
     private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.ui.viewers.statistics.messages"; //$NON-NLS-1$
index 2a50be45549f554f3cab976e8c0542471bae40f2..a784cdd5bd155f6242b5129b90a64c98c340b0fe 100755 (executable)
@@ -21,6 +21,7 @@ import org.eclipse.osgi.util.NLS;
  * @author Mathieu Denis
  * @since 2.0
  */
+@SuppressWarnings("javadoc")
 public class Messages extends NLS {
 
     private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.ui.viewers.statistics.model.messages"; //$NON-NLS-1$
index 7660923baf11c17c144e4c55f01eb2eb1f15fe3f..6f29dd74262ed17a2369e1038c86920323adec60 100644 (file)
@@ -22,6 +22,7 @@ import org.eclipse.osgi.util.NLS;
  * @version 1.0
  * @author Francois Chouinard
  */
+@SuppressWarnings("javadoc")
 public class Messages extends NLS {
 
     // ------------------------------------------------------------------------
index da24ea62b969a4d8237cf12743d05140aedb653b..1aa819a0d2297ad5412832e895d904ca436a0d97 100755 (executable)
@@ -21,6 +21,7 @@ import org.eclipse.osgi.util.NLS;
  * @author Mathieu Denis
  * @since 2.0
  */
+@SuppressWarnings("javadoc")
 public class Messages extends NLS {
 
     private static final String BUNDLE_NAME = "org.eclipse.linuxtools.tmf.ui.views.statistics.messages"; //$NON-NLS-1$
This page took 0.054347 seconds and 5 git commands to generate.