Package org.eclipse.jdt.internal.compiler.problem

Examples of org.eclipse.jdt.internal.compiler.problem.AbortCompilation


public char[] getContents() {

  try {
    return Util.getResourceContentsAsCharArray(this.resource);
  } catch (CoreException e) {
    throw new AbortCompilation(true, new MissingSourceFileException(this.resource.getFullPath().toString()));
  }
}
View Full Code Here


    this.notifier.checkCancelWithinCompiler();

  if (this.initialTypeNames != null && this.initialTypeNames.includes(qualifiedTypeName)) {
    if (this.isIncrementalBuild)
      // catch the case that a type inside a source file has been renamed but other class files are looking for it
      throw new AbortCompilation(true, new AbortIncrementalBuildException(qualifiedTypeName));
    return null; // looking for a file which we know was provided at the beginning of the compilation
  }

  if (this.additionalUnits != null && this.sourceLocations.length > 0) {
    // if an additional source file is waiting to be compiled, answer it BUT not if this is a secondary type search
View Full Code Here

        abortCount++;
        String filename = new String(cud.getFileName());
        logger.log(TreeLogger.WARN, "JDT threw an exception: " + filename + ": " + e);
        if (abortCount >= ABORT_COUNT_MAX) {
          logger.log(TreeLogger.ERROR, "JDT threw too many exceptions.");
          throw new AbortCompilation(cud.compilationResult, e);
        }
        return; // continue without it; it might be a server-side class.
      }
      ClassFile[] classFiles = cud.compilationResult().getClassFiles();
      Map<ClassFile, CompiledClass> results = new LinkedHashMap<ClassFile, CompiledClass>();
View Full Code Here

    this.monitor = monitor;
  }

  public CategorizedProblem createProblem(char[] originatingFileName, int problemId, String[] problemArguments, String[] messageArguments, int severity, int startPosition, int endPosition, int lineNumber, int columnNumber) {
    if (this.monitor != null && this.monitor.isCanceled())
      throw new AbortCompilation(true/*silent*/, new OperationCanceledException());
    return super.createProblem(originatingFileName, problemId, problemArguments, messageArguments, severity, startPosition, endPosition, lineNumber, columnNumber);
  }
View Full Code Here

    return super.createProblem(originatingFileName, problemId, problemArguments, messageArguments, severity, startPosition, endPosition, lineNumber, columnNumber);
  }

  public CategorizedProblem createProblem(char[] originatingFileName, int problemId, String[] problemArguments, int elaborationId, String[] messageArguments, int severity, int startPosition, int endPosition, int lineNumber, int columnNumber) {
    if (this.monitor != null && this.monitor.isCanceled())
      throw new AbortCompilation(true/*silent*/, new OperationCanceledException());
    return super.createProblem(originatingFileName, problemId, problemArguments, elaborationId, messageArguments, severity, startPosition, endPosition, lineNumber, columnNumber);
  }
View Full Code Here

    this.notifier.checkCancelWithinCompiler();

  if (this.initialTypeNames != null && this.initialTypeNames.includes(qualifiedTypeName)) {
    if (this.isIncrementalBuild)
      // catch the case that a type inside a source file has been renamed but other class files are looking for it
      throw new AbortCompilation(true, new AbortIncrementalBuildException(qualifiedTypeName));
    return null; // looking for a file which we know was provided at the beginning of the compilation
  }

  if (this.additionalUnits != null && this.sourceLocations.length > 0) {
    // if an additional source file is waiting to be compiled, answer it BUT not if this is a secondary type search
View Full Code Here

  if (this.monitor != null && this.monitor.isCanceled() && !this.cancelling) {
    // Once the compiler has been canceled, don't check again.
    setCancelling(true);
    // Only AbortCompilation can stop the compiler cleanly.
    // We check cancelation again following the call to compile.
    throw new AbortCompilation(true, null);
  }
}
View Full Code Here

  private void checkCanceled() {
    if (this.monitor != null && this.monitor.isCanceled()) {
      if (NameLookup.VERBOSE) {
        System.out.println(Thread.currentThread() + " CANCELLING LOOKUP "); //$NON-NLS-1$
      }
      throw new AbortCompilation(true/*silent*/, new OperationCanceledException());
    }
  }
View Full Code Here

            _out.println("Command line specified processor: " + pi); //$NON-NLS-1$
          }
          return pi;
        } catch (Exception e) {
          // TODO: better error handling
          throw new AbortCompilation(null, e);
        }
      }
      return null;
    }
   
    // if no processors were explicitly specified with setProcessors()
    // or the command line, search the processor path with ServiceLoader.
    if (null == _serviceLoader ) {
      _serviceLoader = ServiceLoader.load(Processor.class, _procLoader);
      _serviceLoaderIter = _serviceLoader.iterator();
    }
    try {
      if (_serviceLoaderIter.hasNext()) {
        Processor p = _serviceLoaderIter.next();
        p.init(_processingEnv);
        ProcessorInfo pi = new ProcessorInfo(p);
        _processors.add(pi);
        if (_printProcessorDiscovery && null != _out) {
          StringBuilder sb = new StringBuilder();
          sb.append("Discovered processor service "); //$NON-NLS-1$
          sb.append(pi);
          sb.append("\n  supporting "); //$NON-NLS-1$
          sb.append(pi.getSupportedAnnotationTypesAsString());
          sb.append("\n  in "); //$NON-NLS-1$
          sb.append(getProcessorLocation(p));
          _out.println(sb.toString());
        }
        return pi;
      }
    } catch (ServiceConfigurationError e) {
      // TODO: better error handling
      throw new AbortCompilation(null, e);
    }
    return null;
  }
View Full Code Here

  }

  @Override
  public void reportProcessorException(Processor p, Exception e) {
    // TODO: if (verbose) report the processor
    throw new AbortCompilation(null, e);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.problem.AbortCompilation

Copyright © 2018 www.massapicom. 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.