Skip to content

Commit

Permalink
Logging cleanup. Add .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Jul 31, 2012
1 parent a081fb0 commit d2858b5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.classpath
.project
.settings
eclipsebin

bin
gen
build
out
lib

target
pom.xml.*
release.properties

.idea
*.iml
classes

obj

.DS_Store
9 changes: 3 additions & 6 deletions src/main/java/com/squareup/codegen/ProvidesProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,20 @@ private Map<TypeElement, List<ExecutableElement>> providerMethodsByClass(RoundEn
TypeElement type = (TypeElement) providerMethod.getEnclosingElement();
Set<Modifier> typeModifiers = type.getModifiers();
if (type.getKind() != ElementKind.CLASS) {
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR,
"Unexpected @Provides on " + providerMethod);
error("Unexpected @Provides on " + providerMethod);
continue;
}
if (typeModifiers.contains(Modifier.PRIVATE)
|| typeModifiers.contains(Modifier.ABSTRACT)) {
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR,
"Classes declaring @Provides methods must not be private or abstract: "
error("Classes declaring @Provides methods must not be private or abstract: "
+ type.getQualifiedName());
}

Set<Modifier> methodModifiers = providerMethod.getModifiers();
if (methodModifiers.contains(Modifier.PRIVATE)
|| methodModifiers.contains(Modifier.ABSTRACT)
|| methodModifiers.contains(Modifier.STATIC)) {
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR,
"@Provides methods must not be private, abstract or static: "
error("@Provides methods must not be private, abstract or static: "
+ type.getQualifiedName() + "." + providerMethod);
continue;
}
Expand Down

0 comments on commit d2858b5

Please sign in to comment.