Example usage for org.eclipse.jdt.internal.core NameLookup VERBOSE

List of usage examples for org.eclipse.jdt.internal.core NameLookup VERBOSE

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core NameLookup VERBOSE.

Prototype

boolean VERBOSE

To view the source code for org.eclipse.jdt.internal.core NameLookup VERBOSE.

Click Source Link

Usage

From source file:org.eclipse.ajdt.core.javaelements.AJCompilationUnit.java

License:Open Source License

/**
* this method is a copy of {@link Openable#codeComplete(org.eclipse.jdt.internal.compiler.env.ICompilationUnit, org.eclipse.jdt.internal.compiler.env.ICompilationUnit, int, CompletionRequestor, WorkingCopyOwner, ITypeRoot)}
* The only change is that we need to create an {@link ITDAwareNameEnvironment}, not  standard {@link SearchableEnvironment}.
 * /*from w w  w  .  j a v  a 2s .  c  o  m*/
* @param cu
* @param unitToSkip
* @param position
* @param requestor
* @param owner
* @param typeRoot
* @throws JavaModelException
*/
private void internalCodeComplete(org.eclipse.jdt.internal.compiler.env.ICompilationUnit cu,
        org.eclipse.jdt.internal.compiler.env.ICompilationUnit unitToSkip, int position,
        CompletionRequestor requestor, WorkingCopyOwner owner, ITypeRoot typeRoot,
        /* AJDT 1.7 */
        IProgressMonitor monitor) throws JavaModelException {

    if (requestor == null) {
        throw new IllegalArgumentException("Completion requestor cannot be null"); //$NON-NLS-1$
    }
    PerformanceStats performanceStats = CompletionEngine.PERF
            ? PerformanceStats.getStats(JavaModelManager.COMPLETION_PERF, this)
            : null;
    if (performanceStats != null) {
        performanceStats.startRun(new String(cu.getFileName()) + " at " + position); //$NON-NLS-1$
    }
    IBuffer buffer = getBuffer();
    if (buffer == null) {
        return;
    }
    if (position < -1 || position > buffer.getLength()) {
        throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INDEX_OUT_OF_BOUNDS));
    }
    JavaProject project = (JavaProject) getJavaProject();
    /* AJDT 1.7 */
    ITDAwareNameEnvironment environment = new ITDAwareNameEnvironment(project, owner, monitor);

    environment.setUnitToSkip(unitToSkip);

    // code complete
    /* AJDT 1.7 */
    CompletionEngine engine = new CompletionEngine(environment, requestor, project.getOptions(true), project,
            owner, monitor);
    engine.complete(cu, position, 0, typeRoot);
    if (performanceStats != null) {
        performanceStats.endRun();
    }
    if (NameLookup.VERBOSE) {
        AJLog.log(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " //$NON-NLS-1$
                + environment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms"); //$NON-NLS-1$
        AJLog.log(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " //$NON-NLS-1$
                + environment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms"); //$NON-NLS-1$
    }

}

From source file:org.eclipse.ajdt.core.parserbridge.AJCompilationUnitProblemFinder.java

License:Open Source License

public static CompilationUnitDeclaration processAJ( // AspectJ Change
        CompilationUnit unitElement, // AspectJ Change
        CommentRecorderParser parser, // AspectJ Change
        WorkingCopyOwner workingCopyOwner, HashMap<String, CategorizedProblem[]> problems, boolean creatingAST,
        int reconcileFlags, IProgressMonitor monitor) throws JavaModelException {

    boolean isJavaFileInAJEditor = (reconcileFlags & JAVA_FILE_IN_AJ_EDITOR) != 0;

    JavaProject project = (JavaProject) unitElement.getJavaProject();
    ITDAwareNameEnvironment environment = null;
    CancelableProblemFactory problemFactory = null;
    AJCompilationUnitProblemFinder problemFinder = null; // AspectJ Change
    try {/*w  w  w . j  a v  a  2s  . c om*/

        // AspectJ Change begin
        // use an ITDAware environment to ensure that ITDs are included for source types
        environment = new ITDAwareNameEnvironment(project, workingCopyOwner, monitor);
        // AspectJ Change end

        problemFactory = new CancelableProblemFactory(monitor);
        problemFinder = new AJCompilationUnitProblemFinder( // AspectJ Change
                environment, getHandlingPolicy(),
                getCompilerOptions(project.getOptions(true), creatingAST,
                        ((reconcileFlags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0)),
                getRequestor(), problemFactory, unitElement);
        CompilationUnitDeclaration unit = null;

        // AspectJ Change begin 
        // the parser should be a SourceElementParser or AJSourceElementParser2.
        // this ensures that a diet parse can be done, while at the same time
        // all declarations be reported
        if (parser != null) {
            problemFinder.parser = parser;
        }
        try {
            if (problemFinder.parser instanceof SourceElementParser) {
                unit = ((SourceElementParser) problemFinder.parser).parseCompilationUnit(unitElement,
                        true/* full parse */, monitor);
                problemFinder.resolve(unit, unitElement, true, // verify methods
                        true, // analyze code
                        true); // generate code
            } else if (problemFinder.parser instanceof AJSourceElementParser2) {
                unit = ((AJSourceElementParser2) problemFinder.parser).parseCompilationUnit(unitElement,
                        true/* full parse */, monitor);
                problemFinder.resolve(unit, unitElement, true, // verify methods
                        true, // analyze code
                        true); // generate code
            } else {
                unit = problemFinder.resolve(unitElement, true, // verify methods
                        true, // analyze code
                        true); // generate code
            }

        } catch (AbortCompilation e) {
            problemFinder.handleInternalException(e, unit);
        }

        // revert the compilation units that have ITDs in them
        ((ITDAwareLookupEnvironment) problemFinder.lookupEnvironment).revertCompilationUnits();
        // AspectJ Change end

        CompilationResult unitResult = unit.compilationResult;
        CategorizedProblem[] unitProblems = unitResult.getProblems();
        int length = unitProblems == null ? 0 : unitProblems.length;
        if (length > 0) {
            // AspectJ Change begin
            // filter out spurious problems
            CategorizedProblem[] categorizedProblems = new CategorizedProblem[length];
            System.arraycopy(unitProblems, 0, categorizedProblems, 0, length);
            categorizedProblems = removeAJNonProblems(categorizedProblems, unitElement, isJavaFileInAJEditor);
            if (categorizedProblems.length > 0) {
                problems.put(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, categorizedProblems);
            }
            // AspectJ Change end
        }
        unitProblems = unitResult.getTasks();
        length = unitProblems == null ? 0 : unitProblems.length;
        if (length > 0) {
            CategorizedProblem[] categorizedProblems = new CategorizedProblem[length];
            System.arraycopy(unitProblems, 0, categorizedProblems, 0, length);
            problems.put(IJavaModelMarker.TASK_MARKER, categorizedProblems);
        }
        if (NameLookup.VERBOSE) {
            AJLog.log(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " //$NON-NLS-1$
                    + environment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms"); //$NON-NLS-1$
            AJLog.log(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " //$NON-NLS-1$
                    + environment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms"); //$NON-NLS-1$
        }
        return unit;
    } catch (OperationCanceledException e) {
        // catch this exception so as to not enter the
        // catch(RuntimeException e) below
        throw e;
    } catch (RuntimeException e) {
        String message = handleException(unitElement, environment, e);
        throw new JavaModelException(new RuntimeException(message, e),
                IJavaModelStatusConstants.COMPILER_FAILURE);

    } finally {
        if (environment != null)
            environment.setMonitor(null); // AJDT 3.6 // don't hold a reference to this
                                          // external object
        if (problemFactory != null)
            problemFactory.monitor = null; // don't hold a reference to this
                                           // external object
                                           // NB: unit.cleanUp() is done by caller
        if (problemFinder != null && !creatingAST)
            problemFinder.lookupEnvironment.reset();
    }
}

From source file:org.eclipse.jdt.core.dom.CompilationUnitResolver.java

License:Open Source License

public static void resolve(ICompilationUnit[] compilationUnits, String[] bindingKeys, ASTRequestor requestor,
        int apiLevel, Map options, IJavaProject javaProject, WorkingCopyOwner owner, int flags,
        IProgressMonitor monitor) {//w w w.  ja v  a 2 s . co  m

    CancelableNameEnvironment environment = null;
    CancelableProblemFactory problemFactory = null;
    try {
        if (monitor != null) {
            int amountOfWork = (compilationUnits.length + bindingKeys.length) * 2; // 1 for beginToCompile, 1 for resolve
            monitor.beginTask("", amountOfWork); //$NON-NLS-1$
        }
        environment = new CancelableNameEnvironment(((JavaProject) javaProject), owner, monitor);
        problemFactory = new CancelableProblemFactory(monitor);
        CompilerOptions compilerOptions = getCompilerOptions(options,
                (flags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0);
        compilerOptions.ignoreMethodBodies = (flags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;
        // GROOVY start
        CompilerUtils.configureOptionsBasedOnNature(compilerOptions, javaProject);
        // GROOVY end
        CompilationUnitResolver resolver = new CompilationUnitResolver(environment, getHandlingPolicy(),
                compilerOptions, getRequestor(), problemFactory, monitor, javaProject != null);
        resolver.resolve(compilationUnits, bindingKeys, requestor, apiLevel, options, owner, flags);
        if (NameLookup.VERBOSE) {
            System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " //$NON-NLS-1$
                    + environment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms"); //$NON-NLS-1$
            System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " //$NON-NLS-1$
                    + environment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms"); //$NON-NLS-1$
        }
    } catch (JavaModelException e) {
        // project doesn't exist -> simple parse without resolving
        parse(compilationUnits, requestor, apiLevel, options, flags, monitor);
    } 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
        }
    }
}

From source file:org.eclipse.jdt.core.dom.CompilationUnitResolver.java

License:Open Source License

public static void resolve(String[] sourceUnits, String[] encodings, String[] bindingKeys,
        FileASTRequestor requestor, int apiLevel, Map options, List classpaths, int flags,
        IProgressMonitor monitor) {/*w  ww.ja v a2 s .  c o m*/

    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: " //$NON-NLS-1$
                    + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms"); //$NON-NLS-1$
            System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " //$NON-NLS-1$
                    + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms"); //$NON-NLS-1$
        }
    } 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
        }
    }
}

From source file:org.eclipse.jdt.core.dom.CompilationUnitResolver.java

License:Open Source License

public static CompilationUnitDeclaration resolve(
        org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit, IJavaProject javaProject,
        List classpaths, NodeSearcher nodeSearcher, Map options, WorkingCopyOwner owner, int flags,
        IProgressMonitor monitor) throws JavaModelException {

    CompilationUnitDeclaration unit = null;
    INameEnvironmentWithProgress environment = null;
    CancelableProblemFactory problemFactory = null;
    CompilationUnitResolver resolver = null;
    try {/*from www.j a  va  2s  . c om*/
        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;
        // GROOVY start   
        CompilerUtils.configureOptionsBasedOnNature(compilerOptions, javaProject);
        // GROOVY end
        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: " //$NON-NLS-1$
                    + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms"); //$NON-NLS-1$
            System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " //$NON-NLS-1$
                    + cancelableNameEnvironment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms"); //$NON-NLS-1$
        }
        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
        }
    }
}

From source file:org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.java

License:Open Source License

public static CompilationUnitDeclaration process(CompilationUnit unitElement, SourceElementParser parser,
        WorkingCopyOwner workingCopyOwner, HashMap problems, boolean creatingAST, int reconcileFlags,
        IProgressMonitor monitor) throws JavaModelException {

    JavaProject project = (JavaProject) unitElement.getJavaProject();
    CancelableNameEnvironment environment = null;
    CancelableProblemFactory problemFactory = null;
    CompilationUnitProblemFinder problemFinder = null;
    CompilationUnitDeclaration unit = null;
    try {/*from  ww w.  j a  v  a 2s. c om*/
        environment = new CancelableNameEnvironment(project, workingCopyOwner, monitor);
        problemFactory = new CancelableProblemFactory(monitor);
        CompilerOptions compilerOptions = getCompilerOptions(project.getOptions(true), creatingAST,
                ((reconcileFlags & ICompilationUnit.ENABLE_STATEMENTS_RECOVERY) != 0));
        boolean ignoreMethodBodies = (reconcileFlags & ICompilationUnit.IGNORE_METHOD_BODIES) != 0;
        compilerOptions.ignoreMethodBodies = ignoreMethodBodies;
        // GROOVY start
        // options fetched prior to building problem finder then configured based on project
        CompilerUtils.configureOptionsBasedOnNature(compilerOptions, project);
        // GROOVY end
        problemFinder = new CompilationUnitProblemFinder(environment, getHandlingPolicy(), compilerOptions,
                getRequestor(), problemFactory);
        boolean analyzeAndGenerateCode = true;
        if (ignoreMethodBodies) {
            analyzeAndGenerateCode = false;
        }
        try {
            if (parser != null) {
                problemFinder.parser = parser;
                unit = parser.parseCompilationUnit(unitElement, true/*full parse*/, monitor);
                problemFinder.resolve(unit, unitElement, true, // verify methods
                        analyzeAndGenerateCode, // analyze code
                        analyzeAndGenerateCode); // generate code
            } else {
                unit = problemFinder.resolve(unitElement, true, // verify methods
                        analyzeAndGenerateCode, // analyze code
                        analyzeAndGenerateCode); // generate code
            }
        } catch (AbortCompilation e) {
            problemFinder.handleInternalException(e, unit);
        }
        if (unit != null) {
            CompilationResult unitResult = unit.compilationResult;
            CategorizedProblem[] unitProblems = unitResult.getProblems();
            int length = unitProblems == null ? 0 : unitProblems.length;
            if (length > 0) {
                CategorizedProblem[] categorizedProblems = new CategorizedProblem[length];
                System.arraycopy(unitProblems, 0, categorizedProblems, 0, length);
                problems.put(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, categorizedProblems);
            }
            unitProblems = unitResult.getTasks();
            length = unitProblems == null ? 0 : unitProblems.length;
            if (length > 0) {
                CategorizedProblem[] categorizedProblems = new CategorizedProblem[length];
                System.arraycopy(unitProblems, 0, categorizedProblems, 0, length);
                problems.put(IJavaModelMarker.TASK_MARKER, categorizedProblems);
            }
            if (NameLookup.VERBOSE) {
                System.out.println(
                        Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " //$NON-NLS-1$
                                + environment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms"); //$NON-NLS-1$
                System.out.println(
                        Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " //$NON-NLS-1$
                                + environment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms"); //$NON-NLS-1$
            }
        }
    } catch (OperationCanceledException e) {
        // catch this exception so as to not enter the catch(RuntimeException e) below
        throw e;
    } catch (RuntimeException e) {
        // avoid breaking other tools due to internal compiler failure (40334)
        String lineDelimiter = unitElement.findRecommendedLineSeparator();
        StringBuffer message = new StringBuffer("Exception occurred during problem detection:"); //$NON-NLS-1$
        message.append(lineDelimiter);
        message.append(
                "----------------------------------- SOURCE BEGIN -------------------------------------"); //$NON-NLS-1$
        message.append(lineDelimiter);
        message.append(unitElement.getSource());
        message.append(lineDelimiter);
        message.append("----------------------------------- SOURCE END -------------------------------------"); //$NON-NLS-1$
        Util.log(e, message.toString());
        throw new JavaModelException(e, IJavaModelStatusConstants.COMPILER_FAILURE);
    } finally {
        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
        // NB: unit.cleanUp() is done by caller
        if (problemFinder != null && !creatingAST)
            problemFinder.lookupEnvironment.reset();
    }
    return unit;
}

From source file:org.eclipse.jdt.internal.core.JavaModelManager.java

License:Open Source License

/**
 * Configure the plugin with respect to option settings defined in ".options" file
 *//*from w  ww . j a  v  a 2s.c  o m*/
public void configurePluginDebugOptions() {
    if (JavaCore.getPlugin().isDebugging()) {
        String option = Platform.getDebugOption(BUFFER_MANAGER_DEBUG);
        if (option != null)
            BufferManager.VERBOSE = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(BUILDER_DEBUG);
        if (option != null)
            JavaBuilder.DEBUG = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(COMPILER_DEBUG);
        if (option != null)
            Compiler.DEBUG = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(BUILDER_STATS_DEBUG);
        if (option != null)
            JavaBuilder.SHOW_STATS = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(COMPLETION_DEBUG);
        if (option != null)
            CompletionEngine.DEBUG = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(CP_RESOLVE_DEBUG);
        if (option != null)
            JavaModelManager.CP_RESOLVE_VERBOSE = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(CP_RESOLVE_ADVANCED_DEBUG);
        if (option != null)
            JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(CP_RESOLVE_FAILURE_DEBUG);
        if (option != null)
            JavaModelManager.CP_RESOLVE_VERBOSE_FAILURE = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(DELTA_DEBUG);
        if (option != null)
            DeltaProcessor.DEBUG = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(DELTA_DEBUG_VERBOSE);
        if (option != null)
            DeltaProcessor.VERBOSE = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(HIERARCHY_DEBUG);
        if (option != null)
            TypeHierarchy.DEBUG = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(INDEX_MANAGER_DEBUG);
        if (option != null)
            JobManager.VERBOSE = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(INDEX_MANAGER_ADVANCED_DEBUG);
        if (option != null)
            IndexManager.DEBUG = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(JAVAMODEL_DEBUG);
        if (option != null)
            JavaModelManager.VERBOSE = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(JAVAMODELCACHE_DEBUG);
        if (option != null)
            JavaModelCache.VERBOSE = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(POST_ACTION_DEBUG);
        if (option != null)
            JavaModelOperation.POST_ACTION_VERBOSE = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(RESOLUTION_DEBUG);
        if (option != null)
            NameLookup.VERBOSE = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(SEARCH_DEBUG);
        if (option != null)
            BasicSearchEngine.VERBOSE = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(SELECTION_DEBUG);
        if (option != null)
            SelectionEngine.DEBUG = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(ZIP_ACCESS_DEBUG);
        if (option != null)
            JavaModelManager.ZIP_ACCESS_VERBOSE = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(SOURCE_MAPPER_DEBUG_VERBOSE);
        if (option != null)
            SourceMapper.VERBOSE = option.equalsIgnoreCase(TRUE);

        option = Platform.getDebugOption(FORMATTER_DEBUG);
        if (option != null)
            DefaultCodeFormatter.DEBUG = option.equalsIgnoreCase(TRUE);
    }

    // configure performance options
    if (PerformanceStats.ENABLED) {
        CompletionEngine.PERF = PerformanceStats.isEnabled(COMPLETION_PERF);
        SelectionEngine.PERF = PerformanceStats.isEnabled(SELECTION_PERF);
        DeltaProcessor.PERF = PerformanceStats.isEnabled(DELTA_LISTENER_PERF);
        JavaModelManager.PERF_VARIABLE_INITIALIZER = PerformanceStats.isEnabled(VARIABLE_INITIALIZER_PERF);
        JavaModelManager.PERF_CONTAINER_INITIALIZER = PerformanceStats.isEnabled(CONTAINER_INITIALIZER_PERF);
        ReconcileWorkingCopyOperation.PERF = PerformanceStats.isEnabled(RECONCILE_PERF);
    }
}

From source file:org.eclipse.objectteams.otdt.tests.AbstractJavaModelTests.java

License:Open Source License

protected void setUp() throws Exception {
    //{ObjectTeams: 
    if (_usePerformanceMeter)
        //}/*from w w w  .j a  va  2 s .  c om*/
        super.setUp();

    if (NameLookup.VERBOSE || BasicSearchEngine.VERBOSE || JavaModelManager.VERBOSE) {
        System.out.println("--------------------------------------------------------------------------------");
        System.out.println("Running test " + getName() + "...");
    }
}