Examples of INameEnvironmentWithProgress


Examples of org.eclipse.jdt.internal.core.INameEnvironmentWithProgress

      Map options,
      List classpaths,
      int flags,
      IProgressMonitor monitor) {

      INameEnvironmentWithProgress environment = null;
      CancelableProblemFactory problemFactory = null;
      try {
        if (monitor != null) {
          int amountOfWork = (sourceUnits.length + bindingKeys.length) * 2; // 1 for beginToCompile, 1 for resolve
          monitor.beginTask("", amountOfWork); //$NON-NLS-1$
        }
        Classpath[] allEntries = new Classpath[classpaths.size()];
        classpaths.toArray(allEntries);
        environment = new NameEnvironmentWithProgress(allEntries, null, monitor);
        problemFactory = new CancelableProblemFactory(monitor);
        CompilerOptions compilerOptions = getCompilerOptions(options, (flags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0);
        compilerOptions.ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;
        CompilationUnitResolver resolver =
          new CompilationUnitResolver(
            environment,
            getHandlingPolicy(),
            compilerOptions,
            getRequestor(),
            problemFactory,
            monitor,
            false);
        resolver.resolve(sourceUnits, encodings, bindingKeys, requestor, apiLevel, options, flags);
        if (NameLookup.VERBOSE && (environment instanceof CancelableNameEnvironment)) {
          CancelableNameEnvironment cancelableNameEnvironment = (CancelableNameEnvironment) environment;
          System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
          System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
        }
      } finally {
        if (monitor != null) monitor.done();
        if (environment != null) {
          environment.setMonitor(null); // don't hold a reference to this external object
        }
        if (problemFactory != null) {
          problemFactory.monitor = null; // don't hold a reference to this external object
        }
      }
View Full Code Here

Examples of org.eclipse.jdt.internal.core.INameEnvironmentWithProgress

      WorkingCopyOwner owner,
      int flags,
      IProgressMonitor monitor) throws JavaModelException {

    CompilationUnitDeclaration unit = null;
    INameEnvironmentWithProgress environment = null;
    CancelableProblemFactory problemFactory = null;
    CompilationUnitResolver resolver = null;
    try {
      if (javaProject == null) {
        Classpath[] allEntries = new Classpath[classpaths.size()];
        classpaths.toArray(allEntries);
        environment = new NameEnvironmentWithProgress(allEntries, null, monitor);
      } else {
        environment = new CancelableNameEnvironment((JavaProject) javaProject, owner, monitor);
      }
      problemFactory = new CancelableProblemFactory(monitor);
      CompilerOptions compilerOptions = getCompilerOptions(options, (flags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0);
      boolean ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;
      compilerOptions.ignoreMethodBodies = ignoreMethodBodies;
      resolver =
        new CompilationUnitResolver(
          environment,
          getHandlingPolicy(),
          compilerOptions,
          getRequestor(),
          problemFactory,
          monitor,
          javaProject != null);
      boolean analyzeAndGenerateCode = !ignoreMethodBodies;
      unit =
        resolver.resolve(
          null, // no existing compilation unit declaration
          sourceUnit,
          nodeSearcher,
          true, // method verification
          analyzeAndGenerateCode, // analyze code
          analyzeAndGenerateCode); // generate code
      if (resolver.hasCompilationAborted) {
        // the bindings could not be resolved due to missing types in name environment
        // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=86541
        CompilationUnitDeclaration unitDeclaration = parse(sourceUnit, nodeSearcher, options, flags);
        final int problemCount = unit.compilationResult.problemCount;
        if (problemCount != 0) {
          unitDeclaration.compilationResult.problems = new CategorizedProblem[problemCount];
          System.arraycopy(unit.compilationResult.problems, 0, unitDeclaration.compilationResult.problems, 0, problemCount);
          unitDeclaration.compilationResult.problemCount = problemCount;
        }
        return unitDeclaration;
      }
      if (NameLookup.VERBOSE && environment instanceof CancelableNameEnvironment) {
        CancelableNameEnvironment cancelableNameEnvironment = (CancelableNameEnvironment) environment;
        System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
        System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
      }
      return unit;
    } finally {
      if (environment != null) {
        // don't hold a reference to this external object
        environment.setMonitor(null);
      }
      if (problemFactory != null) {
        problemFactory.monitor = null; // don't hold a reference to this external object
      }
    }
View Full Code Here

Examples of org.eclipse.jdt.internal.core.INameEnvironmentWithProgress

      Map options,
      List classpaths,
      int flags,
      IProgressMonitor monitor) {

      INameEnvironmentWithProgress environment = null;
      CancelableProblemFactory problemFactory = null;
      try {
        if (monitor != null) {
          int amountOfWork = (sourceUnits.length + bindingKeys.length) * 2; // 1 for beginToCompile, 1 for resolve
          monitor.beginTask("", amountOfWork); //$NON-NLS-1$
        }
        Classpath[] allEntries = new Classpath[classpaths.size()];
        classpaths.toArray(allEntries);
        environment = new NameEnvironmentWithProgress(allEntries, null, monitor);
        problemFactory = new CancelableProblemFactory(monitor);
        CompilerOptions compilerOptions = getCompilerOptions(options, (flags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0);
        compilerOptions.ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;
        CompilationUnitResolver resolver =
          new CompilationUnitResolver(
            environment,
            getHandlingPolicy(),
            compilerOptions,
            getRequestor(),
            problemFactory,
            monitor,
            false);
        resolver.resolve(sourceUnits, encodings, bindingKeys, requestor, apiLevel, options, flags);
        if (NameLookup.VERBOSE && (environment instanceof CancelableNameEnvironment)) {
          CancelableNameEnvironment cancelableNameEnvironment = (CancelableNameEnvironment) environment;
          System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
          System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
        }
      } finally {
        if (monitor != null) monitor.done();
        if (environment != null) {
          environment.setMonitor(null); // don't hold a reference to this external object
        }
        if (problemFactory != null) {
          problemFactory.monitor = null; // don't hold a reference to this external object
        }
      }
View Full Code Here

Examples of org.eclipse.jdt.internal.core.INameEnvironmentWithProgress

      WorkingCopyOwner owner,
      int flags,
      IProgressMonitor monitor) throws JavaModelException {

    CompilationUnitDeclaration unit = null;
    INameEnvironmentWithProgress environment = null;
    CancelableProblemFactory problemFactory = null;
    CompilationUnitResolver resolver = null;
    try {
      if (javaProject == null) {
        Classpath[] allEntries = new Classpath[classpaths.size()];
        classpaths.toArray(allEntries);
        environment = new NameEnvironmentWithProgress(allEntries, null, monitor);
      } else {
        environment = new CancelableNameEnvironment((JavaProject) javaProject, owner, monitor);
      }
      problemFactory = new CancelableProblemFactory(monitor);
      CompilerOptions compilerOptions = getCompilerOptions(options, (flags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0);
      boolean ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;
      compilerOptions.ignoreMethodBodies = ignoreMethodBodies;
      resolver =
        new CompilationUnitResolver(
          environment,
          getHandlingPolicy(),
          compilerOptions,
          getRequestor(),
          problemFactory,
          monitor,
          javaProject != null);
      boolean analyzeAndGenerateCode = !ignoreMethodBodies;
      unit =
        resolver.resolve(
          null, // no existing compilation unit declaration
          sourceUnit,
          nodeSearcher,
          true, // method verification
          analyzeAndGenerateCode, // analyze code
          analyzeAndGenerateCode); // generate code
      if (resolver.hasCompilationAborted) {
        // the bindings could not be resolved due to missing types in name environment
        // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=86541
        CompilationUnitDeclaration unitDeclaration = parse(sourceUnit, nodeSearcher, options, flags);
        if (unit != null) {
          final int problemCount = unit.compilationResult.problemCount;
          if (problemCount != 0) {
            unitDeclaration.compilationResult.problems = new CategorizedProblem[problemCount];
            System.arraycopy(unit.compilationResult.problems, 0, unitDeclaration.compilationResult.problems, 0, problemCount);
            unitDeclaration.compilationResult.problemCount = problemCount;
          }
        } else if (resolver.abortProblem != null) {
          unitDeclaration.compilationResult.problemCount = 1;
          unitDeclaration.compilationResult.problems = new CategorizedProblem[] { resolver.abortProblem };
        }
        return unitDeclaration;
      }
      if (NameLookup.VERBOSE && environment instanceof CancelableNameEnvironment) {
        CancelableNameEnvironment cancelableNameEnvironment = (CancelableNameEnvironment) environment;
        System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
        System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
      }
      return unit;
    } finally {
      if (environment != null) {
        // don't hold a reference to this external object
        environment.setMonitor(null);
      }
      if (problemFactory != null) {
        problemFactory.monitor = null; // don't hold a reference to this external object
      }
    }
View Full Code Here

Examples of org.eclipse.jdt.internal.core.INameEnvironmentWithProgress

      Map options,
      List classpaths,
      int flags,
      IProgressMonitor monitor) {

      INameEnvironmentWithProgress environment = null;
      CancelableProblemFactory problemFactory = null;
      try {
        if (monitor != null) {
          int amountOfWork = (sourceUnits.length + bindingKeys.length) * 2; // 1 for beginToCompile, 1 for resolve
          monitor.beginTask("", amountOfWork); //$NON-NLS-1$
        }
        Classpath[] allEntries = new Classpath[classpaths.size()];
        classpaths.toArray(allEntries);
        environment = new NameEnvironmentWithProgress(allEntries, null, monitor);
        problemFactory = new CancelableProblemFactory(monitor);
        CompilerOptions compilerOptions = getCompilerOptions(options, (flags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0);
        compilerOptions.ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;
        CompilationUnitResolver resolver =
          new CompilationUnitResolver(
            environment,
            getHandlingPolicy(),
            compilerOptions,
            getRequestor(),
            problemFactory,
            monitor,
            false);
        resolver.resolve(sourceUnits, encodings, bindingKeys, requestor, apiLevel, options, flags);
        if (NameLookup.VERBOSE && (environment instanceof CancelableNameEnvironment)) {
          CancelableNameEnvironment cancelableNameEnvironment = (CancelableNameEnvironment) environment;
          System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
          System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
        }
      } finally {
        if (monitor != null) monitor.done();
        if (environment != null) {
          environment.setMonitor(null); // don't hold a reference to this external object
        }
        if (problemFactory != null) {
          problemFactory.monitor = null; // don't hold a reference to this external object
        }
      }
View Full Code Here

Examples of org.eclipse.jdt.internal.core.INameEnvironmentWithProgress

      WorkingCopyOwner owner,
      int flags,
      IProgressMonitor monitor) throws JavaModelException {

    CompilationUnitDeclaration unit = null;
    INameEnvironmentWithProgress environment = null;
    CancelableProblemFactory problemFactory = null;
    CompilationUnitResolver resolver = null;
    try {
      if (javaProject == null) {
        Classpath[] allEntries = new Classpath[classpaths.size()];
        classpaths.toArray(allEntries);
        environment = new NameEnvironmentWithProgress(allEntries, null, monitor);
      } else {
        environment = new CancelableNameEnvironment((JavaProject) javaProject, owner, monitor);
      }
      problemFactory = new CancelableProblemFactory(monitor);
      CompilerOptions compilerOptions = getCompilerOptions(options, (flags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0);
      boolean ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;
      compilerOptions.ignoreMethodBodies = ignoreMethodBodies;
      resolver =
        new CompilationUnitResolver(
          environment,
          getHandlingPolicy(),
          compilerOptions,
          getRequestor(),
          problemFactory,
          monitor,
          javaProject != null);
      boolean analyzeAndGenerateCode = !ignoreMethodBodies;
      unit =
        resolver.resolve(
          null, // no existing compilation unit declaration
          sourceUnit,
          nodeSearcher,
          true, // method verification
          analyzeAndGenerateCode, // analyze code
          analyzeAndGenerateCode); // generate code
      if (resolver.hasCompilationAborted) {
        // the bindings could not be resolved due to missing types in name environment
        // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=86541
        CompilationUnitDeclaration unitDeclaration = parse(sourceUnit, nodeSearcher, options, flags);
        if (unit != null) {
          final int problemCount = unit.compilationResult.problemCount;
          if (problemCount != 0) {
            unitDeclaration.compilationResult.problems = new CategorizedProblem[problemCount];
            System.arraycopy(unit.compilationResult.problems, 0, unitDeclaration.compilationResult.problems, 0, problemCount);
            unitDeclaration.compilationResult.problemCount = problemCount;
          }
        } else if (resolver.abortProblem != null) {
          unitDeclaration.compilationResult.problemCount = 1;
          unitDeclaration.compilationResult.problems = new CategorizedProblem[] { resolver.abortProblem };
        }
        return unitDeclaration;
      }
      if (NameLookup.VERBOSE && environment instanceof CancelableNameEnvironment) {
        CancelableNameEnvironment cancelableNameEnvironment = (CancelableNameEnvironment) environment;
        System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
        System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms")//$NON-NLS-1$ //$NON-NLS-2$
      }
      return unit;
    } finally {
      if (environment != null) {
        // don't hold a reference to this external object
        environment.setMonitor(null);
      }
      if (problemFactory != null) {
        problemFactory.monitor = null; // don't hold a reference to this external object
      }
    }
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.