Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Use SourceVersion.latestSupported() to avoid warning with JDK 7. #175

Merged
merged 1 commit into from Mar 2, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -34,7 +34,6 @@
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.SupportedSourceVersion;
import javax.inject.Singleton;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
Expand All @@ -52,10 +51,13 @@
* Performs full graph analysis on a module.
*/
@SupportedAnnotationTypes("dagger.Module")
@SupportedSourceVersion(SourceVersion.RELEASE_6)
public final class FullGraphProcessor extends AbstractProcessor {
private final Set<String> delayedModuleNames = new LinkedHashSet<String>();

@Override public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latestSupported();
}

/**
* Perform full-graph analysis on complete modules. This checks that all of
* the module's dependencies are satisfied.
Expand Down
Expand Up @@ -30,7 +30,6 @@
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.SupportedSourceVersion;
import javax.inject.Inject;
import javax.inject.Provider;
import javax.inject.Singleton;
Expand Down Expand Up @@ -58,10 +57,13 @@
* {@literal @}{@code Inject}-annotated members of a class.
*/
@SupportedAnnotationTypes("javax.inject.Inject")
@SupportedSourceVersion(SourceVersion.RELEASE_6)
public final class InjectProcessor extends AbstractProcessor {
private final Set<String> remainingTypeNames = new LinkedHashSet<String>();

@Override public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latestSupported();
}

@Override public boolean process(Set<? extends TypeElement> types, RoundEnvironment env) {
remainingTypeNames.addAll(getInjectedClassNames(env));
for (Iterator<String> i = remainingTypeNames.iterator(); i.hasNext();) {
Expand Down
Expand Up @@ -35,7 +35,6 @@
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.SupportedSourceVersion;
import javax.inject.Provider;
import javax.inject.Singleton;
import javax.lang.model.SourceVersion;
Expand All @@ -62,13 +61,16 @@
* for each {@code @Provides} method of a target class.
*/
@SupportedAnnotationTypes({ "dagger.Provides", "dagger.Module" })
@SupportedSourceVersion(SourceVersion.RELEASE_6)
public final class ProvidesProcessor extends AbstractProcessor {
private final LinkedHashMap<String, List<ExecutableElement>> remainingTypes =
new LinkedHashMap<String, List<ExecutableElement>>();
private static final String BINDINGS_MAP = JavaWriter.type(
Map.class, String.class.getCanonicalName(), Binding.class.getCanonicalName() + "<?>");

@Override public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latestSupported();
}

// TODO: include @Provides methods from the superclass
@Override public boolean process(Set<? extends TypeElement> types, RoundEnvironment env) {
remainingTypes.putAll(providerMethodsByClass(env));
Expand Down