Examples of CoreException


Examples of org.eclipse.core.runtime.CoreException

    }

    protected InputStream createStream() throws CoreException {
        InputStream stream = JdtUtils.createInputStream(element);
        if (stream == null) {
            throw new CoreException(new Status(
                IStatus.ERROR, "de.loskutov.bco", -1,
                "cannot get bytecode from class file", null));
        }
        DecompiledClass decompiledClass = null;
        try {
            decompiledClass = DecompilerClassVisitor.getDecompiledClass(
                stream, null, methodName, modes, null);
        } catch (IOException e) {
            throw new CoreException(new Status(
                IStatus.ERROR, "de.loskutov.bco", -1,
                "cannot get bytecode dump", e));
        } catch (UnsupportedClassVersionError e){
            throw new CoreException(new Status(
                IStatus.ERROR, "de.loskutov.bco", -1,
                "Error caused by attempt to load class compiled with Java version which"
                + " is not supported by current JVM", e));
        } finally {
            try {
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

        InputStream stream= null;
        stream = new BufferedInputStream(file.getContents(true));
        try {
            return getInputStreamAsCharArray(stream, -1, encoding);
        } catch (IOException e) {
            throw new CoreException(new Status(IStatus.ERROR, DroolsIDEPlugin.PLUGIN_ID, IStatus.ERROR, "IOException", e));
        } finally {
            try {
                stream.close();
            } catch (IOException e) {
                // ignore
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

public String toString() {
  StringBuffer buffer= new StringBuffer();
  buffer.append("Java Model Exception: "); //$NON-NLS-1$
  if (getException() != null) {
    if (getException() instanceof CoreException) {
      CoreException c= (CoreException)getException();
      buffer.append("Core Exception [code "); //$NON-NLS-1$
      buffer.append(c.getStatus().getCode());
      buffer.append("] "); //$NON-NLS-1$
      buffer.append(c.getStatus().getMessage());
    } else {
      buffer.append(getException().toString());
    }
  } else {
    buffer.append(getStatus().toString());
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

    int curr= 0;
    do {
      try {
        curr= this.scanner.getNextToken();
        if (curr == ITerminalSymbols.TokenNameEOF) {
          throw new CoreException(createError(END_OF_FILE, "End Of File", null)); //$NON-NLS-1$
        }
      } catch (InvalidInputException e) {
        throw new CoreException(createError(LEXICAL_ERROR, e.getMessage(), e));
      }
    } while (ignoreComments && isComment(curr));
    return curr;
  }
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

  }

  private static void ensureResourceExists(IResource resource, String resourceName)
          throws CoreException {
    if (resource == null)
      throw new CoreException(new Status(IStatus.ERROR, LauncherPlugin.ID, "The " + resourceName
              + " does not exist!"));
  }
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

      }       
      // adds things like the top level metainf info,
      // probably not required in most cases
      extendedClasspath.add(pluginIdToJarPath("org.apache.uima.runtime"));
    } catch (IOException e) {
      throw new CoreException(new Status(IStatus.ERROR, LauncherPlugin.ID, IStatus.OK,
              "Failed to compose classpath!", e));
    }
   
    // Dump classpath
//    for (String cp : extendedClasspath) {
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

                        }
                    }
                }

                if (!status.isOK())
                    throw new CoreException(status);
            }
        };
        IRunnableWithProgress uiOperation = new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                try {
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

                project.open(monitor);
            } else {
                project.create(monitor);
            }
        } else {
            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Incorrect path (not a project): " + location, null));
        }
    }
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

        String bsn = templateConfig.getContributor().getName();
        Bundle bundle = BundleUtils.findBundle(Plugin.getDefault().getBundleContext(), bsn, null);
        String paths = templateConfig.getAttribute("paths");
        if (paths == null)
            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Template is missing 'paths' property.", null));

        StringTokenizer tokenizer = new StringTokenizer(paths, ",");
        progress.setWorkRemaining(tokenizer.countTokens());

        while (tokenizer.hasMoreTokens()) {
View Full Code Here

Examples of org.eclipse.core.runtime.CoreException

                file.create(entry.openStream(), false, monitor);
            } else {
                file.setContents(entry.openStream(), false, true, monitor);
            }
        } catch (IOException e) {
            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Failed to load data from template source bundle.", e));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.