Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Logging cleanup. Add .gitignore

  • Loading branch information...
commit d2858b56109222b1e60556b7fc2d3332196abe05 1 parent a081fb0
@JakeWharton JakeWharton authored
View
22 .gitignore
@@ -0,0 +1,22 @@
+.classpath
+.project
+.settings
+eclipsebin
+
+bin
+gen
+build
+out
+lib
+
+target
+pom.xml.*
+release.properties
+
+.idea
+*.iml
+classes
+
+obj
+
+.DS_Store
View
9 src/main/java/com/squareup/codegen/ProvidesProcessor.java
@@ -91,14 +91,12 @@ private void error(String message) {
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());
}
@@ -106,8 +104,7 @@ private void error(String message) {
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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.