List of usage examples for org.eclipse.jdt.internal.compiler.impl CompilerOptions OPTION_TaskTags
String OPTION_TaskTags
To view the source code for org.eclipse.jdt.internal.compiler.impl CompilerOptions OPTION_TaskTags.
Click Source Link
From source file:com.codenvy.ide.ext.java.BaseTest.java
License:Open Source License
public BaseTest() { options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_7); options.put(JavaCore.CORE_ENCODING, "UTF-8"); options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_7); options.put(CompilerOptions.OPTION_TargetPlatform, JavaCore.VERSION_1_7); options.put(AssistOptions.OPTION_PerformVisibilityCheck, AssistOptions.ENABLED); options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING); options.put(CompilerOptions.OPTION_TaskTags, CompilerOptions.WARNING); options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING); options.put(CompilerOptions.OPTION_SuppressWarnings, CompilerOptions.DISABLED); options.put(JavaCore.COMPILER_TASK_TAGS, "TODO,FIXME,XXX"); options.put(JavaCore.COMPILER_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE, JavaCore.ENABLED); options.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED); options.put(CompilerOptions.OPTION_Process_Annotations, JavaCore.DISABLED); }
From source file:com.codenvy.ide.ext.java.server.internal.core.search.matching.MatchLocator.java
License:Open Source License
/** * Create a new parser for the given project, as well as a lookup environment. *//*from www . j a v a2s. co m*/ public void initialize(JavaProject project, int possibleMatchSize) throws JavaModelException { // clean up name environment only if there are several possible match as it is reused // when only one possible match (bug 58581) if (this.nameEnvironment != null && possibleMatchSize != 1) this.nameEnvironment.cleanup(); SearchableEnvironment searchableEnvironment = project.newSearchableNameEnvironment(this.workingCopies); // if only one possible match, a file name environment costs too much, // so use the existing searchable environment which will populate the java model // only for this possible match and its required types. this.nameEnvironment = possibleMatchSize == 1 ? (INameEnvironment) searchableEnvironment : (INameEnvironment) new JavaSearchNameEnvironment(project, this.workingCopies); // create lookup environment Map map = project.getOptions(true); map.put(CompilerOptions.OPTION_TaskTags, org.eclipse.jdt.internal.compiler.util.Util.EMPTY_STRING); this.options = new CompilerOptions(map); ProblemReporter problemReporter = new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(), this.options, new DefaultProblemFactory()); this.lookupEnvironment = new LookupEnvironment(this, this.options, problemReporter, this.nameEnvironment); this.lookupEnvironment.mayTolerateMissingType = true; this.parser = MatchLocatorParser.createParser(problemReporter, this); // basic parser needs also to be reset as project options may have changed // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=163072 this.basicParser = null; // remember project's name lookup this.nameLookup = searchableEnvironment.nameLookup; // initialize queue of units this.numberOfMatches = 0; this.matchesToProcess = new PossibleMatch[possibleMatchSize]; }
From source file:dacapo.eclipse.EclipseBuildTests.java
License:Open Source License
protected static Hashtable warningOptions(int kind) { // Values/*from w ww .j a va 2 s . c o m*/ Hashtable optionsMap = null; switch (kind) { case 0: optionsMap = JavaCore.getDefaultOptions(); break; default: optionsMap = new Hashtable(350); break; } if (kind == 0) { // Default set since 3.1 optionsMap.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.IGNORE); } else { boolean all = kind == 1; String generate = all ? CompilerOptions.GENERATE : CompilerOptions.DO_NOT_GENERATE; String warning = all ? CompilerOptions.WARNING : CompilerOptions.IGNORE; String enabled = all ? CompilerOptions.ENABLED : CompilerOptions.DISABLED; String preserve = all ? CompilerOptions.OPTIMIZE_OUT : CompilerOptions.PRESERVE; // Set options values optionsMap.put(CompilerOptions.OPTION_LocalVariableAttribute, generate); optionsMap.put(CompilerOptions.OPTION_LineNumberAttribute, generate); optionsMap.put(CompilerOptions.OPTION_SourceFileAttribute, generate); optionsMap.put(CompilerOptions.OPTION_PreserveUnusedLocal, preserve); optionsMap.put(CompilerOptions.OPTION_DocCommentSupport, enabled); optionsMap.put(CompilerOptions.OPTION_ReportMethodWithConstructorName, warning); optionsMap.put(CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, warning); optionsMap.put(CompilerOptions.OPTION_ReportDeprecation, warning); optionsMap.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, enabled); optionsMap.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, enabled); optionsMap.put(CompilerOptions.OPTION_ReportHiddenCatchBlock, warning); optionsMap.put(CompilerOptions.OPTION_ReportUnusedLocal, warning); optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameter, warning); optionsMap.put(CompilerOptions.OPTION_ReportUnusedImport, warning); optionsMap.put(CompilerOptions.OPTION_ReportSyntheticAccessEmulation, warning); optionsMap.put(CompilerOptions.OPTION_ReportNoEffectAssignment, warning); optionsMap.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, warning); optionsMap.put(CompilerOptions.OPTION_ReportNoImplicitStringConversion, warning); optionsMap.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, warning); optionsMap.put(CompilerOptions.OPTION_ReportIndirectStaticAccess, warning); optionsMap.put(CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, warning); optionsMap.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, warning); optionsMap.put(CompilerOptions.OPTION_ReportLocalVariableHiding, warning); optionsMap.put(CompilerOptions.OPTION_ReportFieldHiding, warning); optionsMap.put(CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, warning); optionsMap.put(CompilerOptions.OPTION_ReportEmptyStatement, warning); optionsMap.put(CompilerOptions.OPTION_ReportAssertIdentifier, warning); optionsMap.put(CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, warning); optionsMap.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, warning); optionsMap.put(CompilerOptions.OPTION_ReportUnnecessaryElse, warning); optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadoc, warning); optionsMap.put(CompilerOptions.OPTION_ReportInvalidJavadocTags, enabled); optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocTags, warning); optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocComments, warning); optionsMap.put(CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, warning); optionsMap.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, warning); optionsMap.put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, warning); optionsMap.put(CompilerOptions.OPTION_TaskTags, all ? JavaCore.DEFAULT_TASK_TAGS : ""); optionsMap.put(CompilerOptions.OPTION_TaskPriorities, all ? JavaCore.DEFAULT_TASK_PRIORITIES : ""); optionsMap.put(CompilerOptions.OPTION_TaskCaseSensitive, enabled); optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenImplementingAbstract, enabled); optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameterWhenOverridingConcrete, enabled); optionsMap.put(CompilerOptions.OPTION_ReportSpecialParameterHidingField, enabled); optionsMap.put(CompilerOptions.OPTION_InlineJsr, enabled); } // Ignore 3.1 options optionsMap.put(CompilerOptions.OPTION_ReportMissingSerialVersion, CompilerOptions.IGNORE); optionsMap.put(CompilerOptions.OPTION_ReportEnumIdentifier, CompilerOptions.IGNORE); // Return created options map return optionsMap; }
From source file:org.ant4eclipse.ant.jdt.ecj.CompilerOptionsProvider.java
License:Open Source License
/** * <p>/*w ww . j a v a 2s. co m*/ * Returns the compiler options specified in the javac task. * </p> * * @param javac * the javac task * @return the compiler options specified in the javac task. */ @SuppressWarnings("unchecked") private static final StringMap getJavacCompilerOptions(Javac javac) { StringMap result = new StringMap(); /* * set the source option */ if (Utilities.hasText(javac.getSource())) { // get the source String source = javac.getSource(); // set the source if (source.equals("1.3")) { result.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_3); } else if (source.equals("1.4")) { result.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4); } else if (source.equals("1.5") || source.equals("5") || source.equals("5.0")) { result.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_5); } else if (source.equals("1.6") || source.equals("6") || source.equals("6.0")) { result.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6); } else if (source.equals("1.7") || source.equals("7") || source.equals("7.0")) { result.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7); } else if (source.equals("1.8") || source.equals("8") || source.equals("8.0")) { result.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8); } else { throw new Ant4EclipseException(EcjExceptionCodes.UNKNOWN_JAVA_SOURCE_OPTION_EXCEPTION, source); } } /* * set the target option */ if (Utilities.hasText(javac.getTarget())) { // get the target String target = javac.getTarget(); // set the target if (target.equals("1.3")) { result.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_3); result.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_3); } else if (target.equals("1.4")) { result.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4); result.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4); } else if (target.equals("1.5") || target.equals("5") || target.equals("5.0")) { result.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_5); result.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_5); } else if (target.equals("1.6") || target.equals("6") || target.equals("6.0")) { result.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); result.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); } else if (target.equals("1.7") || target.equals("7") || target.equals("7.0")) { result.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7); result.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7); } else if (target.equals("1.8") || target.equals("8") || target.equals("8.0")) { result.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8); result.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8); } else { throw new Ant4EclipseException(EcjExceptionCodes.UNKNOWN_JAVA_TARGET_OPTION_EXCEPTION, target); } } /* * set the debug options */ if (javac.getDebug()) { String debugLevel = javac.getDebugLevel(); if (debugLevel != null) { result.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.DO_NOT_GENERATE); result.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.DO_NOT_GENERATE); result.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.DO_NOT_GENERATE); if (debugLevel.length() != 0) { if (debugLevel.indexOf("vars") != -1) { result.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE); } if (debugLevel.indexOf("lines") != -1) { result.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.GENERATE); } if (debugLevel.indexOf("source") != -1) { result.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE); } } } else { result.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.GENERATE); result.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.GENERATE); result.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE); } } else { result.put(CompilerOptions.OPTION_LocalVariableAttribute, CompilerOptions.DO_NOT_GENERATE); result.put(CompilerOptions.OPTION_LineNumberAttribute, CompilerOptions.DO_NOT_GENERATE); result.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.DO_NOT_GENERATE); } /* * Handle the nowarn option. If none, then we generate all warnings. */ if (javac.getNowarn()) { // disable all warnings Map.Entry<String, String>[] entries = result.entrySet().toArray(new Map.Entry[result.size()]); for (Entry<String, String> entrie : entries) { Map.Entry<String, String> entry = entrie; if (entry.getValue().equals(CompilerOptions.WARNING)) { result.put(entry.getKey(), CompilerOptions.IGNORE); } } result.put(CompilerOptions.OPTION_TaskTags, Util.EMPTY_STRING); if (javac.getDeprecation()) { result.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.WARNING); result.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.ENABLED); result.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.ENABLED); } } else if (javac.getDeprecation()) { result.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.WARNING); result.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.ENABLED); result.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.ENABLED); } else { result.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.IGNORE); result.put(CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, CompilerOptions.DISABLED); result.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.DISABLED); } /* * set the encoding option */ if (javac.getEncoding() != null) { result.put(CompilerOptions.OPTION_Encoding, javac.getEncoding()); } // return result return result; }
From source file:org.ecipse.che.plugin.testing.testng.server.BaseTest.java
License:Open Source License
public BaseTest() { options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8); options.put(JavaCore.CORE_ENCODING, "UTF-8"); options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8); options.put(CompilerOptions.OPTION_TargetPlatform, JavaCore.VERSION_1_8); options.put(AssistOptions.OPTION_PerformVisibilityCheck, AssistOptions.ENABLED); options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING); options.put(CompilerOptions.OPTION_TaskTags, CompilerOptions.WARNING); options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING); options.put(CompilerOptions.OPTION_SuppressWarnings, CompilerOptions.DISABLED); options.put(JavaCore.COMPILER_TASK_TAGS, "TODO,FIXME,XXX"); options.put(JavaCore.COMPILER_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE, JavaCore.ENABLED); options.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED); options.put(CompilerOptions.OPTION_Process_Annotations, JavaCore.DISABLED); }
From source file:org.eclipse.che.jdt.internal.core.search.matching.MatchLocator.java
License:Open Source License
/** * Create a new parser for the given project, as well as a lookup environment. */// w w w . j a v a 2 s . co m public void initialize(JavaProject project, int possibleMatchSize) throws JavaModelException { // clean up name environment only if there are several possible match as it is reused // when only one possible match (bug 58581) if (this.nameEnvironment != null && possibleMatchSize != 1) { this.nameEnvironment.cleanup(); this.unitScope = null; // don't leak a reference to the cleaned-up name environment } SearchableEnvironment searchableEnvironment = project.newSearchableNameEnvironment(this.workingCopies); // if only one possible match, a file name environment costs too much, // so use the existing searchable environment which will populate the java model // only for this possible match and its required types. this.nameEnvironment = possibleMatchSize == 1 ? (INameEnvironment) searchableEnvironment : (INameEnvironment) new JavaSearchNameEnvironment(project, this.workingCopies); // create lookup environment Map map = project.getOptions(true); map.put(CompilerOptions.OPTION_TaskTags, org.eclipse.jdt.internal.compiler.util.Util.EMPTY_STRING); this.options = new CompilerOptions(map); ProblemReporter problemReporter = new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(), this.options, new DefaultProblemFactory()); this.lookupEnvironment = new LookupEnvironment(this, this.options, problemReporter, this.nameEnvironment); this.lookupEnvironment.mayTolerateMissingType = true; this.parser = MatchLocatorParser.createParser(problemReporter, this); // basic parser needs also to be reset as project options may have changed // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=163072 this.basicParser = null; // remember project's name lookup //todo port searchableEnvironment this.nameLookup = null; //searchableEnvironment.nameLookup; // initialize queue of units this.numberOfMatches = 0; this.matchesToProcess = new PossibleMatch[possibleMatchSize]; this.lookupEnvironment.addResolutionListener(this.patternLocator); }
From source file:org.eclipse.che.jdt.JavaProjectService.java
License:Open Source License
@Inject public JavaProjectService(EventService eventService, LocalFSMountStrategy fsMountStrategy, @Named("che.java.codeassistant.index.dir") String temp) { eventService.subscribe(new VirtualFileEventSubscriber()); this.fsMountStrategy = fsMountStrategy; tempDir = temp;/*w ww . j a v a 2s . c om*/ options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_7); options.put(JavaCore.CORE_ENCODING, "UTF-8"); options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_7); options.put(CompilerOptions.OPTION_TargetPlatform, JavaCore.VERSION_1_7); options.put(AssistOptions.OPTION_PerformVisibilityCheck, AssistOptions.ENABLED); options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING); options.put(CompilerOptions.OPTION_TaskTags, CompilerOptions.WARNING); options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING); options.put(CompilerOptions.OPTION_SuppressWarnings, CompilerOptions.DISABLED); options.put(JavaCore.COMPILER_TASK_TAGS, "TODO,FIXME,XXX"); options.put(JavaCore.COMPILER_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE, JavaCore.ENABLED); options.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED); options.put(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED); options.put(CompilerOptions.OPTION_Process_Annotations, JavaCore.ENABLED); options.put(CompilerOptions.OPTION_GenerateClassFiles, JavaCore.ENABLED); cache = CacheBuilder.newBuilder().expireAfterAccess(4, TimeUnit.HOURS) .removalListener(new RemovalListener<String, JavaProject>() { @Override public void onRemoval(RemovalNotification<String, JavaProject> notification) { JavaProject value = notification.getValue(); if (value != null) { closeProject(value); deleteDependencyDirectory(value.getWsId(), value.getProjectPath()); } } }).build(); }
From source file:org.eclipse.jdt.internal.core.search.matching.MatchLocator.java
License:Open Source License
/** * Create a new parser for the given project, as well as a lookup environment. *///from www .j av a 2 s. co m public void initialize(JavaProject project, int possibleMatchSize) throws JavaModelException { // clean up name environment only if there are several possible match as it is reused // when only one possible match (bug 58581) if (this.nameEnvironment != null && possibleMatchSize != 1) this.nameEnvironment.cleanup(); SearchableEnvironment searchableEnvironment = project.newSearchableNameEnvironment(this.workingCopies); // if only one possible match, a file name environment costs too much, // so use the existing searchable environment which will populate the java model // only for this possible match and its required types. this.nameEnvironment = possibleMatchSize == 1 ? (INameEnvironment) searchableEnvironment : (INameEnvironment) new JavaSearchNameEnvironment(project, this.workingCopies); // create lookup environment Map map = project.getOptions(true); map.put(CompilerOptions.OPTION_TaskTags, org.eclipse.jdt.internal.compiler.util.Util.EMPTY_STRING); this.options = new CompilerOptions(map); ProblemReporter problemReporter = new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(), this.options, new DefaultProblemFactory()); this.lookupEnvironment = new LookupEnvironment(this, this.options, problemReporter, this.nameEnvironment); this.parser = MatchLocatorParser.createParser(problemReporter, this); // basic parser needs also to be reset as project options may have changed // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=163072 this.basicParser = null; // remember project's name lookup this.nameLookup = searchableEnvironment.nameLookup; // initialize queue of units this.numberOfMatches = 0; this.matchesToProcess = new PossibleMatch[possibleMatchSize]; }