Examples of AbortCompilation


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

  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

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

            _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

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

  }

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

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

      }
      int equals = arg.indexOf('=');
      if (equals == 2) {
        // option begins "-A=" - not valid
        Exception e = new IllegalArgumentException("-A option must have a key before the equals sign"); //$NON-NLS-1$
        throw new AbortCompilation(null, e);
      }
      if (equals == arg.length() - 1) {
        // option ends with "=" - not valid
        options.put(arg.substring(2, equals), null);
      } else if (equals == -1) {
View Full Code Here

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

            _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

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

  }

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

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

      }
      int equals = arg.indexOf('=');
      if (equals == 2) {
        // option begins "-A=" - not valid
        Exception e = new IllegalArgumentException("-A option must have a key before the equals sign"); //$NON-NLS-1$
        throw new AbortCompilation(null, e);
      }
      if (equals == arg.length() - 1) {
        // option ends with "=" - not valid
        options.put(arg.substring(2, equals), null);
      } else if (equals == -1) {
View Full Code Here

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

    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

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

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

  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
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.